git merge sanity check

Developer A is working on branch 2012A

I branch 2012A, and create branch 2012B

  • Merge problem from forked git
  • How to setup a cloned Rails project on local machine?
  • How do I display the git sha in my ionic app
  • Fork Management of Git Multi-level Hierarchies
  • git operations occasionally hang in Jenkins on Windows
  • Using repo with goldfish Android kernel
  • I want all the new changes from 2012A, so I simply want to merge them into 2012B and carry on working.

    Does this look ok as a workflow?

    git checkout 2012A (switch to 2012A)
    git pull origin 2012A (update 2012A)
    git checkout 2012B (switch to 2012B)
    git merge 2012A (merge in 2012A)
    git commit -m 'commiting changes from 2012A' (commit changes from 2012A in 2012B)

    Thanks in advance,

  • Continuous integration with python 2.7 / flask / mongoDB / git
  • salt git.latest not connecting to github repo
  • Create a new file in git bash
  • How far do you take version control?
  • Removing unwanted folders from git repo permanently - Repo size not changing
  • Changing value of GIT_SSH for tortoiseGit
  • One Solution collect form web for “git merge sanity check”

    It should work, however you could do it in a simpler way:

    directly from branch 2012B:

    git fetch origin
    git merge origin/2012A

    Note that you are not required to have a local branch for 2012A: if have a repository in your remotes (here your remote is origin) you usually carry the snapshots of the remote branches. You can see them by running:

    git branch -a

    (See the remotes/... entries of the output)

    The git fetch command updates the snapshots, so git fetch origin updates your local images of the remote branches in origin, and git merge origin/2012A merges such image into the current branch (i.e. applies the patches of origin/2012A on 2012B).

    Suggested article:

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