Skip to content

Instantly share code, notes, and snippets.

@valentincognito
Last active November 2, 2017 01:52
Show Gist options
  • Save valentincognito/6418c14b858080b71fce25c875ea84fd to your computer and use it in GitHub Desktop.
Save valentincognito/6418c14b858080b71fce25c875ea84fd to your computer and use it in GitHub Desktop.
List of useful commands for the git command line interface

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

Pull and ignore local changes

$ git reset --hard
$ git pull

Updating a feature branch

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

Fix filename too long error on windows

$ git config --system core.longpaths true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment