将存储库推入GitHub [英] Pushing a repository onto GitHub
问题描述
我在自己的服务器上建立了自己的Git仓库,并创建了一个仓库。我是Git的新手,目前我所做的只是 git add *
, git commit
和 git push
。我并不是那么熟悉git。
I set up my own Git repository on my own server, and created a repository. I am new to Git, and all I do at the moment is git add *
, git commit
, and git push
. I am not all that familiar with git.
现在,我很想在Git Hub上创建一个存储库,以便远程GitHub存储库具有相同的更改列表I在我自己的服务器上。
Now, I would love to create a repository on Git Hub, so that the remote GitHub repository has the same list of changes I have on my own server.
我不认为你可以给我一个步骤列表,以及每个步骤将做什么的解释?我主要担心的是我不想破坏我当前的存储库。
I don't suppose you could give me a list of steps, as well as an explanation of what each step will do? My main concern is that I don't want to ruin my current repository.
更新:谢谢大家。我仍然不太了解GIT的工作原理(我相信我会在某些时候),但是: https:// github.com/mercmobily/hotplate :D
UPDATE: Thank you everybody. I still don't quite get how GIT works (I am sure I will at some point), but: https://github.com/mercmobily/hotplate :D
推荐答案
没有时间写完整的解决方案,但基本上你需要:
Don't have time to write a full solution, but basically you need to:
# create a nickname for your github account. In this case it is github
git remote add github your-github-repo-path
继续在本地提交更改并推送它们。当你想要推送到github时,执行:
Keep committing the changes locally and pushing them. When you want to push also to github, execute:
#push the changes to the repo on the 'github' nickname, to the branch master
git push github master
这篇关于将存储库推入GitHub的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!