1、先初始化,生成git相关文件,也就是.git/目录

 

git init

 

2、添加远程仓库,也就是把远程仓库添加到你本地git中

 

git remote add origin https://gitee.com/xxxxxx.git 

// 查看所有远程仓库,是否绑定成功
git remote -v

 

3、拉取远程代码,可能会有冲突,解决冲突就行

 

git pull origin master --allow-unrelated-histories

 

4、本地分支关联远程分支

 

git branch --set-upstream-to=origin/master master

 

5、最后就可以正常 add、commit、push 了

 

相关文章:

  • 2021-07-20
  • 2022-12-23
  • 2021-03-31
  • 2021-07-09
  • 2022-12-23
  • 2022-01-08
  • 2021-08-27
  • 2021-10-21
猜你喜欢
  • 2022-12-23
  • 2021-09-22
  • 2021-05-12
  • 2021-12-11
  • 2022-01-30
  • 2022-01-02
  • 2022-12-23
相关资源
相似解决方案