簡體   English   中英

將存儲庫推送到GitHub

[英]Pushing a repository onto GitHub

我在自己的服務器上建立了自己的Git存儲庫,並創建了一個存儲庫。 我是Git的新手,目前我只做git add *git commitgit 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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM