git搭建服务器

首先你有一个本机上的项目你想与别人共同开发那么请用git。
一.确认以安装git
           
二.git clone  --bare      ./gov        ./gov.git
             服务器上用   本地项目  给远程项目起的名字
   这样就会创建出一个裸库

   git remote -v,查看克隆的原始仓库,-v为-verbose缩写,显示对应的克隆地址

   添加一个远程仓库,以便方便自己找到
   git remote add [shortname] + 远程git仓库
   ep:
     $git remote
     origin(初始化带来的)
     $git remote add msj [email protected]:/home/gov.git
     $git remote -v
     origin              [email protected]:/home/gov.git
     msj                 [email protected]:/home/gov.git
    自己记得的名称   |  远程服务器项目

  查看某个远程仓库的详细信息
  git remote show [remote-name]

  远程仓库的删除和重命名
  $git remote AA BB
  $git remote
  origin
  BB
 
  从远程仓库抓取数据
  git fetch [remote-name][branch-name]

猜你喜欢

转载自dadadada2x.iteye.com/blog/1701276