如何将已提交的更改上传到我的GitHub存储库? [英] How can I upload committed changes to my GitHub repository?

查看:57
本文介绍了如何将已提交的更改上传到我的GitHub存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 clone 在GitHub上创建了我的存储库的本地副本.

I used clone to create a local copy of my repository on GitHub.

我修改了一些文件.然后我做了: git commit -a

I modified a few files. Then I did: git commit -a

现在我想将已提交的更改保存到GitHub存储库中.

And now I want to save my committed changes to the GitHub repository.

我该怎么做?

推荐答案

推送您的更改:

git push origin master

master 替换为要推送的分支的名称(如果不同于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

这篇关于如何将已提交的更改上传到我的GitHub存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆