Skip to content

Instantly share code, notes, and snippets.

@daredrum
Last active August 2, 2016 18:25
Show Gist options
  • Select an option

  • Save daredrum/7b3a0dbaea35463bb2227ac88fd78e30 to your computer and use it in GitHub Desktop.

Select an option

Save daredrum/7b3a0dbaea35463bb2227ac88fd78e30 to your computer and use it in GitHub Desktop.
Git methods
### Override local branch from remote
git fetch origin feature_branch
git reset --hard origin/feature_branch
### Remove branch remotely and locally
git push origin feature_branch
git branch -D feature_branch
### Edit old commits
git rebase --i 'bbc643cd^'
# change 'pick' on 'edit' and after edit code #
git commit --all --amend --no-edit
git rebase --continue
git push -f origin branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment