我只使用git add .
过这个项目,但是在某个地方,我开始在我的一个子目录(称为用户)上收到奇怪的“修改过的内容,未跟踪的内容”错误。其他stackoverflow答案对我不起作用。我使用 checkout 来回顾以前的提交,但是 buggy/untracked 子目录并没有随着目录的其余部分而改变。我最终对其进行了手动更改,然后运行git checkout master
以确保其他所有内容都回到了它开始的位置。
Git 说我在对分,它不会让我提交。我查看了 stackoverflow 的答案,并尝试了以下一些命令:
git pull
:
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
git pull origin master
:
fatal: 'origin' does not appear to be a git repository
git branch --set-upstream-to=origin/master master
:
error: the requested upstream branch 'origin/master' does not exist
hint:
hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint:
hint: If you are planning to push out a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.
git pull --rebase
:
There is no tracking information for the current branch.
Please specify which branch you want to rebase against.
抱歉,如果这些命令到处都是。我打算很快真正了解 git 的工作原理,但现在我只想提交更改以便部署我的项目。
更新:我使用git bisect reset
,从我分离的头中创建了一个新分支,然后与主人合并。这保留了我所做的更改,所以现在我只需要弄清楚如何在我的提交中再次跟踪用户。git add users
仍然没有做任何事情。