1 使用系统是Ubuntu16.04的系统
 2 
 3 软件安装:sudo apt-get install git
 4 
 5 
 6 git config --global user.name ""
 7 
 8 git config --global user.email ""
 9 
10 git init ---初始化一个本地仓库

 

使用git第一次成功,记录

 1 git add .     添加的文件
 2 git status    文件状态
 3 git commit -m "第一次提交代码"
 4 
 5 git remote add origin https://github.com/aaafenghao/com.fh.test.git
 6 git push -u origin master
 7 
 8 第一次执行push的时候显示是需要合并文件,就是服务器上有,本地没有,需要先合并到本地
 9 git pull origin master
10 之后从新执行了一遍成功了。

 

 

 

使用git第一次成功,记录

 

 

新建了一个仓库,编辑完成之后,github上传的时候,报错refusing to merge unrelated histories

需要在更新的时候加一下参数:git pull origin master --allow-unrelated-histories

之后就可以上传了!

 

相关文章:

  • 2021-08-09
  • 2022-01-01
  • 2022-12-23
  • 2021-04-04
  • 2021-10-01
  • 2021-12-31
  • 2021-03-31
  • 2022-12-23
猜你喜欢
  • 2021-07-03
  • 2022-03-07
  • 2021-07-28
  • 2021-06-01
  • 2021-10-13
  • 2021-06-29
  • 2021-12-15
相关资源
相似解决方案