git常用操作

2017-06-12  本文已影响0人  zychen143

push设置无需每次输入密码

http连接方式

git config --global credential.helper wincred
http://[username]:[password]@zychen.com.cn/scm/nec/nec-server.git

username: 远程代码块的登录账号
password:远程代码块的登录密码
@后面的内容及为远程代码块

ssh连接方式

传送门

基本配置

# 配置用户信息
git config --global user.name stash <用户名>
git config --global user.email <公司邮箱> 

# 关闭自动crlf转换,开启crlf检查
git config --global core.autocrlf false
git config --global core.safecrlf true

# 给命令设置别名
git config --global alias.st status

常用操作

git push origin :远程分支名
git remote prune origin
git reset HEAD^^
git cherry pick -提交的commit号
上一篇 下一篇

猜你喜欢

热点阅读