Git beginner question:
I have a small private webproject which is versioned locally with msysgit. There is no exterior repository, as it's only for me, so i can bascially do whatever I want.
I've had this set up in the project directory, ie in "webroot".
Now a second directory had to be created, placed parallel to webroot. Let's call it assets.
So structure is now as follows:
\ project directory ----\webroot ----\assets
I'd love to include this new directory in the git repository, so that I'd also version changes to files stored there, but of course I can't use "git add ../assets". Neither am I inclined to create a new git project in project_directory, as this would loose all my previous commits.
So how do I go about moving the repository out of "webroot" up into "project_directory", while keeping my commits and then being able to include "assets"?
On GitHub.com, navigate to the main page of the repository. Under your repository name, click Settings. Under "Danger Zone", click Transfer. Read the information about transferring a repository, then type the name of the user or organization you'd like to transfer ownership of the repository to.
So, you want your git repo to look like this:
<projectdir> /.git /webroot /assets
To do this, you must move the existing files in your repo into a new webroot
subdirectory.
cd <git repo root> mkdir webroot git mv <all your files> webroot git commit --all -m "moved all existing files to new 'webroot' directory"
Then, on your local filesystem you want to relocate your clone one directory above where it is now:
cd <projectdir> mv webroot/* . rmdir webroot
Then you want to add the assets
directory (and files) to the git repo:
git add assets git commit -m "added assets to the repo"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With