简体   繁体   English

Git推上游

[英]Git push upstream

I've tried looking for an answer for this but can't find a straight answer. 我已经尝试过寻找答案,但找不到合适的答案。

I'm running the code below. 我正在运行下面的代码。

git fetch upstream  # get the latest copy from master / upstream
git merge upstream/master  # merge the downloaded copies and merge to your copy
git commit -am"test"  # commit your latest changes
git push origin master  # push to your fork
git push upstream  # push to master copy from where you forked your project - is this safe?

is it safe to push to upstream ( git push upstream )? 向上游推送是否安全( git push upstream )? My main goal is to apply my changes from my fork to the main project. 我的主要目标是将我的更改从我的fork应用到主项目。 Or there's a better way? 还是有更好的方法? thanks 谢谢

It depends on wether you have the privileges to push. 这取决于你是否有权利推动。 If you haven't, ask the owner of the upstream repository to pull from your fork. 如果还没有,请让上游存储库的所有者从您的分支中提取。

Since you've tagged this question as GitHub, I assume you want to push your changes to your fork, then issue a pull request from GitHub's UI. 由于您已将此问题标记为GitHub,因此我假设您要将更改推送到fork,然后从GitHub的UI发出pull请求。 Git doesn't have a command line option to issue pull requests. Git没有命令行选项来发出拉取请求。

You can read more at https://help.github.com/articles/using-pull-requests 您可以访问https://help.github.com/articles/using-pull-requests了解更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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