Context:
- User "dev", home directory
/home/dev
- Production code in what I'll call
/thepath/codebase
- Working directory
/thepath/dev
(currently with files that should be a branch) - Project is called KizunaDB
Ultimately I want a bare repo called kizunadb.git
somewhere (I guess my home directory is logical) that I want seen as the "original", where everything clones from. (per conclusions from this discussion)
Not knowing how to start with an empty bare repo and then put files into it from elsewhere, I tried starting where the files are. I successfully made a repo in /thepath/codebase
and committed all the files. Then I did:
cd ~
mkdir kizunadb.git
cd kizunadb.git
git clone --bare /thepath/codebase
Hmm... that made /home/dev/kizunadb.git/codebase.git
- not quite what I had in mind.
- I can do it again from
/home/dev/
to fix the location, but it will still be calledcodebase.git
- if I just change the name, will I break it? - And then how do I swap roles between it and the codebase directory so that later I can get completed code from
kizunadb.git
to/thepath/codebase
(with clone or checkout - not sure which is the right command at that point)? I know git doesn't really have the concept of "the main one", but I have noticed references in tutorials to "original" - not sure how that plays in... - And then, how do I clone the repo to
/thepath/dev
so I can do branches without losing my work in progress? (I know I could move the whole directory out of the way, clone the repo, and then overwrite the repo's files, but I suspect there is an easier way.)
I'm happy to just start over if I have done things in the wrong order.