git version可以卸载吗_有用的Git命令

f34d2923b1888e6b3d8a9d53fa0b9690.png

Git是一种目前使用最广泛且功能最强大的版本控制系统,它用于跟踪计算机文件的更改并协调多人之间的文件工作。

它的主要领域用于软件开发中的源代码管理,其实它可用于跟踪任何文件集中的更改。

Git由Linus Torvalds于2005年开发,作为分布式开源软件版本控制软件,当然可以免费使用。它旨在提高速度,数据完整性以及对分布式非线性工作流程的支持。

其他版本控制系统(例如CVS,SVN)将大部分数据(如提交日志)保存在中央服务器上,在Git中,每台计算机上的每个Git存储库都是一个完整的库,具有完整的历史记录和完整的版本跟踪功能,独立于网络访问或中央服务器。

目前几乎所有的IDE都支持Git开箱即用,并不需要我们手动提交Git命令,但了解这些命令总是好的。

下面为各位总结一些使用Git高效工作的指令列表。

Git Help

Git中最有用的命令是git help,它为我们提供所需的全部帮助。我们在终端输入git help终,将获得如下信息:

usage: git [--version] [--help] [-C ] [-c =]           [--exec-path[=]] [--html-path] [--man-path] [--info-path]           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]           [--git-dir=] [--work-tree=] [--namespace=]            []These are common Git commands used in various situations:start a working area (see also: git help tutorial)   clone      Clone a repository into a new directory   init       Create an empty Git repository or reinitialize an existing onework on the current change (see also: git help everyday)   add        Add file contents to the index   mv         Move or rename a file, a directory, or a symlink   reset      Reset current HEAD to the specified state   rm         Remove files from the working tree and from the indexexamine the history and state (see also: git help revisions)   bisect     Use binary search to find the commit that introduced a bug   grep       Print lines matching a pattern   log        Show commit logs   show       Show various types of objects   status     Show the working tree statusgrow, mark and tweak your common history   branch     List, create, or delete branches   checkout   Switch branches or restore working tree files   commit     Record changes to the repository   diff       Show changes between commits, commit and working tree, etc   merge      Join two or more development histories together   rebase     Reapply commits on top of another base tip   tag        Create, list, delete or verify a tag object signed with GPGcollaborate (see also: git help workflows)   fetch      Download objects and refs from another repository   pull       Fetch from and integrate with another repository or a local branch   push       Update remote refs along with associated objects'git help -a' and 'git help -g' list available subcommands and someconcept guides. See 'git help ' or 'git help 'to read about a specific subcommand or concept.

命令git help -a将为我们提供完整的Git命令列表:

usage: git [--version] [--help] [-C ] [-c =]           [--exec-path[=]] [--html-path] [--man-path] [--info-path]           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]           [--git-dir=] [--work-tree=] [--namespace=]            []available git commands in '/usr/local/git/libexec/git-core'  add                       merge-octopus  add--interactive          merge-one-file  am                        merge-ours  annotate                  merge-recursive  apply                     merge-resolve  archimport                merge-subtree  archive                   merge-tree  bisect                    mergetool  bisect--helper            mktag  blame                     mktree  branch                    mv  bundle                    name-rev  cat-file                  notes  check-attr                p4  check-ignore              pack-objects  check-mailmap             pack-redundant  check-ref-format          pack-refs  checkout                  patch-id  checkout-index            prune  cherry                    prune-packed  cherry-pick               pull  citool                    push  clean                     quiltimport  clone                     read-tree  column                    rebase  commit                    rebase--helper  commit-graph              receive-pack  commit-tree               reflog  config                    remote  count-objects             remote-ext  credential                remote-fd  credential-cache          remote-ftp  credential-cache--daemon  remote-ftps  credential-store          remote-http  cvsexportcommit           remote-https  cvsimport                 remote-testsvn  cvsserver                 repack  daemon                    replace  describe                  request-pull  diff                      rerere  diff-files                reset  diff-index                rev-list  diff-tree                 rev-parse  difftool                  revert  difftool--helper          rm  fast-export               send-email  fast-import               send-pack  fetch                     serve  fetch-pack                sh-i18n--envsubst  filter-branch             shell  fmt-merge-msg             shortlog  for-each-ref              show  format-patch              show-branch  fsck                      show-index  fsck-objects              show-ref  gc                        stage  get-tar-commit-id         stash  grep                      status  gui                       stripspace  gui--askpass              submodule  hash-object               submodule--helper  help                      subtree  http-backend              svn  http-fetch                symbolic-ref  http-push                 tag  imap-send                 unpack-file  index-pack                unpack-objects  init                      update-index  init-db                   update-ref  instaweb                  update-server-info  interpret-trailers        upload-archive  log                       upload-pack  ls-files                  var  ls-remote                 verify-commit  ls-tree                   verify-pack  mailinfo                  verify-tag  mailsplit                 web--browse  merge                     whatchanged  merge-base                worktree  merge-file                write-tree  merge-indexgit commands available from elsewhere on your $PATH  credential-osxkeychain'git help -a' and 'git help -g' list available subcommands and someconcept guides. See 'git help ' or 'git help 'to read about a specific subcommand or concept.

命令git help -g将给我们一个git概念,Git会给我们一个有价值的列表:

The common Git guides are:   attributes          Defining attributes per path   cli                 Git command-line interface and conventions   core-tutorial       A Git core tutorial for developers   cvs-migration       Git for CVS users   diffcore            Tweaking diff output   everyday            A useful minimum set of commands for Everyday Git   glossary            A Git Glossary   hooks               Hooks used by Git   ignore              Specifies intentionally untracked files to ignore   modules             Defining submodule properties   namespaces          Git namespaces   repository-layout   Git Repository Layout   revisions           Specifying revisions and ranges for Git   tutorial            A tutorial introduction to Git   tutorial-2          A tutorial introduction to Git: part two   workflows           An overview of recommended workflows with Git'git help -a' and 'git help -g' list available subcommands and someconcept guides. See 'git help ' or 'git help 'to read about a specific subcommand or concept.

我们可以使用git help 或git help 命令更多地了解特定命令或概念。

Git Config

bcea8be66d259e15e85be6f0237d090f.png

Git Commit和Git Push

9275fa07edf96866fdb55ad8fde8e2ad.png

Git fetch和pull

15c80497f784d919f2892ad3db9ead7b.png

Git Branch

7b17f58d81eee85c1d1f0b5212e1a0d6.png

Git Clean

456bc48c8b761ba61557450e32b11571.png

其他Git命令

adb5c24241e859d96078268541e8171c.png

我将这些命令作为备注供自己将来参考,您可以在此Github存储库中找到更多信息,欢迎在文底提供宝贵的反馈!

作者:洛逸

7e14ffd092acaa082d2fa846ab9ea4d0.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值