Git tips

Local branch name

I am using jimmy as my local branch name

How to generate a new local branch

git branch jimmy
git checkout jimmy

How to check currently available branches?

(base) jimmy@jimmys-MacBook-Pro XXX % git branch* jimmymaster

the “*” indicates the currently used branch.

How to sync local to master?[1]

yes just do

git checkout master
git pull
git checkout jimmy
git merge master

to keep local branch jimmy in sync with the master branch.

then when you’re ready to put jimmy into master, first merge in master like above, then …

git checkout master
git merge jimmy
git push origin master

How to PR

online tutorials





Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store