git 常用命令整理 下载 更新,上传

9初始化上传

 

1. $ git init #初始化

2. $ git add . # . 或 * 代表全部添加

3. $ git status #获取状态,很实用的一个功能,对文件做了操作都能看到各种提示信息

4 $ git commit -m "first push" #添加注释

5 $ git status #获取状态,很实用的一个功能,对文件做了操作都能看到各种提示信息

6 $ git remote add origin git@******:/*******#本地链接远程仓库

7 $ git remote -v #查看远程仓库信息

8. $ git checkout -b testdemo #创建并切换分支

 

9. $ git branch -a #查看本地分支

10. $ git branch -d master

11. $git branch

12. $ git branch -a

13. git push origin local_branch:remote_branch

14. git branch -a

下载项目

1: $ git init #初始化

2: $ git remote add origin git@192.168.2.211:/xjportal

 

3. $ git remote -v #查看各个分支最后一个提交对象的信息

4: $ git pull

5: $ git checkout -b wechat origin/wechat

$ git checkout -b XuanLi_Cartoon_Base origin/XuanLi_Cartoon_Base

 

克隆项目

1: $ git init #初始化

2: $ git clone git@192.168.2.227:/xjportal

 

 

 

 

 

更新项目

1.git pull

2. git log

3. git add .

4.git status

5. git commit -m "12015545"

6.git push 直接提交、、、、、、、、、  git push origin local_branch:remote_branch 提交分支

7.git log

6:备注:推送本地分支(local_branch)到远程分支 (remote_branch)并建立关联关系

      a.远程已有remote_branch分支并且已经关联本地分支local_branch且本地已经切换到local_branch

          git push

     b.远程已有remote_branch分支但未关联本地分支local_branch且本地已经切换到local_branch

         git push -u origin/remote_branch

     c.远程没有有remote_branch分支并,本地已经切换到local_branch

        git push origin local_branch:remote_branch

 

 

码云:

https://gitee.com/help/articles/4122

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值