git常用操作

全局配置

git config --global user.name  "小狼"
git config --global user.email "1142864319@qq.com"

 创建新版本库

git clone https://git.XXX.com/XXX.git
cd xxx
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

 现有的文件夹或Git版本库

cd existing_folder
git init
git remote add origin https://git.xxx.com/xxx.git
git add .
git commit
git push -u origin master

 账号活密码输入错误修改办法

fatal: Authentication failed for '

 你输入一次后,无论对错都不会再让你输入了

此时打开:控制面板\用户帐户和家庭安全\凭据管理器

上面会有你的全部git账号,可以点击编辑直接修改,也可以删除,再次git push会让你重新输入账号密码

报错warning: LF will be replaced by CRLF

warning: LF will be replaced by CRLF in 

The file will have its original line endings in your working directory

git config --global core.autocrlf false

报错:error: Your local changes to the following files would be overwritten by merge:

Please commit your changes or stash them before you merge.

出现这个问题是别人修改的文件你在本地也做了修改,冲突了。

解决办法:

git stash
git pull
git stash pop

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值