筆記1

AlpsGithup發表於2018-12-09

##github多人協作開發

參考
# [使用git和github進行協同開發流程](https://segmentfault.com/a/1190000002413519)

,這篇文章講的很詳細,跟著寫下來,基本ok。但因為是新手,跟小夥伴還是遇到一點問題,這裡記錄一下自己的流程。
1、fork源倉庫到本地:git clone https://XXXXXXXX.

2、
(git branch develop
git checkout develop
git add .
git commit -m '解釋'
git push origin master
git checkout master
git merge --no-ff develop
git push origin master
pull requests)

![圖片.png](https://upload-images.jianshu.io/upload_images/15355477-963557334fe3ba69.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
之後遇到的問題就是pull 之後有一個develop 分支,怎麼git branch -d 該分支,都不起作用,最後,用最簡單的方法,![圖片.png](https://upload-images.jianshu.io/upload_images/15355477-bb5405324121a9eb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
直接分支進入刪除了改分支。。也是剛。。
3、fork的專案本地開啟時先 npm install再npm run dev
好了,準備工作基本完成
4、問題:怎麼與整個專案程式碼保持一致?與pull requess 過程差不多為反過程。
主要參考了改作者:
https://blog.csdn.net/whq19890827/article/details/75802717
5、不用每次clone。建立一個臨時分支temp
git remote -v
git fetch origin master:temp
git diff temp(可以不要,只是檢視差別)
git branch
git merge temp
git branch -d temp
就可以自動同步啦啦啦
複製程式碼