转: git复制到非空目录

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,弹出框输入密码,即可提交

posted @ 2017-01-05 13:30  庚武  Views(374)  Comments(0Edit  收藏  举报