1

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

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

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

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

4

4 回答 4

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
于 2012-08-30T11:27:25.453 回答
1

这里有一些可能对GIT_HOW_TO有所帮助但我相信互联网上有太多资源可以帮助你做到这一点。在他们的Help_Page上很好地提到了在 github 上设置您的 repo 的步骤请仔细阅读,如果您有任何问题,请随时提出。顺便说一句,欢迎使用 Git :)

于 2012-08-30T11:25:51.873 回答
1

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

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

于 2012-08-30T11:26:35.700 回答
1

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

在本地机器上切换到远程 git 路径

cd ../../../

git pull "name " master 

pwd:"enter your password"

git add Filename

git commit -m "Comments on files"

git push "name" master

我希望这可以帮助你,如果我穿了,请纠正我

于 2012-08-30T11:27:36.657 回答