从本地存储库推送到 GitHub 托管的远程 [英] Pushing from local repository to GitHub hosted remote

查看:36
本文介绍了从本地存储库推送到 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 [alias] [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.

然后,您将输入:

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.

这篇关于从本地存储库推送到 GitHub 托管的远程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆