I work on local branches and push local branches to my forked repo and then do a pull request on origin. Just wanted to learn good Github Practices.
When I push my local branch to forked repo on Github. I want to make sure that my local branch is up to date with the remote origin. What is a good way to do this ? DO any of the below two work ? what is the difference between the two ? when the rebase can fail ?Or any better soln?
$git branch
master
*my_branch
$git commit -am "committed"
$git fetch origin
$git rebase origin/master
$git push
$git commit -am "committed"
$git pull --rebase
$git push