从本地存储库推送到GitHub托管的远程
我在开发机器上使用Git GUI创建了我的Visual Studio 2010解决方案文件夹的本地存储库。然后我在我的GitHub帐户中创建了一个远程存储库。现在,我正在寻找如何将本地存储库推送到远程存储库。
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.
在SVN中,我可以使用TortoiseSVN进行提交,并将更改推送到远程存储库。我没有看到类似Git的工具。
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.
如何将我的本地仓库推送到GitHub上的远程仓库?
How do I push my local repo to my remote repo on GitHub?
使用 git push
命令将您的本地存储库推送到远程存储库后,首先使用 git remote add [别名] [url]
命令。如果您访问您的Github存储库,它会显示您用于推送的URL。您将首先输入如下内容:
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 git@github.com:username/reponame.git
除非您通过针对远程存储库运行 git clone
在这种情况下,这一步已经为您完成了。
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.