我该怎么做才能解决这个“已经是最新的”错误:
我创建了一个新的本地仓库并尝试拉取远程主分支。它偶然发现了我的新 .gitignore 并出错了。我删除了 .gitignore (将被 repo 替换),但现在我不能拉那个分支。
User@BRD-09-DEC10 /c/path/to/local (master)
$ git pull stage master
user@website.com password:
remote: Counting objects: 1211, done.
remote: Compressing objects: 100% (1191/1191), done.
remote: Total 1211 (delta 81), reused 0 (delta 0)
Receiving objects: 100% (1211/1211), 83.05 MiB | 491 KiB/s, done.
Resolving deltas: 100% (81/81), done.
From ssh://website.com/path/to/repo
* branch master -> FETCH_HEAD
error: Untracked working tree file '.gitignore' would be overwritten by merge.
User@BRD-09-DEC10 /c/path/to/local (master)
$ ls -al
total 5
drwxr-xr-x 4 User Administ 0 Jan 9 11:35 .
drwxr-xr-x 17 User Administ 4096 Jan 9 11:32 ..
drwxr-xr-x 7 User Administ 4096 Jan 9 11:38 .git
-rw-r--r-- 1 User Administ 19 Jan 9 11:35 .gitignore
drwxr-xr-x 3 User Administ 0 Jan 9 11:35 nbproject
User@BRD-09-DEC10 /c/path/to/local (master)
$ rm .gitignore
User@BRD-09-DEC10 /c/path/to/local (master)
$ git merge stage/master
fatal: 'stage/master' does not point to a commit
User@BRD-09-DEC10 /c/path/to/local (master)
$ git pull stage master
user@website.com's password:
From ssh://website.com/path/to/repo
* branch master -> FETCH_HEAD
Already up-to-date.
我希望我能得到这个,因为远程分支已经存储在本地(第一次 git 花了一些时间),但如果是这样的话,那么我想我不知道如何合并那个分支。
这会定期发生 - 知道为什么吗?