LetsLet's try to take an example and understand:
I have a branch, say master, pointing to X and<commit-id>, and I have a new branch pointing to Y <sha1>.
Where Y = branch<commit-id> = <master> branch commits - few commits
Now say for Y branch I have to gap close-close the commits between the master branch and the new branch. Below is the procedure we can follow:
Step 1:
git checkout -b local origin/new where local is the branch name. Any name can be given.
Step 2:
git merge origin/master --no-ff --stat -v --log=300 Merge the commits from master branch to new branch and also create a merge commit of log message with one-line descriptions from at most actual<n> actual commits that are being merged.
For more information and parameters about gitGit merge, please refer to:
git merge --help Also if you need to merge a specific commit, then you can use:
git cherry-pick <commit-id>