从本地存储库推送到 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?
首先使用 建立两者之间的关系后,您可以使用
命令.如果您访问您的 Github 存储库,它将向您显示用于推送的 URL.您将首先输入如下内容:git push
命令将本地存储库推送到远程存储库>git remote add [alias] [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.
然后,您将输入:
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.