查看用户名和邮箱地址:
$ 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 .
git 常用命令
最新推荐文章于 2024-11-13 09:45:14 发布