Last active
December 16, 2015 06:09
-
-
Save yati-sagade/5389659 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Say your code resides in a dir called project/ locally and you want to push it up to an empty repo on github. Then, if your repo is called, say, foo, get its URL, e.g., https://github.com/sneha/foo.git and do | |
git remote add origin https://github.com/sneha/foo.git | |
from your project/ dir. After that, add files using `git add`. Use the followinng for all files: | |
git add . | |
Then commit changes | |
git commit -m "initial commit" | |
Now do | |
git push origin master | |
assuming you have just a single branch master. Otherwise, just replace master with whatever branch you want to push to. | |
After this when you make changes, add those files using `git add file1 file2...`, commit and push. | |
Another scenario is that you created the repo first and cloned it and added files and now want to push. If this is the case, skip the first step of adding a remote - just add what you want, commit and push. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment