git 常用命令


查看用户名和邮箱地址:

$ git config user.name

$ git config user.email
修改用户名和邮箱地址:

$ git config --global user.name "username"

$ git config --global user.email "email"


git branch 

git checkout luobing

git merge dev

git clone 

加入有个项目 
git init .

git pull git@git.oschina.Net:tiama3798/QrCodeTool.git

git add -A .

git commit -am "对代码版本的说明"

git push git@git.oschina.net:tiama3798/QrCodeTool.git master


--分支创建 与合并  
git checkout -b luobing  //切换 并新建一个分支 luobing

git branch   
git add .
git commit -m "luobing branch first commit"
git checkout dev

git merge luobing 

git branch -d luobing 

git branch --set-upstream-to=origin/dev


--------bug--------------
windows中的换行符为 CRLF, 而在Linux下的换行符为LF,所以在执行add . 时出现提示,解决办法:
[plain] view plain copy 在CODE上查看代码片派生到我的代码片
$ rm -rf .git  // 删除.git  
$ git config --global core.autocrlf false  //禁用自动转换    

然后重新执行:
[plain] view plain copy 在CODE上查看代码片派生到我的代码片
$ git init    
$ git add .  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值