Git: generate and apply patch from commit


git format-patch -n commit-id

$ git format-patch -1 HEAD
$ git format-patch -2 86c5960


git am < patch



/sbin/ip route add … RTNETLINK answers: File exists

When starting opevpn I encountered strange issue. VPN was connecting but I could not access services behind it.
What I found in its log was:

Thu Oct 16 12:15:50 2014 /sbin/ip route add via
RTNETLINK answers: File exists

It turned out the newly added route was conflicting with other route (a leftover from messing up vpn-things).

First, I removed the conflicting rule:

sudo route del -net netmask

Then I manually added the route the vpn was trying to add (but I think it’s optional and simply restarting the VPN would do the thing)

/sbin/ip route add via