I have an untracked file with some changes. Its called file1.
I want to apply those changes to my tracked file in git, called file2.
Is there a way using git that I can get the patch and apply it to my tracked file , file2?
I have an untracked file with some changes. Its called file1.
I want to apply those changes to my tracked file in git, called file2.
Is there a way using git that I can get the patch and apply it to my tracked file , file2?
By definition, if your files are untracked, Git does not know about their history. You can use git diff
to get the difference between two files, and git apply
to apply a patch, but this all makes sense only once you have two states (before changes, after changes).