Skip to main content
Copy edited (e.g. ref. <https://en.wiktionary.org/wiki/let%27s#Contraction>). Unhid "<commit-id>", "<sha1>", "<master>", and "<n>" by encoding "<" as "&lt;" - see the Markdown source for the previous version, <http://stackoverflow.com/revisions/cb181835-37f5-4115-975e-9da7a5f3d8e9/view-source>.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

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> 

Lets try take an example and understand:

I have a branch say master pointing to X and I have a new branch pointing to Y .

Where Y = branch commits - few commits

Now say for Y branch I have to gap close the commits between master branch and new branch. Below is the procedure we can follow:

Step 1:

git checkout -b local origin/new 

where local is 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 commits that are being merged.

For more information and parameters about git merge, please refer

git merge --help 

Also if you need to merge a specific commit, then you can use:

git cherry-pick <commit-id> 

Let's try to take an example and understand:

I have a branch, say master, pointing to X <commit-id>, and I have a new branch pointing to Y <sha1>.

Where Y <commit-id> = <master> branch commits - few commits

Now say for Y branch I have to gap-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 <n> actual commits that are being merged.

For more information and parameters about Git 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> 
added 93 characters in body
Source Link
Spyder
  • 984
  • 2
  • 14
  • 20

Lets try take an example and understand:

I have a branch say master pointing to X and I have a new branch pointing to Y .

Where Y = branch commits - few commits

Now say for Y branch I have to gap close the commits between master branch and new branch. Below is the procedure we can follow:

Step 1:

git checkout -b local origin/new 

where local is 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 commits that are being merged.

For more information and parameters about git merge, please refer

git merge --help 

Also if you need to merge a specific commit, then you can use:

git cherry-pick <commit-id> 

Lets try take an example and understand:

I have a branch say master pointing to X and I have a new branch pointing to Y .

Where Y = branch commits - few commits

Now say for Y branch I have to gap close the commits between master branch and new branch. Below is the procedure we can follow:

Step 1:

git checkout -b local origin/new 

where local is 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 commits that are being merged.

For more information and parameters about git merge, please refer

git merge --help 

Lets try take an example and understand:

I have a branch say master pointing to X and I have a new branch pointing to Y .

Where Y = branch commits - few commits

Now say for Y branch I have to gap close the commits between master branch and new branch. Below is the procedure we can follow:

Step 1:

git checkout -b local origin/new 

where local is 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 commits that are being merged.

For more information and parameters about git merge, please refer

git merge --help 

Also if you need to merge a specific commit, then you can use:

git cherry-pick <commit-id> 
Source Link
Spyder
  • 984
  • 2
  • 14
  • 20

Lets try take an example and understand:

I have a branch say master pointing to X and I have a new branch pointing to Y .

Where Y = branch commits - few commits

Now say for Y branch I have to gap close the commits between master branch and new branch. Below is the procedure we can follow:

Step 1:

git checkout -b local origin/new 

where local is 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 commits that are being merged.

For more information and parameters about git merge, please refer

git merge --help