初始化一个新仓库
git init
克隆仓库
git clone https://github.com/xstoop/docker-dev.git
git clone https://github.com/xstoop/docker-dev.git docker #克隆仓库指定文件夹
远程仓库
git remote -v # 查看当前的远程仓库
git remote show [remote-name] # 查看某个远程仓库的详细信息
git remote add pb git://github.com/paulboone/ticgit.git # 添加远程仓库
git fetch [remote-name] # 从远程仓库查看更新,不自动合并到当前工作分支
git pull [remote-name] [branch] # 自动合并到本地仓库中当前分支
git push [remote-name] [branch-name] # 推送数据到远程仓库
git remote rename pb paul # 重命名远程仓库
git remote rm paul # 删除远程仓库
新建一个裸仓库的副本
git init --bare # 新建一个空仓库副本
git clone --bare my_project /opt/git/project.git # 从当前项目新建一个空仓库副本