Git Branch Workflow

If you haven’t cloned down the repo yet start with going into the folder where you want it and clone the repo.

cd myproject-folder
git clone myrepo.git

create temporary develop branch and move into it

git branch develop
git checkout develop

do all your changes you want todo
Then keep using these 3 steps while working: add,commit and push the branch up.

git add .
git commit -m "Initial commit"
git push -u origin develop

To keep the development branch up to date its a good idea to do regularly updated merges with master.
First checkout master, pull the latest, then checkout back into development branch and merged master into it. Before doing this,
do a git add and commit on your local branch, the steps above…

git checkout master
git pull
git checkout develop
git merge master

When you feel that the fix is ready to be merged together with the rest of the project. Checkout the master and pull in the latest updates and then merge in the develop branch into the master.

git checkout master
git pull
git merge develop

IF there wasn’t any merge conflicts and everything went fine, now its time to push up the latest master branch and delete the temp branch

git commit -m "commiting developing pu
git push
git branch -d develop

Add your comment