0

I'm fairly new to coding and just started looking into versioning my code. This led to exploring Git within VisualStudio. I've created a couple repositories (one for each year of Revit we have and a backup for each) and all was working well until I tried pushing my branch onto the remote repository (the backup) when it said the remote branch was checked out. I checked it out from the backup before I cloned the repository so it makes sense, but I can't figure out how to undo that. Is there a way to check it back in? I can't seem to commit the remote branch since there weren't any changes, I just want it to not be checked out.

Angus
  • 1
  • 1
  • 1
    You don't "check out" code in Git. You "check out" branches. You don't "check in" code. You "commit" code. Using proper terminology is very important when asking for help in order to clearly communicate your problem. Please revise your question to explain exactly what you did (with specific commands, if possible), what the current state is, and what the desired state is. – Daniel Mann Apr 08 '21 at 22:08
  • @DanielMann Thank you for the advice, I edited my post to try and use the correct terminology. Hopefully it makes a little more sense. – Angus Apr 09 '21 at 18:06

1 Answers1

0

So I think I finally figured out what was going on. Sorry again if the post was a bit vague, my understanding of Git is still minimal.

The issue was with my workflow; I created a non-bare repository, cloned it, began working in the clone, and attempted to push branches from the clone to the original (remote) repository. It would seem this workflow would require a bare repository for use as a remote repository. (What I did might have worked if the remote branch I was trying to push to wasn't checked out, but I'm still stuck on that part.)

I found a similar issue here which has really helped me figure out how to fix this.

Angus
  • 1
  • 1