git 错误 Reinitialized existing Git repository in /**/***/ 和refusing to merge unrelated histories...

报错一: 这句话的意思是 在路径 /Users/jackma/Downloads/lotteryTicket 2/.git/ 现有的Git存储库初始化

➜ lotteryTicket 2 git:(master) git init
Reinitialized existing Git repository in /Users/jackma/Downloads/lotteryTicket 2/.git/

我是直接 删除这个 git,然后重新初始化一个

// 进入项目根目录

➜  ~  cd /Users/jackma/Downloads/lotteryTicket\ 2

➜ lotteryTicket 2 git:(master) ls -a

// 移除 .git
➜ lotteryTicket 2 git:(master) rm -rf .git
➜ lotteryTicket 2 ls -a

// 重新初始化
➜ lotteryTicket 2 git init

Initialized empty Git repository in /Users/jackma/Downloads/lotteryTicket 2/.git/

 报错二 :  执行git pull origin master 抛出错误refusing to merge unrelated histories

 需要添加一个参数 ,完美解决。

➜  lotteryTicket 2 git:(master) git pull origin master --allow-unrelated-histories

 

转载于:https://www.cnblogs.com/DafaRan/p/7149069.html

你可能感兴趣的:(git 错误 Reinitialized existing Git repository in /**/***/ 和refusing to merge unrelated histories...)