rebase - Squash mes derniers X s'engage ensemble en utilisant Git

Mots clés : gitrebasesquashgit-squashgit

meilleur 3 Réponses rebase - Squash mes derniers X s'engage ensemble en utilisant Git

vote vote

98

git reset --soft HEAD~3 && git commit 
git reset --soft HEAD~3 &&  git commit --edit -m"$(git log --format=%B --reverse HEAD..HEAD@{1})" 
vote vote

89

# Reset the current branch to the commit just before the last 12: git reset --hard HEAD~12  # HEAD@{1} is where the branch was just before the previous command. # This command sets the state of the index to be as it would just # after a merge from that commit: git merge --squash HEAD@{1}  # Commit those squashed changes.  The commit message will be helpfully # prepopulated with the commit messages of all the squashed commits: git commit 
vote vote

80

git rebase -i HEAD~3 

Questions similaires