Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏

第 20 章 Git - Fast Version Control System

distributed revision control system

目录

20.1. 指定目录
20.2. Repositories 仓库管理
20.2.1. 仓库初始化
20.2.2. 克隆代码
20.2.3. 切换分支
20.2.4. 添加文件
20.2.5. 提交文件
20.2.6. 查看仓库状态
20.2.7. 比较文件
20.2.8. 推送
20.2.9. 拉去代码
20.2.10. 同步数据
20.2.11. Creating a Patch
20.2.12. 重置/回滚到指定版本
20.3. 分支管理
20.3.1. 查看本地分支
20.3.2. 创建分支
20.3.3. 删除分支
20.3.4. 切换分支
20.3.5. 重命名分支
20.3.6. git-show-branch - Show branches and their commits
20.4. 标签管理
20.4.1. 创建标签
20.4.2. 查看标签
20.4.3. 推送标签
20.4.4. 删除标签
20.5. git show - Show various types of objects
20.5.1. 查看指定版本的文件内容
20.6. git log 日志
20.6.1. hash-object
20.6.2. 查看文件历史记录
20.6.3. 目录历史记录
20.6.4. 一行显示 --oneline
20.6.5. 格式化
20.6.6. 过滤
20.6.7. all
20.6.8. full-history
20.6.9. reflog
20.7. git rev-parse - Pick out and massage parameters
20.7.1. 获得当前提交ID
20.7.2. --short
20.8. 合并分支
20.8.1. 合并分支
20.8.2. rebase
20.8.3. 合并分支解决冲突
20.8.4. 终止合并
20.8.5. 合并单个文件
20.8.6. Git 合并特定 commits 到另一个分支
20.9. 比较文件
20.9.1. 比较 SHA
20.9.2. 分支比较
20.10. 远程仓库
20.10.1. 查看远程地址
20.10.2. 显示远程地址
20.10.3. 添加远程仓库
20.10.4. 修改 origin
20.10.5. 删除 origin
20.10.6. 仓库共享
20.10.7. git-daemon 服务器
20.11. Submodule 子模块
20.11.1. 添加模块
20.11.2. checkout 子模块
20.11.3. 删除子模块
20.12. Git Large File Storage
20.12.1. 安装 LFS 支持
20.12.2. LFS lock
20.13. git config
20.13.1. git config
20.13.2. 查看配置
20.13.3. 编辑配置
20.13.4. 替换配置项
20.13.5. 配置默认分之
20.13.6. GPG签名
20.13.7. core.sshCommand
20.13.8. fatal: The remote end hung up unexpectedly
20.13.9. 忽略 SSL 检查
20.13.10. 配置忽略合并文件
20.13.11. .gitignore
20.13.12. .gitattributes
20.13.13. 配置模版目录
20.14. archive 代码打包
20.14.1. 查看支持的格式
20.14.2. 导出分支代码
20.14.3. 导出制定版本
20.14.4. 导出目录和文件
20.15. git-svn - Bidirectional operation between a single Subversion branch and git
20.16. Web Tools
20.16.1. viewgit
20.17. gitolite - SSH-based gatekeeper for git repositories
20.17.1. gitolite-admin
20.18. FAQ
20.18.1. 导出最后一次修改过的文件
20.18.2. 导出指定版本区间修改过的文件
20.18.3. 撤销当前修改,恢复到远程最后一次提交
20.18.4. 回撤提交
20.18.5. 撤回单个文件提交
20.18.6. 合并分支中的单个
20.18.7. 每个项目一个证书
20.18.8. fatal: Not possible to fast-forward, aborting.
20.18.9. receive.denyCurrentBranch
20.18.10. 更新所有项目以及分支
20.18.11. 找回丢失的分支

homepage: http://git.or.cz/index.html

过程 20.1. Git

  1. install

    sudo apt-get install git-core
    			
  2. config

    			
    $ git-config --global user.name neo
    $ git-config --global user.email openunix@163.com
    			
    			
  3. Initializ

    $ mkdir repository
    $ cd repository/
    
    /repository$ git-init-db
    Initialized empty Git repository in .git/
    			

    to check .gitconfig file

    $ cat ~/.gitconfig
    [user]
            name = chen
            email = openunix@163.com
    			

20.1. 指定目录

		
git -C /srv/rct pull