6 October 2010

git

by mo


my git-svn workflow

  • git svn clone http://svn-repo -T trunk -b branches -t tags
  • cd svn-repo
  • git svn rebase
  • git branch -f development
  • git checkout development
  • gvim hello-world.mkd – edit file
  • gvim goodbye-world.mkd – edit file
  • git add .
  • git commit -am “added hello world, and good bye”
  • git checkout master
  • git svn rebase
  • git merge –squash development
  • git commit – squash commit message
  • git svn dcommit
  • git branch -f development
  • git checkout development
  • rm goodbye-world.mkd
  • git add -A
  • git commit -am “removed goodbye.”
  • git checkout master
  • git svn rebase
  • git merge –squash development
  • git commit – edit and squash the commit message.
  • git svn dcommit

To create an SVN tag from git.

1
  $ git svn branch -t {tagname}

creating an ssh key

$ cd ~/.ssh $ ssh-keygen -t rsa -C “email@mokhan.ca”

managing multiple accounts

in your .ssh config you can specify which rsa keys to use for different domains. e.g.

1
2
3
4
5
6
7
8
    ~/.ssh/config
    Host project1.unfuddle.com
        User git
        IdentityFile ~/.ssh/project1/id_rsa

    Host *.unfuddle.com
        User git
        IdentityFile ~/.ssh/id_rsa

hosting git yourself

1
2
3
4
5
6
7
8
$ sudo adduser git
$ login git
$ mkdir test.git
$ cd test.git
$ git init --bare
$ git remote rm origin
$ git remote add origin git@server.com:test.git
$ git push origin master

git submodules

tutorial fix path

  • on windows I had to fix the path in .gitmodules from .\src\Messages to src/Messages

submodules for git-svn

tutorial

tips for intermediates git svn externals private git server setup

tools