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

第 130 章 Git - Fast Version Control System

distributed revision control system

目录

130.1. 指定目录
130.2. Repositories 仓库管理
130.2.1. 仓库初始化
130.2.2. 克隆代码
130.2.3. 切换分支
130.2.4. 添加文件
130.2.5. 提交文件
130.2.6. 查看仓库状态
130.2.7. 比较文件
130.2.8. 推送
130.2.9. 拉去代码
130.2.10. 同步数据
130.2.11. Creating a Patch
130.2.12. 重置/回滚到指定版本
130.3. 分支管理
130.3.1. 查看本地分支
130.3.2. 创建分支
130.3.3. 删除分支
130.3.4. 切换分支
130.3.5. 重命名分支
130.3.6. git-show-branch - Show branches and their commits
130.4. 标签管理
130.4.1. 创建标签
130.4.2. 查看标签
130.4.3. 推送标签
130.4.4. 删除标签
130.5. git show - Show various types of objects
130.5.1. 查看指定版本的文件内容
130.6. git log 日志
130.6.1. hash-object
130.6.2. 查看文件历史记录
130.6.3. 目录历史记录
130.6.4. 一行显示 --oneline
130.6.5. 格式化
130.6.6. 过滤
130.6.7. all
130.6.8. full-history
130.6.9. reflog
130.7. git rev-parse - Pick out and massage parameters
130.7.1. 获得当前提交ID
130.7.2. --short
130.8. 合并分支
130.8.1. 合并分支
130.8.2. rebase
130.8.3. 合并分支解决冲突
130.8.4. 终止合并
130.8.5. 合并单个文件
130.8.6. Git 合并特定 commits 到另一个分支
130.9. 比较文件
130.9.1. 比较 SHA
130.9.2. 分支比较
130.10. 远程仓库
130.10.1. 查看远程地址
130.10.2. 显示远程地址
130.10.3. 添加远程仓库
130.10.4. 修改 origin
130.10.5. 删除 origin
130.10.6. 仓库共享
130.10.7. git-daemon 服务器
130.11. Submodule 子模块
130.11.1. 添加模块
130.11.2. checkout 子模块
130.11.3. 删除子模块
130.12. Git Large File Storage
130.12.1. 安装 LFS 支持
130.12.2. LFS lock
130.13. git config
130.13.1. git config
130.13.2. 查看配置
130.13.3. 编辑配置
130.13.4. 替换配置项
130.13.5. 配置默认分之
130.13.6. GPG签名
130.13.7. core.sshCommand
130.13.8. fatal: The remote end hung up unexpectedly
130.13.9. 忽略 SSL 检查
130.13.10. 配置忽略合并文件
130.13.11. .gitignore
130.13.12. .gitattributes
130.13.13. 配置模版目录
130.14. archive 代码打包
130.14.1. 查看支持的格式
130.14.2. 导出分支代码
130.14.3. 导出制定版本
130.14.4. 导出目录和文件
130.15. git-svn - Bidirectional operation between a single Subversion branch and git
130.16. Web Tools
130.16.1. viewgit
130.17. gitolite - SSH-based gatekeeper for git repositories
130.17.1. gitolite-admin
130.18. FAQ
130.18.1. 导出最后一次修改过的文件
130.18.2. 导出指定版本区间修改过的文件
130.18.3. 撤销当前修改,恢复到远程最后一次提交
130.18.4. 回撤提交
130.18.5. 撤回单个文件提交
130.18.6. 合并分支中的单个
130.18.7. 每个项目一个证书
130.18.8. fatal: Not possible to fast-forward, aborting.
130.18.9. receive.denyCurrentBranch
130.18.10. 更新所有项目以及分支
130.18.11. 找回丢失的分支

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

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

130.1. 指定目录

		
git -C /srv/rct pull