How to merge with squash in Git

0 votes

Hi Guys,

I have two branches in my local Git repo. Now I want to merge these two branches. But I don't want to merge the logs as well.

I searched in google and find that git squash can be used. But I don't know how to use. Can anyone help me?

May 13, 2020 in Git & GitHub by akhtar
• 38,170 points
131 views

1 answer to this question.

0 votes

Hi@akhtar,

If you want to merge your data between branches, you can use git merge. But git merge will also copy the logs from another merge. But if you want only data you can use squash. Use the below given command

$ git merge --squash branch_name

Hope this will help.

answered May 13, 2020 by MD
• 95,180 points

Related Questions In Git & GitHub

0 votes
1 answer

How to do a re-merge into another branch in git

Seems like you want to rebase your ...READ MORE

answered May 7, 2018 in Git & GitHub by DareDev
• 6,890 points
905 views
0 votes
1 answer

How to give a file execute mode permissions in Git?

You can easily do this in one ...READ MORE

answered Aug 6, 2018 in Git & GitHub by Sophie may
• 10,550 points
8,136 views
0 votes
1 answer

How to add a remote git repository in Jenkins

Follow these steps: Step 1 Go to Manage ...READ MORE

answered May 23, 2019 in Git & GitHub by Alok
1,870 views
0 votes
1 answer

How merge works in Git & GitHub!!!??

Hi@Hasid, In Git & GitHub merge concept comes ...READ MORE

answered Jan 31, 2020 in Git & GitHub by MD
• 95,180 points
111 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,066 views
+2 votes
1 answer
+1 vote
1 answer

How to resolve merge conflicts in Git repository?

Hi@akhtar, You can try with git mergetool. It ...READ MORE

answered Nov 21, 2020 in Git & GitHub by MD
• 95,180 points
103 views
+1 vote
1 answer

How to abort the merge conflict in Git?

Hi@akhtar, You can use the git reset --merge ...READ MORE

answered Dec 23, 2020 in Git & GitHub by MD
• 95,180 points
435 views