2013年1月10日 星期四

How replace old 'master' branch with new 'master' branch

Sometime, the master's commits was arranged with 'rebase' and the master branch has new commits.
How to update commits of new master branch to remote repository's master branch

  $ git push --force origin master

If the arranged branch isn't 'master', need to rename 'master' to other name, like 'old_master',
than rename arranged branch to 'master', and push with --force parameter.

  $ git branch -m master old_master
  $ git branch -m new_master master
  $ git push --force origin master

2013年1月2日 星期三

Using meld for git diff


* 建立一個給git diff用的script file 在/usr/local/bin/git-meld

    #!/bin/sh
    #This file placed at /usr/local/bin/git-mled
    meld $2 $5

* 設定git diff 用的外部程式
    git config --global diff.external /usr/local/bin/git-meld

* 要恢復預設的git diff 方式
    git config --global -unset diff.external