[英]Pushing a repository onto GitHub
我在自己的服务器上建立了自己的Git存储库,并创建了一个存储库。 我是Git的新手,目前我只做git add *
, git commit
和git push
。 我对git不太熟悉。
现在,我希望在Git Hub上创建一个存储库,以便远程GitHub存储库具有与我自己的服务器上相同的更改列表。
我不认为您可以给我列出步骤,也不能解释每个步骤会做什么? 我主要担心的是,我不想破坏当前的存储库。
更新:谢谢大家。 我仍然不太了解GIT的工作原理(我肯定会在某个时候),但是: https : //github.com/mercmobily/hotplate :D
没有时间编写完整的解决方案,但是基本上您需要:
# 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
这可能对GIT_HOW_TO有帮助,但是我相信互联网上有太多资源可以帮助您做到这一点。 在github上的Help_Page上很好地提到了在github上设置仓库的步骤。如果您有任何问题,请随时提问。 BTW欢迎来到Git :)
在GitHub上创建新的存储库,如下所示: https : //help.github.com/articles/creating-a-new-repository
然后从此处执行步骤4和5: https : //stackoverflow.com/a/8012698/705048
创建一个存储库并将您的远程路径添加到本地计算机
在本地机器上切换到远程git路径
cd ../../../
git pull "name " master
pwd:"enter your password"
git add Filename
git commit -m "Comments on files"
git push "name" master
我希望这可以对您有所帮助,如果累了,请纠正我
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.