Entries tagged as git
As I'm keeping code for my diploma thesis in git and svn atm (various reasons, don't wonder) and I've got a few windows boxes, I've come to see that git+windows isn't always an easy task.
So that I shall forever remember what to do, here's it:
a) open up puttygen
b) import openssh private key
c) save as whatever (putty format)
d) open up putty
e) save a new session:
* gitosis@host.example.org
* port 22 or whatever
* Connection -> SSH -> Auth, select the converted putty key from c) or use pageant
* session name: gitosis_host or something
* important: save to registry, not to file
f) git clone gitosis_host:project.git
So that I shall forever remember what to do, here's it:
a) open up puttygen
b) import openssh private key
c) save as whatever (putty format)
d) open up putty
e) save a new session:
* gitosis@host.example.org
* port 22 or whatever
* Connection -> SSH -> Auth, select the converted putty key from c) or use pageant
* session name: gitosis_host or something
* important: save to registry, not to file
f) git clone gitosis_host:project.git
So, I've had this project that's been in svn for a while, but then a year ago I forked it and worked on it in git. Much smoother anyway :P.
But now I wanted to put it back to svn (into another repository) while preserving the history.
I found these hints, but neither worked out:
http://markpasc.livejournal.com/186297.html
http://its.arubything.com/2009/1/4/commit-a-linear-git-history-to-subversion
http://stackoverflow.com/questions/457694/how-to-commit-a-git-repo-to-an-empty-repo-svn-server
http://wiki.apache.org/general/GitAtApache
So with the help of our local git hero himself it came to a happy ending:
$ git svn clone https://svnrepo.example.org/repo/whatever [ -r XX]
$ git fetch ~/code/repo.git mybranch
$ git checkout FETCH_HEAD
$ git branch tomergeTEMP
$ git checkout master
$ git rev-list --reverse FETCH_HEAD | head -n 1
-> de53700000000000000000000000000000000000
$ git rev-list --reverse HEAD | head -n 1
-> 2a74500000000000000000000000000000000000
$ echo de53700000000000000000000000000000000000 2a74500000000000000000000000000000000000 > .git/info/grafts
$ git rebase tomergeTEMP
$ git svn dcommit --dry-run
$ git svn dcommit
To elaborate a bit:
a) clone the svn repository. empty one (with trunk/branches/tags created is perfect)
b) fetch the branch mybranch from a git repo
c) check out FETCH_HEAD
d) branch it to a temporary name
e) get back to master (master of the *new* repo that was cloned)
now the interesting part. with grafts you can merge history lines, it needs 2 commit sha-1 values.
f) get the first one
g) get the second one
h) put them into .git/info/grafts (format "X Y", value one, single space, value two)
i) do a rebase from the temporary branch
j) dry-run to check you have several diff-tree ... lines (one for each commit in the git repo)
k) really commit to svn if the last step looked reasonable. This will take a while, as it does one svn commit per git commit
update: just found a helpful thread on stackoverflow:
But now I wanted to put it back to svn (into another repository) while preserving the history.
I found these hints, but neither worked out:
http://markpasc.livejournal.com/186297.html
http://its.arubything.com/2009/1/4/commit-a-linear-git-history-to-subversion
http://stackoverflow.com/questions/457694/how-to-commit-a-git-repo-to-an-empty-repo-svn-server
http://wiki.apache.org/general/GitAtApache
So with the help of our local git hero himself it came to a happy ending:
$ git svn clone https://svnrepo.example.org/repo/whatever [ -r XX]
$ git fetch ~/code/repo.git mybranch
$ git checkout FETCH_HEAD
$ git branch tomergeTEMP
$ git checkout master
$ git rev-list --reverse FETCH_HEAD | head -n 1
-> de53700000000000000000000000000000000000
$ git rev-list --reverse HEAD | head -n 1
-> 2a74500000000000000000000000000000000000
$ echo de53700000000000000000000000000000000000 2a74500000000000000000000000000000000000 > .git/info/grafts
$ git rebase tomergeTEMP
$ git svn dcommit --dry-run
$ git svn dcommit
To elaborate a bit:
a) clone the svn repository. empty one (with trunk/branches/tags created is perfect)
b) fetch the branch mybranch from a git repo
c) check out FETCH_HEAD
d) branch it to a temporary name
e) get back to master (master of the *new* repo that was cloned)
now the interesting part. with grafts you can merge history lines, it needs 2 commit sha-1 values.
f) get the first one
g) get the second one
h) put them into .git/info/grafts (format "X Y", value one, single space, value two)
i) do a rebase from the temporary branch
j) dry-run to check you have several diff-tree ... lines (one for each commit in the git repo)
k) really commit to svn if the last step looked reasonable. This will take a while, as it does one svn commit per git commit
update: just found a helpful thread on stackoverflow:
Create a file .git/info/grafts and put the two sha's on a single line there. The first is the first git commit, then a space, then the last svn commit. This tells git that the git commit is not parentless, but has in fact the last svn commit as parent.
Yes, it's the new hype - URL shorteners (mostly for use in Twitter).
Some use the classic tinyurl, then there's is.gd and bit.ly and a fair bunch of others.
As some people already wrote, and I feel no different here, broken links are baaad, mkay?
So the easiest way would be to get a short domain for yourself and run your own url shortener.
I am happy enough to have secured myself a not yet publicly announced 3-char .de domain which I'm planning to use for that. This and being bored for 2h led me to roll out my own shortening service.
Enter Shortcore - 259 lines of php code, working already.
It needs PHP 5.2.0+ (I think :P) and sqlite and I've put it up on github - it's BSD licenced and comments and patches are very much appreciated.
How to use it when it's installed:
Some use the classic tinyurl, then there's is.gd and bit.ly and a fair bunch of others.
As some people already wrote, and I feel no different here, broken links are baaad, mkay?
So the easiest way would be to get a short domain for yourself and run your own url shortener.
I am happy enough to have secured myself a not yet publicly announced 3-char .de domain which I'm planning to use for that. This and being bored for 2h led me to roll out my own shortening service.
Enter Shortcore - 259 lines of php code, working already.
It needs PHP 5.2.0+ (I think :P) and sqlite and I've put it up on github - it's BSD licenced and comments and patches are very much appreciated.
How to use it when it's installed:
- http://example.org/_[uniqueid] redirects to what you saved.
- http://example.org/_[uniqueid]_ shows a preview
- So I have "xxx.de/_ab" - as low as 10 chars for an url (excluding http://), that's not less than a bit.ly url (currently at 5+ chars after the /) and I can still put normal content (not starting with a "_") on the domain - fair deal I think
- there's a bookmarklet for easy saving, either provide the [uniqueid] or let it be generated automatically
- it's not meant as a public shortening service, so probably some basic auth has to be added
Auch wenn ich S9Y die Treue halte, auch andere Mütter haben schöne Töchter und so bin ich ja immer am rumsuchen nach "Konkurrenten".
Das wird dann installiert, getestet, Doku gelesen, Code angeschaut, Templates verglichen, wieder deinstalliert.
Was ich nicht schon alles angeschaut hab... Die "großen", also Wordpress und Textpattern sogar alle paar Versionen mal wieder, vor allem, wenn man sie auch als Mini-CMS missbrauchen kann (so wie Serendipity auch).
Interessante Entdeckungen der letzten Zeit:
Das wird dann installiert, getestet, Doku gelesen, Code angeschaut, Templates verglichen, wieder deinstalliert.
Was ich nicht schon alles angeschaut hab... Die "großen", also Wordpress und Textpattern sogar alle paar Versionen mal wieder, vor allem, wenn man sie auch als Mini-CMS missbrauchen kann (so wie Serendipity auch).
Interessante Entdeckungen der letzten Zeit:
- localblog - a python script which intends to provide the user a simple solution to maintain an online diary
- NanoBlogger - a small weblog engine written in Bash for the command line (via
- Web Content Viewer - tolle Idee, aber sehr krank umgesetzt - ziemlich overengineered, wie ich finde, aber trotzdem interessant. Und hat ein Blog-Modul.
- Fefes Blog, "Proudly made without PHP, Java, Perl, MySQL and Postgres" und "Blogsoftware in C gehackt". Inhalt ist König, aber gleich html, head und body weglassen? Wie das Ding genau arbeitet, würde mich trotzdem brennend interessieren.
- DokuWiki ist zwar toll, aber als Blog-Engine? Mhm, gefällt mir nicht so recht.
- gitology - ähnlich WCV, aber in python und git statt PHP und SVN
(Page 1 of 1, totaling 4 entries)
Layout by Ricky Wilson | Serendipity Template by Carl Galloway | Login
About
Life's a bitch, life's a whore. Nothing less, nothing more.
Read More
Der Autor...
... studiert Informatik. Und zwar an der LMU München. Das mittlerweile schon eine ganze Weile. Nebenher arbeitet er als PHP-Entwickler und Admin. Seit geraumer Zeit sogar regelmäßig und in Farbe
Quicksearch
last.fm
Song: Weather Experience (Top Buzz remix)
Artist: The Prodigy
14. June 2009, 19:23
Song: Charly (Trip Into Drum and Bass version)
Artist: The Prodigy
14. June 2009, 19:17
Song: Wind It Up (Rewound)
Artist: The Prodigy
14. June 2009, 19:11
10. March 2010, 23:33


