1.Fork一個項目到自己的首頁
在想要fork的頁面fork一個。
2.首先clone自己
git clone [email protected]:nqmysb/hexo-theme-huweihuang.git
3.配置本地庫與原始庫的關聯, 添加與原始庫的關聯,命名為upstream,此位址是原項目開發者的項目首頁上的clone的位址:這是專門用來與主開發者保持相同進度的方法
git remote add upstream [email protected]:huweihuang/hexo-theme-huweihuang.git
4.從原始庫中抓取最新的更新 抓取原資料庫的更新,我們需要使用是git fetch upstream指令。這指令會自動選擇更改過的代碼檔案進行更新。
git fetch upstream master
5.本地修改代碼 合并
git merge upstream master
6.在本地修改完檔案測試完成之後,将代碼送出到我們自己的fork出來的項目首頁。
git add .
git commit -m "添加網站通路計數"
git push [email protected]:nqmysb/hexo-theme-huweihuang.git
l[email protected] MINGW64 /e/hexo-theme-huweihuang (master)
$ git add .
l[email protected] MINGW64 /e/hexo-theme-huweihuang (master)
$ git commit -m "添加網站通路計數"
[master 9404867] 添加網站通路計數
5 files changed, 25 insertions(+), 1 deletion(-)
rewrite db.json (87%)
l[email protected] MINGW64 /e/hexo-theme-huweihuang (master)
$ git push [email protected]:nqmysb/hexo-theme-huweihuang.git
Enumerating objects: 21, done.
Counting objects: 100% (21/21), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (11/11), 4.03 KiB | 824.00 KiB/s, done.
Total 11 (delta 8), reused 0 (delta 0)
remote: Resolving deltas: 100% (8/8), completed with 8 local objects.
To github.com:nqmysb/hexo-theme-huweihuang.git
fb39120..9404867 master -> master
最後建立pull request送出到master
項目建立人确認之後即可合并分支