[SR-Dev] commit & push into master / public branches

Andrei Pelinescu-Onciul andrei at iptel.org
Thu Apr 23 10:15:02 CEST 2009


When updating your local branch (e.g. master) with the repository
version, please always add --rebase to git pull 
(e.g. git pull --ff --rebase origin master).

This will avoid generating confusing useless merge messages
(like Merge branch 'master' of ssh://git.sip-router.org/sip-router).

Example:

    $ git push origin master:master

    To ssh://git.sip-router.org/sip-router
     ! [rejected]        master -> master (non-fast forward)
     error: failed to push some refs to
     'ssh://git.sip-router.org/sip-router'

    # failed because the local master branch is not up to date
    # => update it

    $ git pull --ff --rebase origin master

    # retry the push

    $ git push origin master:master


As an alternative, git can be configured to always rebase when pull-ing
 on a certain local branch, e.g. for master:
    git config branch.master.rebase true

See https://sip-router.org/wiki/git/commit-into-master for more detailed
info.


Andrei



More information about the sr-dev mailing list