Reputation: 1402
I have two directories on my home folder assignments and assign-workspace. I want to manage them under the same repository, but I don't want the home directory to be the root. At the same time I don't want the contents to be duplicated across both assignments and assign-workspace. Something like
jagat ~/assignments $ git init && git remote add origin <git_url> && git add -A .
jagat ~/assignments $ git commit -m "Stuff from assignments" && git push origin master
jagat ~/assignments $ cd ../assign-workspace/
jagat ~/assign-workspace $ git init && git remote add origin <git_url> && git add -A .
jagat ~/assign-workspace $ git commit -m "Stuff from assign-workspace" && git push origin master
In the end, all the directories under assignments and assign-workspace should be managed under the same repository. I know it's a better practice to have both of them under a different directory "assignments_all", which I've already done.
Now, I'm just curious if it can be done in the first place.
Upvotes: 0
Views: 92
Reputation: 2135
Not possible. How would git know the difference between ~/assignments/README and ~/assign-workspace/README?
Upvotes: 1
Reputation: 3341
One solution might be to create a new directory, place both directories which you wish to be managed by git under that directory, and create the repository there.
Then, create symlinks to those directories from your home directory.
Upvotes: 2