Skip to content

Instantly share code, notes, and snippets.

@codingPingjun
Last active October 26, 2016 02:07
Show Gist options
  • Save codingPingjun/d533d51c656cf1536f6ec1c52c04056e to your computer and use it in GitHub Desktop.
Save codingPingjun/d533d51c656cf1536f6ec1c52c04056e to your computer and use it in GitHub Desktop.
Git and GitHub Usage

1. setup the user.name and user.email

git config user.name USERNAME

git config user.email USERNAME@example.com

git config --list # list all configurations

~/.gitconfig # path of git config file

2. Set remote url (multiple account)

git remote set-url origin https://USERNAME@github.com/USERNAME/PROJECTNAME.git

3. Tag Setting

git tag # list all tags

git show v1.4 # show tag information

git tag -a v1.4 -m "my version 1.4" # add new tag

git push origin v1.4 # push tag into repo

git checkout -b version2 v2.0.0 # create branch from tag position

4. Git Alias

git config --global alias.co checkout

git config --global alias.ci commit

git config --global alias.st status

git config --global alias.br branch

git config --global alias.cm "commit -m"

5. Password saving

git config --global credential.helper cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment