git 操作命令

git clone [项目地址]

git config --list : 查看信息

git remote -v 查看远程仓库地址

git config user.name [用户名] : 修改使用的用户名

git remote set-url origin 'http://...' : 设置远程仓库地址

git config --global credential.helper store  : 输入用户名,密码并保存

git pull : 更新

若不成功,先 git add . 然后 git commit -m''

再次git pull , 这时会提示哪个文件有冲突 , 去处理冲突 

然后再次 git add .

git commit -m''

git push

-------------------------------------------------------------

另一种解决办法: 见 http://www.cnblogs.com/dupd/p/6077929.html

--------------------------------------------------------------

从git往本地拉代码又不想commit  :

git stash   (保存状态)

git pull      (拉)

git stash pop    (从list中pop)

详见:

https://blog.csdn.net/wh_19910525/article/details/7784901

https://blog.csdn.net/u014536527/article/details/83069636

---------------------------------------------------------------------------------

git commit -m 和 git commit -a -m的区别:
前者需先 git add 将文件加入暂存区才可以执行,
后者等于是将已跟踪的文件加入暂存区并提交。

---------------------------------------------------------------------------------

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值