Before starting work on a new feature, make sure to switch to stable branch and pull the latest code. Create a new branch from it locally and push to server, if the feature you plan to work on is dependent on an existing branch waiting for review, use that branch as your base
git checkout stable
git pull origin stable
git checkout -b feature-abc
git push -u origin feature-abc
To see your unstaged changes
git diff
To get latest code from master branch into your branch, rebase!
git checkout master
git pull --rebase
git checkout feature-abc
# then merge
git merge master
You can also do a local merge from master branch to your feature branch. Make sure to never do this merge on server.
git merge master
To store uncommited changes locally, stash them , instead of creating a incomplete commit
git stash
Pop the last stash to restore the stashed changes
git stash pop
To push your changes to server
git push origin feature-abc