简体   繁体   中英

git: merging two branches and commits ahead

I have two branches:master and v2. I want to merge v2 in master so master will be exactly the same as v2. I did this:

$> git checkout master
$> git merge -Xtheirs v2

now "git status" returns:

Your branch is ahead of 'origin/master' by 201 commits.

How can I "align" my remote repos with the stuff I have locally?

You need to push it to remote repo.

git push origin master will do it.

You have it backwards you should be merging v2 into master. This will bring master up to date, and will allow you to keep working in v2 afterwards.

Once you have your master up to date, you push it to the remote server with.

git push

That will push your synced branches from your local machine to your remote branch

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