git 如何将提交的更改上传到我的 GitHub 存储库?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7028442/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I upload committed changes to my GitHub repository?
提问by Ahmed
I used clone
to create a local copy of my repository on GitHub.
我曾经clone
在 GitHub 上创建我的存储库的本地副本。
I modified a few files. Then I did:
git commit -a
我修改了几个文件。然后我做了:
git commit -a
And now I want to save my committed changes to the GitHub repository.
现在我想将我提交的更改保存到 GitHub 存储库。
How can I do that?
我怎样才能做到这一点?
回答by Tobi
You pushyour changes:
您推送您的更改:
git push origin master
Replace master
with the name of the branch you want to push, if different from master.
master
如果与 master 不同,则替换为您要推送的分支的名称。
In case the branch was updated since your last update, the changes may be rejected. In that case you have to pullthe 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
回答by urvashi bhagat
Follow this steps:
请按照以下步骤操作:
1. cd /project path
2. git add *
3. git commit -m "Enter commit message here"
4. git push
回答by Richard
You want to push your changes to the central repo with git push
. It might prompt you for your github password.
您想将更改推送到中央存储库git push
。它可能会提示您输入 github 密码。
回答by etrupja
To publish your local changes follow the 3 simple steps below:
要发布您的本地更改,请遵循以下 3 个简单步骤:
git add <filename>
orgit add *
to add everythinggit commit -m "Enter e message here"
git push
git add <filename>
或git add *
添加所有内容git commit -m "Enter e message here"
git push