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

第 119 章 Git - Fast Version Control System

distributed revision control system

目录

119.1. 指定目录
119.2. Repositories 仓库管理
119.2.1. initial setup
119.2.2. 克隆代码
119.2.3. 切换分支
119.2.4. git-add - Add file contents to the index
119.2.5. Creating and Commiting
119.2.6. Status
119.2.7. Diff
119.2.8. Push
119.2.9. Pull
119.2.10. fetch
119.2.11. Creating a Patch
119.2.12. reset
119.3. 分支管理
119.3.1. 查看本地分支
119.3.2. 创建分支
119.3.3. 删除分支
119.3.4. 切换分支
119.3.5. 重命名分支
119.3.6. git-show-branch - Show branches and their commits
119.4. git show - Show various types of objects
119.4.1. 查看指定版本的文件内容
119.5. git log 日志
119.5.1. hash-object
119.5.2. 查看文件历史记录
119.5.3. 目录历史记录
119.5.4. 一行显示 --oneline
119.5.5. 格式化
119.5.6. 过滤
119.5.7. all
119.5.8. full-history
119.5.9. reflog
119.6. git rev-parse - Pick out and massage parameters
119.6.1. 获得当前提交ID
119.6.2. --short
119.7. 合并分支
119.7.1. 合并分支
119.7.2. rebase
119.7.3. 合并分支解决冲突
119.7.4. 终止合并
119.7.5. 合并单个文件
119.7.6. Git 合并特定 commits 到另一个分支
119.8. 比较文件
119.8.1. 比较 SHA
119.8.2. 分支比较
119.9. 远程仓库
119.9.1. 查看远程地址
119.9.2. 显示远程地址
119.9.3. 添加远程仓库
119.9.4. 修改 origin
119.9.5. 删除 origin
119.9.6. 仓库共享
119.9.7. git-daemon 服务器
119.10. Submodule 子模块
119.10.1. 添加模块
119.10.2. checkout 子模块
119.10.3. 删除子模块
119.11. Git Large File Storage
119.11.1. 安装 LFS 支持
119.11.2. LFS lock
119.12. git config
119.12.1. git config
119.12.2. 查看配置
119.12.3. 编辑配置
119.12.4. 替换配置项
119.12.5. 配置默认分之
119.12.6. GPG签名
119.12.7. core.sshCommand
119.12.8. fatal: The remote end hung up unexpectedly
119.12.9. 忽略 SSL 检查
119.12.10. 配置忽略合并文件
119.12.11. .gitignore
119.12.12. .gitattributes
119.12.13. 配置模版目录
119.13. archive 代码打包
119.13.1. 查看支持的格式
119.13.2. 导出分支代码
119.13.3. 导出制定版本
119.14. git-svn - Bidirectional operation between a single Subversion branch and git
119.15. Web Tools
119.15.1. viewgit
119.16. gitolite - SSH-based gatekeeper for git repositories
119.16.1. gitolite-admin
119.17. FAQ
119.17.1. 导出最后一次修改过的文件
119.17.2. 导出指定版本区间修改过的文件
119.17.3. 撤销当前修改,恢复到远程最后一次提交
119.17.4. 回撤提交
119.17.5. 撤回单个文件提交
119.17.6. 合并分支中的单个
119.17.7. 每个项目一个证书
119.17.8. fatal: Not possible to fast-forward, aborting.
119.17.9. receive.denyCurrentBranch
119.17.10. 更新所有项目以及分支
119.17.11. 找回丢失的分支

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

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

119.1. 指定目录

		
git -C /srv/rct pull