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

第 132 章 Git - Fast Version Control System

distributed revision control system

目录

132.1. 指定目录
132.2. Repositories 仓库管理
132.2.1. 仓库初始化
132.2.2. 克隆代码
132.2.3. 切换分支
132.2.4. 添加文件
132.2.5. 提交文件
132.2.6. 查看仓库状态
132.2.7. 比较文件
132.2.8. 推送
132.2.9. 拉去代码
132.2.10. 同步数据
132.2.11. Creating a Patch
132.2.12. 重置/回滚到指定版本
132.3. 分支管理
132.3.1. 查看本地分支
132.3.2. 创建分支
132.3.3. 删除分支
132.3.4. 切换分支
132.3.5. 重命名分支
132.3.6. git-show-branch - Show branches and their commits
132.4. 标签管理
132.4.1. 创建标签
132.4.2. 查看标签
132.4.3. 推送标签
132.4.4. 删除标签
132.5. git show - Show various types of objects
132.5.1. 查看指定版本的文件内容
132.6. git log 日志
132.6.1. hash-object
132.6.2. 查看文件历史记录
132.6.3. 目录历史记录
132.6.4. 一行显示 --oneline
132.6.5. 格式化
132.6.6. 过滤
132.6.7. all
132.6.8. full-history
132.6.9. reflog
132.7. git rev-parse - Pick out and massage parameters
132.7.1. 获得当前提交ID
132.7.2. --short
132.8. 合并分支
132.8.1. 合并分支
132.8.2. rebase
132.8.3. 合并分支解决冲突
132.8.4. 终止合并
132.8.5. 合并单个文件
132.8.6. Git 合并特定 commits 到另一个分支
132.9. 比较文件
132.9.1. 比较 SHA
132.9.2. 分支比较
132.10. 远程仓库
132.10.1. 查看远程地址
132.10.2. 显示远程地址
132.10.3. 添加远程仓库
132.10.4. 修改 origin
132.10.5. 删除 origin
132.10.6. 仓库共享
132.10.7. git-daemon 服务器
132.11. Submodule 子模块
132.11.1. 添加模块
132.11.2. checkout 子模块
132.11.3. 删除子模块
132.12. Git Large File Storage
132.12.1. 安装 LFS 支持
132.12.2. LFS lock
132.13. git config
132.13.1. git config
132.13.2. 查看配置
132.13.3. 编辑配置
132.13.4. 替换配置项
132.13.5. 配置默认分之
132.13.6. GPG签名
132.13.7. core.sshCommand
132.13.8. fatal: The remote end hung up unexpectedly
132.13.9. 忽略 SSL 检查
132.13.10. 配置忽略合并文件
132.13.11. .gitignore
132.13.12. .gitattributes
132.13.13. 配置模版目录
132.14. archive 代码打包
132.14.1. 查看支持的格式
132.14.2. 导出分支代码
132.14.3. 导出制定版本
132.14.4. 导出目录和文件
132.15. git-svn - Bidirectional operation between a single Subversion branch and git
132.16. Web Tools
132.16.1. viewgit
132.17. gitolite - SSH-based gatekeeper for git repositories
132.17.1. gitolite-admin
132.18. FAQ
132.18.1. 导出最后一次修改过的文件
132.18.2. 导出指定版本区间修改过的文件
132.18.3. 撤销当前修改,恢复到远程最后一次提交
132.18.4. 回撤提交
132.18.5. 撤回单个文件提交
132.18.6. 合并分支中的单个
132.18.7. 每个项目一个证书
132.18.8. fatal: Not possible to fast-forward, aborting.
132.18.9. receive.denyCurrentBranch
132.18.10. 更新所有项目以及分支
132.18.11. 找回丢失的分支

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

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

132.1. 指定目录

		
git -C /srv/rct pull