Git Workflow For Team
By Anak Wannaphaschaiyong
I intend to make this blog be a work-in-progress where I will keep adding useful git workflow when working with a team.
Pull Requests
To do a pull-requests, you need to do the following
- fork original repo.
- create new local branch and checkout to the new branch.
- commit new changes.
- send pull requests from
new local branch
fromforked repo (origin)
tooriginal repo (upstream)
.
Alternative to the pull-request workflow I mention above, it is possible to do pull-requests by using git forge
1, adding commit to new branch 2, and then do a pull requests to the target branch in remote. The new branch is automatically created
Pull new updates from upstream repo
To get new updates from upstream, you need to do the following
git fetch upstream
check if git fetch correctly by runninggit branch -v -a
- git merge
remote/upstream
to local branch. - git push changes to from local branch to
remote/origin
-
As of [2022-07-03 Sun], I still don’t know for sure what
git forge
does or what it is ↩︎ -
As of [2022-07-03 Sun], I believe that the new branch is on the orignal repo instead of fork repo. I haven’t tried it first hand, I watched this magit forge video. ↩︎