valentincognito
9/15/2017 - 10:30 AM

Git Cheat Sheet

List of useful commands for the git command line interface

Fix filename too long error on windows

$ git config --system core.longpaths true

Pull and ignore local changes

$ git reset --hard
$ git pull

Delete the most recent commit

Keeping the work you've done

$ git reset --soft HEAD~1

Destroying the work you've done

$ git reset --hard HEAD~1

Updating a feature branch

$ git checkout master
$ git pull
$ git merge origin/master
$ git checkout <feature-branch>
$ git merge master
$ git push