Daily Archives: February 4, 2021

git, git merge, rebase, branch

Sometimes, when develop a feature branch, then, we merge back to master branch. This results a ring. This made the merge point has 2 parents. So tracing back the diff would be difficult. The scenario we allow the ring and merge point is that the feature branch is kinda big feature. In the branch, it stores the feature branch developed history. It is good for us to trace back the developing process of feature branch.

git222

Normally, after creating a feature branch. Master branch has a new commit. On develop branch, run “git rebase master”. Then the new commit on master will be added before start of feature branch. This keeps the commit continuously.

After the development on feature branch is done. In master branch, run “git rebase feature_branch”, then the commit on feature branch will be moved to master branch smoothly.

git333

fast forward

git checkout master

git pull origin develop –ff-only   // in local, fast forward local master to same checksum of develop

git push origin master

delete remote branch

git push origin –delete branch_name

git remote

git remote add origin https://github.prod.hulu.com/USR/srs-reader.git

git remote set-url origin https://github.prod.hulu.com/USR/srs-reader.git

image markdown

<img src=”https://xxx.png”  width=”400″ />