All work happens in a topic branch. Nothing gets done in master — master
should always be stable, clean, and ready for a release. Let’s imagine that I am adding some responsive features in a branch called feature/responsive
.
Firstly, I make sure my local copy of master
is fully up to date with remote. After pushing and pulling, I create my topic branch off of master
:
git checkout -b feature/responsive && git push -u
There are two things happening here, firstly I check out a branch called feature/responsive
(that didn’t yet exist). Next, I want to set feature/responsive
to track a remote branch of the same name, this is the git push -u
. This second command just means that I can run git push
and git pull
as just that. Without setting up remote tracking, I would have to run git push origin feature/responsive
and git pull origin feature/responsive
every time.