I was using Perforce and am switching computers and decided to try Git. I have several projects - source code, electrical engineering files, mechanical engineering files, etc. I would like to keep their commits separate. I also want to be able to tag different commits so that I can get back to a particular configuration (for lack of a better term).
In addition, I want the Git repository to be in a separate folder.
I do not expect to be sharing the code with an online repository or other people. So, I was going to create a local repository and add/commit to it. I'll probably just back this directory to OneDrive or have OneDrive point to the Git repository.
I've read many different blogs and questions but am at a loss on how to proceed and would be very grateful for guidance.
The directory structure is as follows:
c:\Depot
c:\Depot\Source
c:\Depot\Source\Robot1
c:\Depot\Source\Robot2
c:\Depot\Source\Robot3
c:\Depot\Source\Library
c:\Depot\EE
c:\Depot\EE\Robot1
c:\Depot\EE\Robot2
c:\Depot\EE\Robot3
c:\Depot\ME
c:\Depot\ME\Robot1
c:\Depot\ME\Robot2
c:\Depot\ME\Robot3
Each of the "leaf" directories - ex. Robotx
have further sub-directories that I want to track within Robotx
.
What I'd like to do is have separate commit histories for each of the Robotx
in the Source
, EE
and ME
directories and also for Library
. I don't want to use filters to separate them out.
Finally, I want the git repository to be at c:\Depot\Git
I went to c:\Source
and did: git init --separate-git-dir Git
and that created c:\Source\Git
with what seemed like Git files and folders.
To add the first project, I went to c:\Depot\Source
and did: git submodule add `pwd`/Robot1
and I got an error message: 'Source/Robot1' already exists and is not a valid git repo