git merge all previous commits on a branch

The solution for “git merge all previous commits on a branch” can be found here. The following code will assist you in solving the problem.

git checkout yourBranch
// change master to whatever the base branch is.
git reset $(git merge-base master $(git branch –show-current))
git add -A
git commit -m “one commit on yourBranch”

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

inline scripts encapsulated in