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

第 120 章 Git - Fast Version Control System

distributed revision control system

目录

120.1. 指定目录
120.2. Repositories 仓库管理
120.2.1. 仓库初始化
120.2.2. 克隆代码
120.2.3. 切换分支
120.2.4. 添加文件
120.2.5. 提交文件
120.2.6. 查看仓库状态
120.2.7. 比较文件
120.2.8. 推送
120.2.9. 拉去代码
120.2.10. 同步数据
120.2.11. Creating a Patch
120.2.12. 重置/回滚到指定版本
120.3. 分支管理
120.3.1. 查看本地分支
120.3.2. 创建分支
120.3.3. 删除分支
120.3.4. 切换分支
120.3.5. 重命名分支
120.3.6. git-show-branch - Show branches and their commits
120.4. 标签管理
120.4.1. 创建标签
120.4.2. 查看标签
120.4.3. 推送标签
120.4.4. 删除标签
120.5. git show - Show various types of objects
120.5.1. 查看指定版本的文件内容
120.6. git log 日志
120.6.1. hash-object
120.6.2. 查看文件历史记录
120.6.3. 目录历史记录
120.6.4. 一行显示 --oneline
120.6.5. 格式化
120.6.6. 过滤
120.6.7. all
120.6.8. full-history
120.6.9. reflog
120.7. git rev-parse - Pick out and massage parameters
120.7.1. 获得当前提交ID
120.7.2. --short
120.8. 合并分支
120.8.1. 合并分支
120.8.2. rebase
120.8.3. 合并分支解决冲突
120.8.4. 终止合并
120.8.5. 合并单个文件
120.8.6. Git 合并特定 commits 到另一个分支
120.9. 比较文件
120.9.1. 比较 SHA
120.9.2. 分支比较
120.10. 远程仓库
120.10.1. 查看远程地址
120.10.2. 显示远程地址
120.10.3. 添加远程仓库
120.10.4. 修改 origin
120.10.5. 删除 origin
120.10.6. 仓库共享
120.10.7. git-daemon 服务器
120.11. Submodule 子模块
120.11.1. 添加模块
120.11.2. checkout 子模块
120.11.3. 删除子模块
120.12. Git Large File Storage
120.12.1. 安装 LFS 支持
120.12.2. LFS lock
120.13. git config
120.13.1. git config
120.13.2. 查看配置
120.13.3. 编辑配置
120.13.4. 替换配置项
120.13.5. 配置默认分之
120.13.6. GPG签名
120.13.7. core.sshCommand
120.13.8. fatal: The remote end hung up unexpectedly
120.13.9. 忽略 SSL 检查
120.13.10. 配置忽略合并文件
120.13.11. .gitignore
120.13.12. .gitattributes
120.13.13. 配置模版目录
120.14. archive 代码打包
120.14.1. 查看支持的格式
120.14.2. 导出分支代码
120.14.3. 导出制定版本
120.15. git-svn - Bidirectional operation between a single Subversion branch and git
120.16. Web Tools
120.16.1. viewgit
120.17. gitolite - SSH-based gatekeeper for git repositories
120.17.1. gitolite-admin
120.18. FAQ
120.18.1. 导出最后一次修改过的文件
120.18.2. 导出指定版本区间修改过的文件
120.18.3. 撤销当前修改,恢复到远程最后一次提交
120.18.4. 回撤提交
120.18.5. 撤回单个文件提交
120.18.6. 合并分支中的单个
120.18.7. 每个项目一个证书
120.18.8. fatal: Not possible to fast-forward, aborting.
120.18.9. receive.denyCurrentBranch
120.18.10. 更新所有项目以及分支
120.18.11. 找回丢失的分支

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

过程 120.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
    			

120.1. 指定目录

		
git -C /srv/rct pull