{"id":156,"date":"2019-07-23T13:38:30","date_gmt":"2019-07-23T05:38:30","guid":{"rendered":"https:\/\/www.linuxdevops.cn\/?p=156"},"modified":"2022-02-11T17:08:49","modified_gmt":"2022-02-11T09:08:49","slug":"git-a-complete-collection-of-common-commands","status":"publish","type":"post","link":"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/","title":{"rendered":"Git \u5e38\u7528\u547d\u4ee4\u5927\u5168"},"content":{"rendered":"\n

Git \u547d\u4ee4 - \u8bbe\u7f6e\u4e0e\u914d\u7f6e
\n\u5217\u51fa\u6240\u6709\u914d\u7f6e
\n$ git config --list
\nGit config\u547d\u4ee4<\/p>\n\n\n\n

\u8bbe\u7f6e\u7528\u6237\u540d\uff0c\u90ae\u7bb1 \u4f8b\uff1a
\n$ git config --global user.name \"Wang Feng\"
\n$ git config --global user.email \"wf@shctp.com.cn\"<\/p>\n\n\n\n

\u4e2a\u4eba\u4e60\u60ef\u8bbe\u7f6e
\n\u522b\u540d
\n$ git config --global alias.co checkout
\n$ git config --global alias.br branch
\n$ git config --global alias.ci commit
\n$ git config --global alias.st status
\n$ git config --global alias.unstage 'reset HEAD --'
\n$ git config --global alias.last 'log -1 HEAD'
\n$ 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\"
\n\u9ed8\u8ba4\u7f16\u8f91\u5668
\n$ git config --global core.editor emacs
\n\u9ed8\u8ba4\u5206\u9875\u5668\uff08more\uff0c\u3010less\u3011\uff09
\n$ git config --global core.pager ''
\nwindows \u8f6c\u6362\u56de\u8f66\u6362\u884c\u7b26CR,LF ---> LF
\n$ git config --global core.autocrlf true false(\u53d6\u6d88)<\/p>\n\n\n\n

pull\u9ed8\u8ba4\u4f7f\u7528\u9009\u9879 --rebase
\n$ git config --global pull.rebase true<\/p>\n\n\n\n

\u51ed\u8bc1\u5b58\u50a8
\n$ git config --global credential.helper cache
\n$ git config --global credential.helper store --file ~\/.my-credentials<\/p>\n\n\n\n

\u914d\u7f6ecommit\u9ed8\u8ba4\u4fe1\u606f
\n$ git config --global commit.template ~\/.gitmessage.txt<\/p>\n\n\n\n

Git \u547d\u4ee4 - \u83b7\u53d6\u4e0e\u521b\u5efa\u9879\u76ee
\ngit init \u547d\u4ee4
\n\u521b\u5efa\u4e00\u4e2a\u521d\u59cb\u5316\u4ed3\u5e93
\n$ git init \u9ed8\u8ba4\u5206\u652f master
\n\u521b\u5efa\u88f8\u4ed3\u5e93\uff08\u670d\u52a1\u5668\u6ca1\u6709\u5de5\u4f5c\u76ee\u5f55\uff09
\n$ git init --bare --shared #shared \u81ea\u52a8\u4fee\u6539\u4ed3\u5e93\u76ee\u5f55\u6743\u9650\u4e3a\u53ef\u5199
\n\u521d\u59cb\u5316\u4ed3\u5e93\u76ee\u5f55
\ndescription \u6587\u4ef6\u4ec5\u4f9b GitWeb \u7a0b\u5e8f\u4f7f\u7528
\nconfig \u6587\u4ef6\u5305\u542b\u9879\u76ee\u7279\u6709\u7684\u914d\u7f6e\u9009\u9879
\ninfo \u76ee\u5f55\u5305\u542b\u4e00\u4e2a\u5168\u5c40\u6027\u6392\u9664\uff08global exclude\uff09\u6587\u4ef6
\n.gitignore \u6587\u4ef6\u4e2d\u7684\u5ffd\u7565\u6a21\u5f0f\uff08ignored patterns\uff09
\nhooks \u76ee\u5f55\u5305\u542b\u5ba2\u6237\u7aef\u6216\u670d\u52a1\u7aef\u7684\u94a9\u5b50\u811a\u672c
\nHEAD \u6587\u4ef6\u3001\uff08\u5c1a\u5f85\u521b\u5efa\u7684\uff09index \u6587\u4ef6\uff0c\u548c objects \u76ee\u5f55\u3001refs \u76ee\u5f55\u3002
\nobjects \u76ee\u5f55\u5b58\u50a8\u6240\u6709\u6570\u636e\u5185\u5bb9refs \u76ee\u5f55\u5b58\u50a8\u6307\u5411\u6570\u636e\uff08\u5206\u652f\uff09\u7684\u63d0\u4ea4\u5bf9\u8c61\u7684\u6307\u9488\uff1b
\nHEAD \u6587\u4ef6\u6307\u793a\u76ee\u524d\u88ab\u68c0\u51fa\u7684\u5206\u652f\uff1bindex \u6587\u4ef6\u4fdd\u5b58\u6682\u5b58\u533a\u4fe1\u606f<\/p>\n\n\n\n

git clone\u547d\u4ee4
\n\u514b\u9686\u73b0\u6709\u4ed3\u5e93
\n$ git clone https:\/\/github.com\/libgit2\/libgit2 mylibgit
\n\u89e3\u5305
\n$ git clone repo.bundle repo
\n\u514b\u9686\u521d\u59cb\u5316\u66f4\u65b0\u542b\u5b50\u6a21\u5757\u7684\u4ed3\u5e93
\n$ git clone --recursive https:\/\/github.com\/chaconinc\/MainProject<\/p>\n\n\n\n

Git \u547d\u4ee4 - \u5feb\u7167\u57fa\u7840
\ngit add \u547d\u4ee4
\n\u8ddf\u8e2a\u65b0\u6587\u4ef6
\n$ git add README
\n\u4ea4\u4e92\u5f0f\u6682\u5b58
\n$ git add -i
\n$ git add --interactive<\/p>\n\n\n\n

git status \u547d\u4ee4
\n\u68c0\u67e5\u5f53\u524d\u6587\u4ef6\u72b6\u6001
\n$ git status
\n\u72b6\u6001\u7b80\u89c8
\n$ git status -s
\n M README -->
\nMM Rakefile -->\u53f3M\u4fee\u6539\u672a\u6682\u5b58\u5de6M \u4fee\u6539\u5e76\u6682\u5b58
\nA lib\/git.rb -->\u65b0\u6dfb\u52a0\u5230\u6682\u5b58\u533a\u4e2d
\nM lib\/simplegit.rb -->
\n?? LICENSE.txt -->\u65b0\u6dfb\u52a0\u672a\u8ddf\u8e2a<\/p>\n\n\n\n

git diff \u547d\u4ee4
\n\u67e5\u770b\u4fee\u6539\uff08\u6bd4\u8f83\u7684\u662f\u5de5\u4f5c\u76ee\u5f55\u4e2d\u5f53\u524d\u6587\u4ef6\u548c\u6682\u5b58\u533a\u57df\u5feb\u7167\u4e4b\u95f4\u7684\u5dee\u5f02\uff0c
\n\u4e5f\u5c31\u662f\u4fee\u6539\u4e4b\u540e\u8fd8\u6ca1\u6709\u6682\u5b58\u8d77\u6765\u7684\u53d8\u5316\u5185\u5bb9\u3002\uff09
\n$ git diff
\n\u67e5\u770b\u5df2\u6682\u5b58\u5c06\u8981\u63d0\u4ea4
\n$ git diff --cached
\n$ git diff --staged
\n\u63d0\u4ea4\u51c6\u4fa7\uff08\u68c0\u67e5\u7a7a\u767d\u9519\u8bef\uff09
\n$ git diff --check
\n\u4e09\u70b9\u8bed\u6cd5\u6bd4\u8f83\u5206\u652f
\n$ git diff master\u2026contrib
\n\u663e\u793a\u5408\u5e76\u540e\u72b6\u6001
\n$ git rerere diff<\/p>\n\n\n\n

git reset \u547d\u4ee4
\n\u53d6\u6d88\u6682\u5b58\u7684\u6587\u4ef6
\n$ git reset HEAD CONTRIBUTING.md
\nhttps:\/\/git-scm.com\/book\/zh\/v2\/Git-%E5%B7%A5%E5%85%B7-%E9%87%8D%E7%BD%AE%E6%8F%AD%E5%AF%86#r_git_reset
\n\u64a4\u9500\u5408\u5e76
\n$ git reset --hard HEAD~<\/p>\n\n\n\n

git rm \u547d\u4ee4
\n\u79fb\u9664\u6587\u4ef6
\n$ git rm PROJECTS.md
\n\u4ed3\u5e93\u4e2d\u5220\u9664\u4e0d\u7ee7\u7eed\u8ddf\u8e2a\uff0c\u78c1\u76d8\u4fdd\u7559
\n$ git rm --cached README<\/p>\n\n\n\n

git mv \u547d\u4ee4
\n\u79fb\u52a8\u6587\u4ef6\u6539\u540d
\n$ git mv file_from file_to<\/p>\n\n\n\n

git clean \u547d\u4ee4
\n\u6e05\u9664\u5de5\u4f5c\u76ee\u5f55\u6f14\u620f
\n\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cgit clean \u547d\u4ee4 \u53ea\u4f1a\u79fb\u9664\u6ca1\u6709\u5ffd\u7565\u7684\u672a\u8ddf\u8e2a\u6587\u4ef6\u3002
\n$ git clean -d -n
\n\u5f3a\u5236\u6e05\u9664
\n$ git clean -f -d<\/p>\n\n\n\n

Git \u547d\u4ee4 - \u5206\u652f\u4e0e\u5408\u5e76
\ngit branch \u547d\u4ee4
\n\u521b\u5efa\u5206\u652f
\n$ git branch testing
\n\u67e5\u770b\u5206\u652f
\n$ git branch
\n\u67e5\u770b\u6bcf\u4e2a\u5206\u652f\u7684\u6700\u540e\u4e00\u6b21\u63d0\u4ea4
\n$ git branch -v
\n\u67e5\u770b\u5df2\u5408\u5e76\u5230\u5f53\u524d\u5206\u652f
\n$ git branch --merged
\n\u67e5\u770b\u672a\u5408\u5e76\u5206\u652f
\n$ git branch --no-merged
\n\u5220\u9664\u5206\u652f\uff08\u672a\u5408\u5e76\u5206\u652f\u5220\u9664\u4f1a\u5931\u6548\uff09
\n$ git branch -d testing
\n\u5f3a\u5236\u5220\u9664\u5206\u652f
\n$ git branch -D testing
\n\u5220\u9664\u8fdc\u7a0b\u5206\u652f
\n$ git push origin :testing
\n\u4fee\u6539\u8ddf\u8e2a\u5206\u652f
\n$ git branch -u origin\/serverfix
\n\u67e5\u770b\u6240\u6709\u8ddf\u8e2a\u5206\u652f
\n$ git branch -vv<\/p>\n\n\n\n

git checkout \u547d\u4ee4
\n\u5206\u652f\u5207\u6362
\n$ git checkout testing
\n\u8ddf\u8e2a\u8fdc\u7a0b\u5206\u652f
\n$ git checkout --track origin\/serverfix
\n\u8ddf\u8e2a\u8fdc\u7a0b\u5206\u652f\u5e76\u8bbe\u7f6e\u672c\u5730\u540d\u79f0
\n$ git checkout -b sf origin\/serverfix<\/p>\n\n\n\n

git merge \u547d\u4ee4
\n\u5408\u5e76\u5206\u652f
\n$ git merge
\n\u9000\u51fa\u5408\u5e76
\n$ git merge --abort
\n\u5408\u5e76\u5ffd\u7565\u7a7a\u767d
\n$ git merge -Xignore-space-change whitespace<\/p>\n\n\n\n

git mergetool \u547d\u4ee4\u5916\u90e8\u7684\u5408\u5e76\u5e2e\u52a9\u5de5\u5177\u3002<\/p>\n\n\n\n

git log \u547d\u4ee4\u53ea\u4f1a\u79fb\u9664\u6ca1\u6709\u5ffd\u7565\u7684\u672a\u8ddf\u8e2a\u6587\u4ef6\u3002
\n\u5e38\u7528
\n$ git log --pretty=oneline --graph
\n$ git log --graph --oneline --decorate --all
\nhttps:\/\/git-scm.com\/book\/zh\/v2\/Git-%E5%9F%BA%E7%A1%80-%E6%9F%A5%E7%9C%8B%E6%8F%90%E4%BA%A4%E5%8E%86%E5%8F%B2#r_viewing_history.
\n\u5206\u652f\u6240\u5728\u5bf9\u8c61
\n$ git log --oneline --decorate
\n\u5728 experiment \u5206\u652f\u4e2d\u800c\u4e0d\u5728 master \u5206\u652f\u4e2d\u7684\u63d0\u4ea4\u201d
\n$ git log master..experiment
\n$ git log refA..refB
\n$ git log ^refA refB
\n$ git log refB --not refA<\/p>\n\n\n\n

git stash \u547d\u4ee4
\n\u50a8\u85cf
\n$ git stash
\n\u67e5\u770b
\n$ git stash list
\n\u6062\u590d
\n$ git stash apply
\nhttps:\/\/git-scm.com\/book\/zh\/v2\/Git-%E5%B7%A5%E5%85%B7-%E5%82%A8%E8%97%8F%E4%B8%8E%E6%B8%85%E7%90%86#r_git_stashing<\/p>\n\n\n\n

git tag \u547d\u4ee4
\n\u6253\u6807\u7b7e
\n$ git tag -a v1.4 -m 'my version 1.4'
\n\u67e5\u770b
\n$ git show v1.4
\n\u540e\u671f\u6839\u636e\u63d0\u4ea4\u6253\u6807\u7b7e
\n$ git tag -a v1.2 9fceb02
\n\u63a8\u9001\u6807\u7b7e
\n$ git push origin v1.5
\n\u5168\u90e8\u63a8\u9001
\n$ git push origin --tags
\n\u5220\u9664\u6807\u7b7e
\n$ git tag -d v1.4
\n\u5220\u9664\u8fdc\u7a0b\u6807\u7b7e
\n$ git push origin :v1.4<\/p>\n\n\n\n

Git \u547d\u4ee4 - \u9879\u76ee\u5206\u4eab\u4e0e\u66f4\u65b0
\ngit fetch \u547d\u4ee4
\n\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u62c9\u53d6
\n$ git fetch [remote-name]<\/p>\n\n\n\n

git pull \u547d\u4ee4
\ngit pull \u547d\u4ee4\u57fa\u672c\u4e0a\u5c31\u662f git fetch \u548c git merge \u547d\u4ee4\u7684\u7ec4\u5408\u4f53
\n$ git pull --rebase \u53d8\u57fa\u5408\u5e76<\/p>\n\n\n\n

git push \u547d\u4ee4
\n\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93
\n$ git push [remote-name] [branch-name]
\n\u5220\u9664\u8fdc\u7a0b\u5206\u652f
\n$ git push origin --delete serverfix
\n\u53d8\u57fa\u540e\u5f3a\u5236\u63a8\u9001\uff08\u672c\u5730\u76f4\u63a5\u8986\u76d6\u8fdc\u7a0b\uff09
\ngit push --force origin master
\n\u5f3a\u5236\u63a8\u9001\uff0c\u5982\u679c\u6709\u522b\u4eba\u7684\u63d0\u4ea4\u4f1a\u6709\u8b66\u544a
\ngit push --force-with-lease origin master <\/p>\n\n\n\n

git remote \u547d\u4ee4
\n\u67e5\u770b\u8fdc\u7a0b\u4ed3\u5e93
\n$ git remote -v
\n$ git remote show origin
\n\u6dfb\u52a0\u8fdc\u7a0b\u4ed3\u5e93
\n$ git remote add pb https:\/\/github.com\/paulboone\/ticgit
\n\u8fdc\u7a0b\u4ed3\u5e93\u91cd\u547d\u540d
\n$ git remote rename pb paul
\n\u79fb\u9664\u8fdc\u7a0b\u4ed3\u5e93
\n$ git remote rm paul<\/p>\n\n\n\n

git archive \u547d\u4ee4
\n\u521b\u5efa\u5feb\u7167\u5f52\u6863\u6587\u4ef6
\n$ git archive master --prefix='project\/' | gzip > git describe master<\/code>.tar.gz<\/p>\n\n\n\n

git submodule \u547d\u4ee4
\n\u6dfb\u52a0\u5b50\u6a21\u5757
\n$ git submodule add https:\/\/github.com\/chaconinc\/DbConnector<\/p>\n\n\n\n

Git \u547d\u4ee4 - \u68c0\u67e5\u4e0e\u6bd4\u8f83
\ngit show \u547d\u4ee4
\n\u67e5\u770b\u6807\u7b7e\u4fe1\u606f
\n$ git show v1.4
\n\u67e5\u770b\u4e00\u6b21\u63d0\u4ea4
\n$ git show 1c002d
\n$ git show test<\/p>\n\n\n\n

git shortlog \u547d\u4ee4
\n\u5236\u4f5c\u63d0\u4ea4\u7b80\u62a5
\n$ git shortlog --no-merges master --not v1.0.1<\/p>\n\n\n\n

git describe \u547d\u4ee4
\n\u751f\u6210\u4e00\u4e2a\u6784\u5efa\u53f7
\n$ git describe master<\/p>\n\n\n\n

Git \u547d\u4ee4 - \u8c03\u8bd5
\ngit bisect \u547d\u4ee4
\nhttps:\/\/git-scm.com\/book\/zh\/v2\/Git-%E5%B7%A5%E5%85%B7-%E4%BD%BF%E7%94%A8-Git-%E8%B0%83%E8%AF%95#r_binary_search
\ngit blame \u547d\u4ee4 \uff08\u6587\u4ef6\u6807\u6ce8\uff09
\n-L \u9009\u9879\u6765\u9650\u5236\u8f93\u51fa\u8303\u56f4\u5728\u7b2c12\u81f322\u884c\uff1a
\n$ git blame -L 12,22 simplegit.rb<\/p>\n\n\n\n

git grep \u547d\u4ee4
\nhttps:\/\/git-scm.com\/book\/zh\/v2\/Git-%E5%B7%A5%E5%85%B7-%E6%90%9C%E7%B4%A2#r_git_grep<\/p>\n\n\n\n

Git \u547d\u4ee4 - \u8865\u4e01
\ngit cherry-pick \u547d\u4ee4
\n\u53d8\u57fa\u4e0e\u62e3\u9009\u5de5\u4f5c\u6d41
\n$ git cherry-pick e43a6fd3<\/p>\n\n\n\n

git rebase \u547d\u4ee4
\n\u53d8\u57fa
\n$ git rebase master
\n\u622a\u53d6\u7279\u6027\u5206\u652f\u4e0a\u7684\u53e6\u4e00\u4e2a\u7279\u6027\u5206\u652f\uff0c\u7136\u540e\u53d8\u57fa\u5230\u5176\u4ed6\u5206\u652f
\n$ git rebase --onto master server client
\n\u4ee5\u4e0a\u547d\u4ee4\u7684\u610f\u601d\u662f\uff1a\u201c\u53d6\u51fa client \u5206\u652f\uff0c\u627e\u51fa\u5904\u4e8e client \u5206\u652f\u548c server \u5206\u652f\u7684\u5171\u540c\u7956\u5148\u4e4b\u540e\u7684\u4fee\u6539\uff0c
\n\u7136\u540e\u628a\u5b83\u4eec\u5728 master \u5206\u652f\u4e0a\u91cd\u653e\u4e00\u904d\u201d
\n\u53d8\u57fa
\n$ git rebase --onto 622e88 9c68fdc<\/p>\n\n\n\n

git revert \u547d\u4ee4
\n\u8fd8\u539f\u63d0\u4ea4
\n$ git revert -m 1 HEAD<\/p>\n\n\n\n

Git\u90ae\u4ef6\uff08\u4e0d\u5e38\u7528\uff09
\n$ git apply \u5e94\u7528\u8865\u4e01
\n$ git am \u5e94\u7528\u8865\u4e01
\n$ git format-patch \u751f\u6210\u8865\u4e01
\n$ git imap-send \u4e0a\u4f20\u53d1\u9001\u8865\u4e01
\n$ git send-email \u90ae\u4ef6\u53d1\u9001\u8865\u4e01
\n$ git request-pull \u751f\u6210\u63a8\u9001\u6d88\u606f
\nhttps:\/\/git-scm.com\/book\/zh\/v2\/%E9%99%84%E5%BD%95-C%3A-Git-%E5%91%BD%E4%BB%A4-%E9%82%AE%E4%BB%B6<\/p>\n\n\n\n

Git \u547d\u4ee4 - \u5916\u90e8\u7cfb\u7edf
\ngit svn \u547d\u4ee4
\n\u514b\u9686subvers \u4ed3\u5e93
\n$ git svn clone file:\/\/\/tmp\/test-svn -T trunk -b branches -t tags
\n$ git svn clone file:\/\/\/tmp\/test-svn -s
\n\u63d0\u4ea4\u5230subversion \u670d\u52a1\u5668
\n$ git svn dcommit
\nhttps:\/\/git-scm.com\/book\/zh\/v2\/Git-%E4%B8%8E%E5%85%B6%E4%BB%96%E7%B3%BB%E7%BB%9F-%E4%BD%9C%E4%B8%BA%E5%AE%A2%E6%88%B7%E7%AB%AF%E7%9A%84-Git#r_git_svn<\/p>\n\n\n\n

git fast-import \u547d\u4ee4
\n\u4ece\u5176\u4ed6\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u5bfc\u5165<\/p>\n\n\n\n

Git \u547d\u4ee4 - \u7ba1\u7406
\nhttps:\/\/git-scm.com\/book\/zh\/v2\/%E9%99%84%E5%BD%95-C%3A-Git-%E5%91%BD%E4%BB%A4-%E7%AE%A1%E7%90%86<\/p>\n\n\n\n

Git \u547d\u4ee4 - \u5e95\u5c42\u547d\u4ee4
\nhttps:\/\/git-scm.com\/book\/zh\/v2\/%E9%99%84%E5%BD%95-C%3A-Git-%E5%91%BD%E4%BB%A4-%E5%BA%95%E5%B1%82%E5%91%BD%E4%BB%A4<\/p>\n","protected":false},"excerpt":{"rendered":"

Git \u547d\u4ee4 – \u8bbe\u7f6e\u4e0e\u914d\u7f6e \u5217\u51fa\u6240\u6709\u914d\u7f6e $ git config –list Git config\u547d\u4ee4 <\/p>\n","protected":false},"author":1,"featured_media":277,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,18],"tags":[],"yoast_head":"\nGit \u5e38\u7528\u547d\u4ee4\u5927\u5168<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git \u5e38\u7528\u547d\u4ee4\u5927\u5168\" \/>\n<meta property=\"og:description\" content=\"Git \u547d\u4ee4 - \u8bbe\u7f6e\u4e0e\u914d\u7f6e \u5217\u51fa\u6240\u6709\u914d\u7f6e $ git config --list Git config\u547d\u4ee4\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-23T05:38:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-11T09:08:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/git-cheat-sheet.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"948\" \/>\n\t<meta property=\"og:image:height\" content=\"640\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u7ba1\u7406\u5458\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/\"},\"author\":{\"name\":\"\u7ba1\u7406\u5458\",\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\"},\"headline\":\"Git \u5e38\u7528\u547d\u4ee4\u5927\u5168\",\"datePublished\":\"2019-07-23T05:38:30+00:00\",\"dateModified\":\"2022-02-11T09:08:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/\"},\"wordCount\":910,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\"},\"articleSection\":[\"Linux\",\"Linux\u670d\u52a1\"],\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/\",\"url\":\"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/\",\"name\":\"Git \u5e38\u7528\u547d\u4ee4\u5927\u5168\",\"isPartOf\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#website\"},\"datePublished\":\"2019-07-23T05:38:30+00:00\",\"dateModified\":\"2022-02-11T09:08:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/#breadcrumb\"},\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.linuxdevops.cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux\",\"item\":\"https:\/\/www.linuxdevops.cn\/linux\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Git \u5e38\u7528\u547d\u4ee4\u5927\u5168\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.linuxdevops.cn\/#website\",\"url\":\"https:\/\/www.linuxdevops.cn\/\",\"name\":\"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\",\"description\":\"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\u7b14\u8bb0\",\"publisher\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\"},\"alternateName\":\"linuxdevops\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.linuxdevops.cn\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-CN\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\",\"name\":\"\u7ba1\u7406\u5458\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-CN\",\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg\",\"contentUrl\":\"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg\",\"width\":512,\"height\":512,\"caption\":\"\u7ba1\u7406\u5458\"},\"logo\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/\"},\"description\":\"\u7ba1\u7406\u5458\",\"url\":\"https:\/\/www.linuxdevops.cn\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Git \u5e38\u7528\u547d\u4ee4\u5927\u5168","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/","og_locale":"zh_CN","og_type":"article","og_title":"Git \u5e38\u7528\u547d\u4ee4\u5927\u5168","og_description":"Git \u547d\u4ee4 - \u8bbe\u7f6e\u4e0e\u914d\u7f6e \u5217\u51fa\u6240\u6709\u914d\u7f6e $ git config --list Git config\u547d\u4ee4","og_url":"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/","og_site_name":"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","article_published_time":"2019-07-23T05:38:30+00:00","article_modified_time":"2022-02-11T09:08:49+00:00","og_image":[{"width":948,"height":640,"url":"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/git-cheat-sheet.jpg","type":"image\/jpeg"}],"author":"\u7ba1\u7406\u5458","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/#article","isPartOf":{"@id":"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/"},"author":{"name":"\u7ba1\u7406\u5458","@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1"},"headline":"Git \u5e38\u7528\u547d\u4ee4\u5927\u5168","datePublished":"2019-07-23T05:38:30+00:00","dateModified":"2022-02-11T09:08:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/"},"wordCount":910,"commentCount":0,"publisher":{"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1"},"articleSection":["Linux","Linux\u670d\u52a1"],"inLanguage":"zh-CN","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/","url":"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/","name":"Git \u5e38\u7528\u547d\u4ee4\u5927\u5168","isPartOf":{"@id":"https:\/\/www.linuxdevops.cn\/#website"},"datePublished":"2019-07-23T05:38:30+00:00","dateModified":"2022-02-11T09:08:49+00:00","breadcrumb":{"@id":"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/#breadcrumb"},"inLanguage":"zh-CN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.linuxdevops.cn\/2019\/07\/git-a-complete-collection-of-common-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.linuxdevops.cn\/"},{"@type":"ListItem","position":2,"name":"Linux","item":"https:\/\/www.linuxdevops.cn\/linux\/"},{"@type":"ListItem","position":3,"name":"Git \u5e38\u7528\u547d\u4ee4\u5927\u5168"}]},{"@type":"WebSite","@id":"https:\/\/www.linuxdevops.cn\/#website","url":"https:\/\/www.linuxdevops.cn\/","name":"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","description":"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\u7b14\u8bb0","publisher":{"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1"},"alternateName":"linuxdevops","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.linuxdevops.cn\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-CN"},{"@type":["Person","Organization"],"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1","name":"\u7ba1\u7406\u5458","image":{"@type":"ImageObject","inLanguage":"zh-CN","@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/","url":"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg","contentUrl":"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg","width":512,"height":512,"caption":"\u7ba1\u7406\u5458"},"logo":{"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/"},"description":"\u7ba1\u7406\u5458","url":"https:\/\/www.linuxdevops.cn\/author\/root\/"}]}},"_links":{"self":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts\/156"}],"collection":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/comments?post=156"}],"version-history":[{"count":1,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts\/156\/revisions"}],"predecessor-version":[{"id":157,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts\/156\/revisions\/157"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/media\/277"}],"wp:attachment":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/media?parent=156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/categories?post=156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/tags?post=156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}