简体   繁体   中英

There is olny a README.md in my github

I tried to upload my codes to github by following some tutorial but the last step couldn't be finished. I am using Ubuntu by the way. I am sorry I don't have enough reputation to post links in these command line but I am sure they were correct.

han@han-VirtualBox:~/Desktop/chen/project0-1$ git remote add origin 
han@han-VirtualBox:~/Desktop/chen/project0-1$ git push -u origin master
Username for
Password for  
To https://github.com/alvinvinvinvin/CS541-han.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.
han@han-VirtualBox:~/Desktop/chen/project0-1$ git remote add origin 
fatal: remote origin already exists.
han@han-VirtualBox:~/Desktop/chen/project0-1$ git push -u origin master
Username for
Password for 
Branch master set up to track remote branch master from origin.
Everything up-to-date
han@han-VirtualBox:~/Desktop/chen/project0-1$ git add .

As you can see I have tried couple ways to upload codes but there is still only a README.md in my github. I tried to google this problem but there is no clearly related answer. Could you help me out whith it? Thank you.


the tutorial said once I entered "git add ." it will add all files in that directory automatically. If it doesn't work is there any easier way to add files? I don't wanna add them one by one because that's too slow.


Thanks a lot. By following the order of commands from you I successfully made it. I supposed to keep input git commit and push origin master after git add .. I think that's why. How important it is to insist on getting things done. LOL. Thank you guys.

"Everything up-to-date" implies there were no changes to upload, have you done

git add <filename> // OR git add .
git commit -m"Commit Message"

To create a new commit and mark your code for uploading first?

This forms a general update loop:

git add .
git commit -m"A message to identify what changes have been made"
git push origin master

In turn these functions

  1. Add any files that havent' been checked in
  2. Create a new commit (think save point) in the projects history
  3. Send the new commit to the server where it's backed up and can be pulled to other devices

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM