记dropbox与git不和谐的一个问题

目前我基本都是使用git来管理代码,用dropbox存储自己写的代码还有git仓库。最近提交远程git仓库时,发现出现了冲突,网上资料比较少,不过还是找了一些方法。实际解决十分简单。 某次用pull来更新一下本地代码时,出现了如下的错误:

1
2
3
4
5
git.exe pull -v --progress       "origin"

fatal: Reference has invalid format: 'refs/heads/master (latelee 的冲突副本 2013-12-14)'
fatal: The remote end hung up upon initial contact
git did not exit cleanly (exit code 1) (2465 ms @ 2013/12/14 22:13:25)

于是google,找到一篇stackoverflow的文章: http://stackoverflow.com/questions/12773488/git-fatal-reference-has-invalid-format-refs-heads-master 按方法尝试,作用不大。 再继续搜索,又找到一篇: http://stackoverflow.com/questions/13586290/github-app-heroku-fatal-reference-has-invalid-format-refs-remotes-heroku 里面有一个答案:

1
2
3
You're certainly using Dropbox to sync your project among multiple computers.   
While performing the sync, the tool detected a conflict between two files and
created a backup with the suffix (COMPUTER_NAME's conflicted copy DATE).

基本是我遇到的问题。于是去dropbox的那个仓库目录查看,果然,在foo.git/refs/heads发现了一个不该存在的文件: master (latelee 的冲突副本 2013-12-14) 那个答案大意是说在dropbox同步时,发现了冲突,就自己创建了一个副本。

解决:干掉那个冲突的问题。