I have around 105 commits on my master branch and 538 commits on my front-end branch and I feel like it happened because I forced pushed when git was throwing errors every time I push. is there any way we could potentially combine all the commits and show the sum of commits numbers on my master branch. for ie. I have 105 commits on the master branch and 539 commits on my frontend branch.I want my master branch to show that 644 commits has been made!"
Asked
Active
Viewed 48 times
0
-
2Does this answer your question? [What is the best (and safest) way to merge a Git branch into master?](https://stackoverflow.com/questions/5601931/what-is-the-best-and-safest-way-to-merge-a-git-branch-into-master) – ndogac Jul 30 '21 at 17:53
1 Answers
0
Edited: The image is to visualize the commits. Assume that master has 3 commits (A, B, C) and front-end 2 commits (D, E + A because front-end was created by master)
1- Current state
2- Rebase your front-end branch to be updated with master:
git checkout front-end
git rebase master //Pray for no conflicts!!!
// If there are conflicts resolve it one by one.
3- Then merge (with fast-forward) to master:
git checkout master
git merge front-end
Ready, your master branch will be lineal with his own changes first, and after the changes form front-end.

Jonad García San Martín
- 406
- 2
- 10
-
What happens to the existing commits that were made in my front-end branch? – Hari Bhandari Jul 30 '21 at 20:31
-
If you don't delete front-end branch nothing, the branch persists with all the commits until you delete it or add new commits. Also those commits exists in master branch. – Jonad García San Martín Jul 30 '21 at 20:41
-
I edit the answer to help you visualize the state of the commits before and after the process. – Jonad García San Martín Jul 30 '21 at 21:23