@terrygmk
2020-02-14T16:31:43.000000Z
字数 1548
阅读 194
学习笔记
$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"
$git config --global alias.st status
$git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
$git init
$git reset --hard HEAD^
$git reset --hard <commit_id>
$ git log
$git reflog
$git add
$git commit -m <message>
$git diff [file]
$ git diff HEAD [file]
$git rm <file>
$git commit -m <message>
$git restore <file>
$git restore <file>
$git restore --staged <file>
$git branch
$git branch <branch_name>
$git branch -d <branch_name>
$git switch <branch_name>
$git merge <branch_name>
$ssh-keygen -t rsa -C "youremail@example.com"
还有其它一些步骤
$ git remote add origin git@github.com:michaelliao/learngit.git
$ git push -u origin master
$ git push origin master
$ git push
$ git clone git@github.com:michaelliao/gitskills.git
$ git tag
$ git tag <tag_name>
$ git tag <tag_name> <commit_id>
$ git tag -d <tag_name>
$ git show <tag_name>
$git push origin :refs/tags/<tag_name>
$ git push origin <tag_name>
$ git push origin --tags