I came to git via terminal, not GitHub and I am wondering how I make a connection between the two.
From a checkout I have, I created a branch in terminal by running this command:
git checkout -b newbranchname
From my understanding, GitHub calls this "forking". How do I connect the branch on my box to a fork of a checkout on GitHub?
(Thanks ahead of time for your help. My background is about 1.5 years of subversion.)
You're mixing a few things up.
First of all, a checkout in SVN is not the same as a checkout in git. What is called a checkout in SVN is called a clone in git. You don't check out a repository, you clone it. "Checking out" means switching to a specific branch, which is more or less the same as svn switch
, but you also have the ability of creating a new branch in the same step (that's what -b
does).
So I'm assuming that you have been using git locally, have now created a project on github and would like to push your changes to the github repo.
A fork is a copy of an existing third party repo on github. You can hit the "fork" button to get your own copy of that repository, allowing you to make your own changes. The other person can then pull in any changes you make into his own repository.
To associate your github repo with your local repo you do (locally):
git remote add origin [email protected]:<username>/<repo>.git
To push your changes:
git push origin master
You can find some great documentation for git here: http://git-scm.com/documentation
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