Reputation: 11796
I created a local repository of my Visual Studio 2010 solution folder using Git GUI on my dev machine. I then created a remote repository in my GitHub account. Now, I am looking for how to push my local repository to the remote repository.
In SVN I can just commit using TortoiseSVN and changes are pushed to the remote repository. I don't see any tool like that available for Git.
How do I push my local repo to my remote repo on GitHub?
Upvotes: 120
Views: 204347
Reputation: 939
open the command prompt Go to project directory
type git remote add origin your git hub repository location with.git
Upvotes: 0
Reputation: 311606
You push your local repository to the remote repository using the git push
command after first establishing a relationship between the two with the git remote add [alias] [url]
command. If you visit your Github repository, it will show you the URL to use for pushing. You'll first enter something like:
git remote add origin [email protected]:username/reponame.git
Unless you started by running git clone
against the remote repository, in which case this step has been done for you already.
And after that, you'll type:
git push origin master
After your first push, you can simply type:
git push
when you want to update the remote repository in the future.
Upvotes: 237
Reputation: 7094
This worked for my GIT version 1.8.4:
Upvotes: 1
Reputation: 17182
Subversion implicitly has the remote repository associated with it at all times. Git, on the other hand, allows many "remotes", each of which represents a single remote place you can push to or pull from.
You need to add a remote for the GitHub repository to your local repository, then use git push ${remote}
or git pull ${remote}
to push and pull respectively - or the GUI equivalents.
Pro Git discusses remotes here: http://git-scm.com/book/ch2-5.html
The GitHub help also discusses them in a more "task-focused" way here: http://help.github.com/remotes/
Once you have associated the two you will be able to push or pull branches.
Upvotes: 3
Reputation: 138042
Type
git push
from the command line inside the repository directory
Upvotes: 3