Skip to content

Instantly share code, notes, and snippets.

@zeel-dev
Forked from jfountain/Git Notes
Last active December 15, 2015 13:29
Show Gist options
  • Select an option

  • Save zeel-dev/5267672 to your computer and use it in GitHub Desktop.

Select an option

Save zeel-dev/5267672 to your computer and use it in GitHub Desktop.
#add existing to git
git init
git add .
git remote add origin git@github.com:USERNAME/REPONAME.git
git push -u origin master
#remove svn
find . -name '.svn' -type d -print0 | xargs -0 rm -rf
git commit -a -m 'removing svn files'
#show user data
git config -l
#tag a release
git tag -a v1.0 -m 'version 1.0'
git push origin --tags
#pull to a repo not in current directory
git --git-dir=/path/to/repo/.git pull
#like svn revert
git reset --hard ;git pull
#like svn revert but restores current changes
git stash;git pull;git stash pop
#commit/push with add
git commit -a -m 'message';git push
Test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment