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:

  • Best branching strategy when doing continuous integration?
  • Commit to develop branch directly in Git Flow?
  • How to cancel commits on master and move them to branch
  • How can I retrieve the local changed files which I wrongly reset in git
  • How to put repository onto another repository as branch so they have some shared commits?
  • Accidently Pulled Down Branch with the Same Name
  • Your branch is ahead of ‘origin/master’ by 201 commits.

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

  • The output of git clone
  • How do I resolve conflicts with Git?
  • Jenkins git plugin: Peer's Certificate issuer is not recognized
  • git external for pull requests
  • Enforce core.autocrlf=input through .gitattributes
  • How to retrieve Git commit id and message in VSTS/TFS build?
  • 2 Solutions collect form web for “git: merging two branches and commits ahead”

    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

    Git Baby is a git and github fan, let's start git clone.