Skip to content

Instantly share code, notes, and snippets.

@VictorTpo
Last active December 28, 2015 21:29
Show Gist options
  • Save VictorTpo/7564531 to your computer and use it in GitHub Desktop.
Save VictorTpo/7564531 to your computer and use it in GitHub Desktop.
Resume of git command

BRANCH

Recover branch ``` git checkout master git pull git checkout new_branch ```

Download remote branch

git checkout -t origin/remote_branch

Change branch without commit

*my_branch > git stash //to add some change of current branch in buffer
*other_branch > [some action]
*other_branch > git checkout my_branch
*my_branch > git unstash //restore change 

Delete

#local
git branch -D <branch>
#remote
git push origin --delete <branch>

Rename

git branch -m <oldname> <newname>
git branch -m <newname> # current branch

ADD/RM-COMMIT-PUSH

Delete all files ``` git rm $(git ls-files --deleted) ```

TAG

git tag //list all tag
git show vx.x.x
git tag -a v1.4 -m 'my version 1.4'
git push origin v0.0.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment