Git常用命令

Git常用命令

— 1 代码操作
— 1.1 克隆代码
git clone *******.git
— 1.2 更新代码
git pull
— 2 提交代码三步骤
- 2.1 查看状态
git status -s
- 2.2 提交到本地仓库并添加注释
git commit -am "modify test case"
- 2.3 提交至远程仓库
git push
— 3 分支操作
— 3.1 创建分支
git branch branchName
— 3.2 删除远程仓库分支
git push origin --delete branchName
— 3.3 删除本地仓库分支
git branch -d branchName
— 3.4 查看所有分支
git branch -a
— 3.5 切换分支
git checkout evan
— 3.6 将当前代码提交到一个新分支上(即:以当前代码创建新分支)
git push origin branchOld:branchNew
— 3.7 下载指定分支
git clone xxxxxxxxxxxxx.git -b branchName
# 创建新项目后提交至远程仓库
## 1 在github上创建reactor3-core
## 2 在本地仓库提交并推至远程仓库
echo "# reactor3-core" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:WeisonWei/reactor3-core.git
git push -u origin master

# 将本地新项目代码提交至远程仓库
git remote add origin git@github.com:WeisonWei/reactor3-core.git
git push -u origin master
# 此命令会列出所有GIT当时能找到的配置
git config --list    
# 修改git提交的email
git config --global user.email test@test.com 
# 修改提交的git的user.name  
git config --global user.name test
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值