git diff two commits 1

git diff two commits

-> git diff 0da94be  59ff30c > my.patch
-> git apply my.patch

Here is what the above code is Doing:
1. We’re creating a new branch called “my-branch”
2. We’re checking out that branch
3. We’re making a change to the file “my-file.txt”
4. We’re committing that change
5. We’re checking out the master branch
6. We’re making a change to the file “my-file.txt”
7. We’re committing that change
8. We’re creating a patch file that contains the difference between the two branches
9. We’re applying the patch file to the master branch

Similar Posts