1. 进入非空目录,假设是 /workdir/proj1

2. git clone --no-checkout https://domain_or_ip/source.git tmp

3. mv tmp/.git .   #将 tmp 目录下的 .git 目录移到当前目录

4. rmdir tmp

5. git reset --hard

然后就可以进行各种正常操作了。

 

 

github push错误:

  1. git push  
  2. error: The requested URL returned error: 403 Forbidden while accessing https://github.com/wangz/future.git/info/refs  

git version 1.7.1

OS:CENTOS

解决方案:

vim .Git/config

修改

 
  1. [remote "origin"]  
  2.     url = https://github.com/wangz/example.git  

为:

 
  1. [remote "origin"]  
  2.     url = https://wangz@github.com/wangz/example.git  

再次git push,弹出框输入密码,即可提交

相关文章:

  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
  • 2021-11-05
  • 2021-04-04
  • 2021-08-23
猜你喜欢
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2022-12-23
  • 2022-01-07
  • 2021-09-11
相关资源
相似解决方案