So, total newbie to Git. Been reading through the guides and think I have the basics but am having difficulties accomplishing this one goal.
I have a repo created for my generic markup source code. Just stuff I reuse for every breakout. It's called markupDNA.git
I would like to have different directories in my mac sites dir ~/Sites/project-N
. Where I build upon the generic stuff and do a breakout of a site. I would like these to be tied to my main git repo as forks, but you cannot fork your own repo?
I wish I could do something like this:
git clone <url> name git add . # make changes git commit -m 'whatever' git push
But I don't want it to push to origin. I want it to push to a fork of the markupDNA
repo whence it was cloned. But it seems like it just pushes my changes right up into the origin master. The idea is to keep the markupDNA
clean and just have a lot of forks for my different projects, each of which will have their own cloned dir on my hard drive.
Any ideas?
Creating a fork on GitHub is as easy as clicking the “fork” button on the repository page. The fork will then appear in the list of your repositories on GitHub where you can clone it to your local machine and edit it. Once you are done editing, you push your commits back to the fork on GitHub.
You're doing the right thing.
cd ~/Sites/ git clone ~/Dev/markupDNA/ project-N cd project-N git remote rename origin markupDNA
markupDNA
repo with custom nameIt will probably be a lot easier to use branches, rather than using separate forks. You can still have separate checkouts for each branch; just clone your repo multiple times, and use git checkout
in each one to switch it to the appropriate branch (or git checkout -b
to create the branch and check it out all at once). Once you have created the branches, you can push them to GitHub using git push origin <branchname>
.
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