Posted 3 months ago. Visible to the public.

Git: Apply a diff

git apply allows you to apply a diff onto your HEAD. Most often you can achieve the same result with a rebase & merge.


master commit1 - commit3 feature-branch \ commit2 - commit4
git checkout feature-branch git reset --hard commit3 git diff ..commit4 | git apply
master commit1 - commit3 feature-branch \ Unstaged commit 2 & 4

You can also create a patch and apply it afterwards.

Once an application no longer requires constant development, it needs periodic maintenance for stable and secure operation. makandra offers monthly maintenance contracts that let you focus on your business while we make sure the lights stay on.

Owner of this card:

Emanuel De
Last edit:
2 months ago
by Emanuel De
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Emanuel De to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more