简体   繁体   中英

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. 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.

First you have to use git fetch to load data from your remote repository.
Then you can use git rebase origin/master to move your local changes on top of origin/master, on your local repository.

Now using git push you will push your branch feature A on the remote repository.
If you prefer to push on master, you will have to use the following syntax : git push origin master

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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