Merge, update, and pull Git branches without using checkouts
The Short Answer As long as you’re doing a fast-forward merge, then you can simply use git fetch <remote> <sourceBranch>:<destinationBranch> Examples: # Merge local branch foo into local branch master, # without having to checkout master first. # Here `.` means to use the local repository as the “remote”: git fetch . foo:master # Merge … Read more