将存储库推送到GitHub

时间:2012-08-30 11:21:27

标签: git github

我在自己的服务器上设置了自己的Git存储库,并创建了一个存储库。我是Git的新手,我现在所做的只有git add *git commitgit push。我对git并不熟悉。

现在,我想在Git Hub上创建一个存储库,以便远程GitHub存储库具有我在自己的服务器上所拥有的相同的更改列表。

我不认为您可以给我一个步骤列表,以及每个步骤将做什么的解释?我主要担心的是我不想破坏我当前的存储库。

更新:谢谢大家。我仍然不太了解GIT的工作原理(我相信我会在某些时候),但是:https://github.com/mercmobily/hotplate:D

4 个答案:

答案 0 :(得分:2)

没有时间编写完整的解决方案,但基本上你需要:

# create a nickname for your github account. In this case it is github
git remote add github your-github-repo-path

继续在本地提交更改并推送它们。当你想也推送到github时,执行:

#push the changes to the repo on the 'github' nickname, to the branch master
git push github master

答案 1 :(得分:1)

这可能有所帮助GIT_HOW_TO但我相信互联网上有太多资源可以帮助你做到这一点。在Help_Page上提到了在github上设置repo的步骤。请仔细阅读此内容,如果您有任何问题,请随时提出。 BTW欢迎来到Git :)

答案 2 :(得分:1)

在GitHub上创建一个新的存储库,如下所示:https://help.github.com/articles/creating-a-new-repository

然后从这里开始执行第4步和第5步:https://stackoverflow.com/a/8012698/705048

答案 3 :(得分:1)

创建存储库并将远程路径添加到本地计算机

在本地计算机中切换到远程git路径

cd ../../../

git pull "name " master 

pwd:"enter your password"

git add Filename

git commit -m "Comments on files"

git push "name" master

我希望这可以帮到你,如果我想知道的话,请纠正我

相关问题