建立git库
cd gitrepos // gitrepos为本地所有git代码库的存储目录 mkdir TencentPhaseII // 腾讯二期项目 cd TencentPhaseII // 进入该目录 git init –bare // bare类型的git代码库:只有git自身相关的目录结构树,没有working目录,适合部署为服务器
建立本地工程
Epic Launcher新建TencentPhaseII工程,并进入该工程目录 仔细调整.gitignore文件:忽略插件里的Binaries和Intermediate目录,工程Binaries里的dll文件可以选择保留,这个不会频繁创建 git init git remote add origin D:\gitrepos\TencentPhaseII git add … & git commit … ;; 这里git commit的目的是创建出本地master分支 git push 第一次需要git push --set-upstream origin master
对外发布代码库地址
git clone \\desktop-bj\gitrepos\TencentPhaseII
用户第一次拉取代码时,可能会出现warning: remote HEAD refers to nonexistent ref, unable to checkout.可以执行以下操作解决:
git branch -a ;; 显示所有的branch git checkout branch-name ;; 上面列出的branches中想要拉取的branch名字
或者在git clone时就指定branch:
git clone \\desktop-bj\gitrepos\TencentPhaseII -b master |