简体   繁体   English

从远程Git存储库中提取更改并将我的分支提交到远程仓库

[英]Pull changes from remote Git repository and commit my branch to the remote repo

my use case is. 我的用例是。 I have made changes to my local repo with a branch called feature A. The remote repo is called origin. 我已经通过名为Feature A的分支对本地仓库进行了更改。远程仓库称为Origin。 There have been changes made to origin/master. 对来源/母版进行了更改。 I need to sync with origin master and push my changes(feature A) to the remote repo. 我需要与原始主机同步,并将我的更改(功能A)推送到远程存储库。

First you have to use git fetch to load data from your remote repository. 首先,您必须使用git fetch从远程存储库加载数据。
Then you can use git rebase origin/master to move your local changes on top of origin/master, on your local repository. 然后,您可以使用git rebase origin/master将本地更改移至本地存储库中的origin / master之上。

Now using git push you will push your branch feature A on the remote repository. 现在,使用git push可以将分支feature Agit push远程存储库中。
If you prefer to push on master, you will have to use the following syntax : git push origin master 如果您希望使用master推送,则必须使用以下语法: git push origin master

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

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