Answers for "how to compress all branches on branch into one branch back to the master"

0

how to compress all branches on branch into one branch back to the master

git checkout yourBranch
 git reset $(git merge-base master yourBranch)
 git add -A
 git commit -m "one commit on yourBranch"
This isn't perfect as it implies you know from which branch "yourBranch" is coming from.
Note: finding that origin branch isn't easy/possible with Git (the visual way is often the easiest, as seen here).

EDIT: you will need to use git push --force
Posted by: Guest on February-18-2021

Code answers related to "how to compress all branches on branch into one branch back to the master"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language