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

第 121 章 Git - Fast Version Control System

distributed revision control system

目录

121.1. 指定目录
121.2. Repositories 仓库管理
121.2.1. 仓库初始化
121.2.2. 克隆代码
121.2.3. 切换分支
121.2.4. 添加文件
121.2.5. 提交文件
121.2.6. 查看仓库状态
121.2.7. 比较文件
121.2.8. 推送
121.2.9. 拉去代码
121.2.10. 同步数据
121.2.11. Creating a Patch
121.2.12. 重置/回滚到指定版本
121.3. 分支管理
121.3.1. 查看本地分支
121.3.2. 创建分支
121.3.3. 删除分支
121.3.4. 切换分支
121.3.5. 重命名分支
121.3.6. git-show-branch - Show branches and their commits
121.4. 标签管理
121.4.1. 创建标签
121.4.2. 查看标签
121.4.3. 推送标签
121.4.4. 删除标签
121.5. git show - Show various types of objects
121.5.1. 查看指定版本的文件内容
121.6. git log 日志
121.6.1. hash-object
121.6.2. 查看文件历史记录
121.6.3. 目录历史记录
121.6.4. 一行显示 --oneline
121.6.5. 格式化
121.6.6. 过滤
121.6.7. all
121.6.8. full-history
121.6.9. reflog
121.7. git rev-parse - Pick out and massage parameters
121.7.1. 获得当前提交ID
121.7.2. --short
121.8. 合并分支
121.8.1. 合并分支
121.8.2. rebase
121.8.3. 合并分支解决冲突
121.8.4. 终止合并
121.8.5. 合并单个文件
121.8.6. Git 合并特定 commits 到另一个分支
121.9. 比较文件
121.9.1. 比较 SHA
121.9.2. 分支比较
121.10. 远程仓库
121.10.1. 查看远程地址
121.10.2. 显示远程地址
121.10.3. 添加远程仓库
121.10.4. 修改 origin
121.10.5. 删除 origin
121.10.6. 仓库共享
121.10.7. git-daemon 服务器
121.11. Submodule 子模块
121.11.1. 添加模块
121.11.2. checkout 子模块
121.11.3. 删除子模块
121.12. Git Large File Storage
121.12.1. 安装 LFS 支持
121.12.2. LFS lock
121.13. git config
121.13.1. git config
121.13.2. 查看配置
121.13.3. 编辑配置
121.13.4. 替换配置项
121.13.5. 配置默认分之
121.13.6. GPG签名
121.13.7. core.sshCommand
121.13.8. fatal: The remote end hung up unexpectedly
121.13.9. 忽略 SSL 检查
121.13.10. 配置忽略合并文件
121.13.11. .gitignore
121.13.12. .gitattributes
121.13.13. 配置模版目录
121.14. archive 代码打包
121.14.1. 查看支持的格式
121.14.2. 导出分支代码
121.14.3. 导出制定版本
121.14.4. 导出目录和文件
121.15. git-svn - Bidirectional operation between a single Subversion branch and git
121.16. Web Tools
121.16.1. viewgit
121.17. gitolite - SSH-based gatekeeper for git repositories
121.17.1. gitolite-admin
121.18. FAQ
121.18.1. 导出最后一次修改过的文件
121.18.2. 导出指定版本区间修改过的文件
121.18.3. 撤销当前修改,恢复到远程最后一次提交
121.18.4. 回撤提交
121.18.5. 撤回单个文件提交
121.18.6. 合并分支中的单个
121.18.7. 每个项目一个证书
121.18.8. fatal: Not possible to fast-forward, aborting.
121.18.9. receive.denyCurrentBranch
121.18.10. 更新所有项目以及分支
121.18.11. 找回丢失的分支

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

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

121.1. 指定目录

		
git -C /srv/rct pull