Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was not aware of the `git config` option for wrapping long files, worth the price of admission just for that for me.

Edit: there's a `git diff` tip in there, but this comes up a few times so if anyone needs to do patches from git for svn repos do `git patch --prefix=none $DIFF1 $DIFF2 > some.patch` share and apply with `patch -p0 < some.patch`.



Rather than setting git's pager to less with options, just export the "LESS" environment variable with options you want less to use everywhere.


I don't see that Git has a "patch" command, but svn does -- is that what you meant here? Where you have "git patch", did you maybe mean:

    git diff --no-prefix $OLD $NEW
...where $OLD and $NEW are the two commits you want to diff.


Yeah, my bad!


Or just:

  git diff REV1 REV2 >some.patch
  patch -p1 <some.patch


I found when I was doing that it would occasionally cause problems with applying in svn properly, but YMMV. I've seen some really over the top solutions to it as well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: