Git工具的使用

 

  git clone https://github.com/xxx/xxaaxcc.git    (克隆分支到本地)  默认master分支; 

  git clone -b dev https://github.com/xxx/xxaaxcc.git   (克隆分支到本地)  克隆指定分支;

  git init(初始化目录)      

  git remote add origin https://github.com/xxx/xxaaxcc.git  (把https://github.com/xxx/xxaaxcc.git 这个仓库添加进来; 以后 origin就是它的本地名称)

  

(fetch具体分支)                     
  git fetch origin dev (分支名称)                     

  git push origin HEAD -u //追加新的分支到远程仓库;
  git branch (获取在哪个分支)
  git status (目前状态)
  git checkout -b dev 创建本地新的分支并到dev分支;

  //提交步骤;

   git pull
   git status
   git add --all      //git add .(所有改动的) 
   git commit -m "What you did?"
   git push

 

  //强制覆盖本地分支。

  git fetch --all

 git reset --hard origin/master // 远程分支名称

 git fetch

  最后检出:

  git checkout master

转载于:https://www.cnblogs.com/liuliu-hai/p/10271570.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值