I have two remote repositories (let's call them remote1 and remote2) and both of them has a branch called "mainline".
When I try to checkout the "mainline" from remote1, I use "git checkout remote1/mainline" since if I just "git checkout mainline", git would complain since both remote1 and remote2 have "mainline". But now I got into the so called detached HEAD
mode and I already made one git commit
under detached HEAD
mode.
In git's world, I know I should work on branch, so is there any way I could fix the detached HEAD mode and work on a normal branch mode? (I hope the commit I already made could still remain).
Another question is that if I have two repositories, both of them have a branch with same name, what is the recommended way to checkout this branch from a specific remote without going to the detached HEAD mode?