其他 2018-02-21 16:41:21

git使用

git常用操作和命令

  1. git初始化仓库
git init
git add .
git commit -m "first commit"
git remote add origin '远程git地址'
git push -u origin master
  1. 更换远程仓库
    删除原有的仓库
    git remote rm origin
    添加新的
    git remote add origin '远程git地址'

git常见问题

  1. warning: LF will be replaced by CRLF...的警告
    git config --global core.autocrlf false

  2. git pull 失败 ,提示:fatal: refusing to merge unrelated histories
    git pull origin master --allow-unrelated-histories