I have a web application template created in Visual Studio 2012 using GIT for source control, but only on my local machine. I am now ready to use the template for deployments.
I don’t want to simply create a branch for deployments as these will never be merged back into the master. Instead, I have cloned the repository for the template into a new directory.
I notice that for this second directory, Remote is set to “origin” and the URL points to the original master. I would like for this to be pushed to its own independent repository, but I have not figured out how to set this up. Also, I thought that each clone of a repository created another repository, but if this is the case I do not see it and I do not know how to specify it as the repository to be pushed to.
From what I understand, you want to create a separate local repository that’s independent from your existing one.
To do that, you can just create a new directory, navigate to that empty directory in your console and then create the new repository by executing
git init. After the repository has been created, copy all the files you need into the new folder. Make sure that you don’t copy the .git directory, though. You can then add and commit all the files in your new directory by runninggit add *andgit commit -m "Initial commit". The commit message can be modified of course.You should now have a separate repository that you can commit changes to without affecting the original one.
Edit: When using TortoiseGit, instead of manually running the commands in the console, you can create a new repository by right-clicking the newly created folder and selecting “Git Create Repository Here“. After copying the files to that new repository, you can do the initial commit by right-clicking the directory again and selecting “Git commit -> ‘master’…” and following the TortoiseGit commit dialog.