How can I upload committed changes to my GitHub repository?
I used clone
to create a local copy of my repository on GitHub.
I modified a few files. Then I did:
git commit -a
And now I want to save my committed change开发者_JS百科s to the GitHub repository.
How can I do that?
You push your changes:
git push origin master
Replace master
with the name of the branch you want to push, if different from master.
In case the branch was updated since your last update, the changes may be rejected. In that case you have to pull the latest changes on the remote branch first:
git pull origin master
Optionally, you can rebase your changes on top of the remote master (this will prevent a merge commit), by using:
git pull origin master --rebase
Follow this steps:
1. cd /project path
2. git add *
3. git commit -m "Enter commit message here"
4. git push
You want to push your changes to the central repo with git push
. It might prompt you for your github password.
To publish your local changes follow the 3 simple steps below:
git add <filename>
orgit add *
to add everythinggit commit -m "Enter e message here"
git push
精彩评论