![]() ![]() Let’s start by setting up a repository and working tree on GAIA. Or so I hope … Setting it upĬonsider the case of two machines. git log -1 as follows: git log -1 fatal: bad default revision 'HEAD' There is no commit, and we get an error message that we have not seen before. Usually, this is enough to fix the error. Initialized your repository with git init or by cloning an existing repo. Make sure you’ve: Navigated to the right directory. As such, there will be no working tree, and hence no working git status. It will only contain the packed objects and refs etc that git internally stores and wont have any of the regular code files checked out. My revised workflow will be that I am on a particular machine, I’ll make some changes, maybe commit & push them … or maybe not, then I’ll go to the other machine and I can continue making changes there and push them off when I am happy. What does fatal: not a git repository mean This error means you attempted to run a Git command, but weren’t inside a Git repository. The remote repository in question is a bare repository. I don’t want to move the Git repository into Dropbox for fear of corruption/ sync conflicts, so I’ll keep that out of Dropbox in a local folder on each machine. However, git status (or any other git command) then gives the above fatal: Not a git repository (or any of the parent directories) error. for example: git clone git:///gitroot/cfdem/liggghts. This way Dropbox takes care of syncing my latest code across all my machines. This command works to get the files and compile them: git clone a-valid-git-url. My idea is to have the working tree in Dropbox. What should have happened 1.Open that file and show me an ip to use this thing. This means there is no record of Git inside a particular project folder. git/ folder is present, you have not initialized a repository. You can do this by running ls -la and checking for a. git so i use git init and i opened it again and it seems that i have a bigger problem. If you are in a project folder and you see a not a git repository error, check whether a repository is initialized. git fatal: not a git repository (or any of the parent directories). I like my commits to be when I make them, not run automatically, resulting in lots of spurious entries in my history. fatal: not a git repository (or any of the parent directories). I haven’t explored those but they seem wasteful. One solution would be to have a scheduled task (or some hook to PowerShell ISE) that automatically commits & pushes my changes to GitHub periodically (or whenever I click save). That works fine with the caveat that sometimes I forget to push the changes upstream and leave office/ home and and then I am unable to work at home/ office because my latest code is on the other machine while GitHub and the machine I am on don’t have those changes. I have multiple machines – one at office, couple at home – and usually my workflow involves having whatever I am working on being present in a local folder (not in Dropbox) managed by Git, with changes pushed and pulled to GitHub. ![]() I don’t think it will work out in the long term, but I spent time on it so might as well make note of it here in case it helps someone else. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |