2015年10月12日 星期一

Git指令筆記


本人由於主要是用svn作Version Control. 只有一部份開源項目是用Github。 所以,經常會忘記了部份Git的指令。
因此,我在這篇 blog裡,記下幾個我比較常用的Git 指令:

1. 把Git的Repository Clone 下來
git clone {網址}

如果需要用戶登錄/密碼,指令為:
git clone http://{username}:{password}@{hostname}/{repository}.git



2. 查看Git Repository 的狀態
git status

3. 新增文件
git add {文件名}

新增全部文件
git add .

4. 移除文件
git rm {文件名}

5. 查看文件的不同
git diff

6. 重設Git的狀態
git reset

7. Commit ,但還沒有正式上傳到服務器的
git commit -m "Commit的訊息"

8. Push (上傳去Git的服務器)
git push

9. Pull (從Git服務器中,把最新的文件下載下來)
git pull

沒有留言:

張貼留言