2016-12-16 17 views
0

我看了這麼多。我無法在任何地方找到答案,Github官方或非官方詞彙表也沒有。對Github中數據傳輸命令的困惑

enter image description here

什麼是/一...

「工作區」

「索引」

「本地庫」

「遠程倉庫」

...關於我的電腦和Gi tHub服務器?工作區是我的電腦嗎?本地存儲庫是我的電腦嗎?我是否在我的個人服務器上設置Remote Repository?我可以記住這些單詞以及將數據從一個移動到另一個的命令,但它們對我來說毫無意義。

回答

0

工作區:您的項目目錄;又名工作號碼簿

索引:Git記錄的項目您已從工作區編輯add;又名臨時區域

本地資源庫:存儲在項目的.git目錄提交和分支的集合

遠程倉庫:另一個倉庫爲同一個項目是outwith項目目錄。 (不一定是不同的計算機上,但幾乎總是)

爲了證明:

$ cd my-dev-work 
$ mkdir fooproject 
$ cd fooproject     // your workspace 

$ git init      // creates local repo and index, with default branch 'master' 
$ echo "hello world!" >> foo.txt 
$ git add foo.txt     // foo.txt added to the index 

$ git commit -m "Created foo.txt" // foo.txt added to local repo in a new commit 

$ git remote add origin https://github.com/joebloggs/foo.git 
// adds a link to a remote repository, in this case on Github, named 'origin' 

$ git push origin master   
// push your local'master' branch to the 'origin' remote repo, 
// including the new commit containing 'foo.txt' 
+0

半局部 - 這是我最喜歡的Git講座之一:https://www.youtube.com/watch ?v = duqBHik7nRo –