Skip to content

Git Strategies

Manuel Mejia edited this page Apr 11, 2016 · 3 revisions

Merging to the master after working in a new branch:

git rebase -i HEAD~[number of total commits in the new branch] (change to squash, all but the first commit)

git push -f

This 3 steeps are necesary if the master has changed

git checkout master
git pull
git checkout [the new branch]

git rebase master this will rebase your branch onto the top of master and then resolve conflicts manually in atom

git add --all add the resolved conflicts

git rebase --continue

git push -f push the rebase

git checkout master
git merge [the new branch]
git push

Delete a Git branch both locally and remotely

git branch -D [branch name] (local)

git branch -dr [branch name] (remote)

Clone this wiki locally