I have a project on a Git Repo. Our little team use our personal remote repo to work, and now that we have to merge our work in the main remote repo we want to do it in one shot, without showing the passages we got. In syntax, all the little changes that we did until now we want to load them like a big commit without showing the history.
Asked
Active
Viewed 99 times
1
-
You might be looking for [git merge --squash](https://stackoverflow.com/questions/5308816/how-to-use-git-merge-squash). – Horia Coman Nov 09 '17 at 13:02
-
you need to do `squash and merge` – Shubham Khatri Nov 09 '17 at 13:02
1 Answers
2
What you want is to Squash and Merge your branch, you can do it in the following manner
git checkout branch-to-merge-into
git merge --squash bugfix
git commit
When you select the Squash and merge
option on a pull request
on GitHub
, the pull request's commits are squashed into a single commit. Instead of seeing all of a contributor's individual commits from a topic branch, the commits are combined into one commit and merged into the default branch. Pull requests with squashed commits are merged using the fast-forward option.

Shubham Khatri
- 270,417
- 55
- 406
- 400