2

I have only ever used git add . for this project, but somewhere along the line I started getting the strange "modified content, untracked content" error on one of my subdirectories (called users). Other stackoverflow answers didn't work for me. I used checkout to go back through previous commits, but the buggy/untracked subdirectory didn't change with the rest of the directory. I ended up making manual changes to it and then running git checkout master to make sure everything else was back where it started.

Git is saying that I'm bisecting, and it won't let me commit. I looked over stackoverflow answers, and tried some of the following commands:

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.

Apologies if these commands are all over the place. I intend to really learn how git works soon, but right now I just want to commit the changes so I can deploy my project.

UPDATE: I used git bisect reset, created a new branch out of my detached head, and then merged with the master. This kept the changes I made, so now I just need to figure out how to get users tracked again in my commits. git add users still isn't doing anything.

KyleR
  • 139
  • 2
  • 10
  • 1
    The message `modified content, untracked content` refers to a *submodule*. Meanwhile, if `git status` says that you are currently bisecting, you must have started a bisect. Keep going until you're done, or use `git bisect reset`to end bisecting and go back to what you were doing before you started bisecting. – torek Aug 23 '20 at 22:02
  • 1
    If you're using bisect intentionally here and need to get the submodule updated to the correct commit, use `git submodule update` to do that, or select recursive checkout (which will do that for you). Note that `git submodule` commands must be run within the superproject directory—it seems likely that you're in the submodule directory at this point. – torek Aug 23 '20 at 22:03
  • (One thing that's very unclear to me is why your superproject and/or submodule have no upstream.) – torek Aug 23 '20 at 22:05
  • Just to confirm - will git bisect revert everything to my previous head? And if so, is there an alternative way to keep my project in its current state and end the bisect? I'm currently in the superproject directory / root, but have made changes to users since my last commit. My goal is to be able to add users to the superdirectory's commits again. – KyleR Aug 24 '20 at 03:49
  • 1
    By default, `git bisect reset` goes back to whatever commit you were on when you ran `git bisect start` to start the operation. But you can run `git bisect reset ` to make it switch to the given commit; using `HEAD` as the commit-specifier makes it stay where you are now. So for what you've just described, you may want `git bisect reset HEAD`. See [the documentation](https://git-scm.com/docs/git-bisect) for more details. – torek Aug 24 '20 at 04:04
  • Note that if you *don't* have recursive checkout turned on, the submodule won't move from its current commit no matter what you give to `git bisect reset`. (I don't turn on recursive checkout for various reasons. This is one of them, albeit extremely rare as I don't use submodules if I can avoid them.) – torek Aug 24 '20 at 04:06

0 Answers0