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,260 points
763 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,460 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
2,456 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 7, 2018 in Git & GitHub by Sophie may
• 10,620 points
21,048 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
13,652 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,460 points
817 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,034 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 22, 2020 in Git & GitHub by MD
• 95,460 points
798 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,460 points
27,964 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP