git 常用命令

148 篇文章 2 订阅

git remote –v   查看远端地址

git config –list  查看配置

 

git remote set-url origin 你的远端地址 

git config –global user.name “用户名” 

git config –global user.email 邮箱地址

git add . 

git commit -m “本次要提交的概要信息” 

git push origin master

git push

 

git push --force origin  

上面命令使用-–force选项,结果导致在远程主机产生一个”非直进式”的合并(non-fast-forward merge)。除非你很确定要这样做,否则应该尽量避免使用–-force选项。

 

down下线上代码版本,抛弃本地的修改
不建议这样做,但是如果你本地修改不大,或者自己有一份备份留存,可以直接用线上最新版本覆盖到本地

git fetch --all
git reset --hard origin/master
git fetch

 

git config --global credential.helper store

你会在你本地生成一个文本,上边记录你的账号和密码。下次git pull/push就不用输入帐号密码了

git config --system --unset credential.helper

更换密码后,需要 unset credential.helper


 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值