General Information Pages

Important commands and configuration for working with branches

  • git fetch to update the known remote branches
  • git checkout -t origin/branch
    • sets up a local branch tracking origin/branch
    • Alternatively: git branch --track localbranchname remotebranchname
  • git config --global push.default tracking

Name local branch differently than remote branch

Move commits in master branch to sourceforge branch

  • move changes done starting from remotes/origin/master to master to sourceforge branch
    • git rebase --onto sourceforge remotes/origin/master master
  • let local sourceforge branch point to the most recent commit in master branch
    • git checkout sourceforge
    • git reset --hard master
  • reset master branch to remotes/origin/master
    • git checkout master
    • git reset --hard remotes/origin/master

Merging

Patching

git format-patch and git apply are a huge hazzle under Windows. Following paramters for git am solve most of these problems:

git am --keep-cr --ignore-space-change --ignore-whitespace

SVN-like Keywords

Diffing Binary Files

Browser

git & SVN

git 2 svn

HowTo

Server

  • git init --bare
  • export GIT_DIR = .
  • git svn clone with prefix svn
    • git svn clone --authors-file=path/to/authors_file --prefix=svn -s https://svn.example.org/svn/repo1
    • eventually use
      --no-follow-parent

      or

      --no-minimize-url
  • create upstream-vcs branch
    • all devs may NEVER write to that branch, but they may branch or cherry-pick from it
    • updating is done by the master with SVN access
  • cron job:

Client

Users wanting to track only trunk

  • use git pull/push normally, upstream-vcs tracks the upstream changes

Users wanting to track all svn trags/branches

  • Issue: mirror implies a bare repoistory
    • Quick solution: mirror and convert repo to a non-bare repository. Then, use git svn fetch. – Issue: The user has to have access to the SVN repo and the git functionality is not used any more to be in sync with SVN
  • svn init has to be done with the same/similar parameters (usenrame may differ) as with the main repo
  • The trick is
    git config --add remote.origin.fetch '+refs/remotes/*:refs/remotes/*'

Software

Statistics

Permissions / git hosting

Code-Reviewing

ANT integration

Einrichtung

 
git.txt · Last modified: 2012/05/04 21:31 by koppor
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki