Dex Sebas
Dex Sebas

Reputation: 247

Git merge and diff

I have a question about the use of git.

Actually I have two branch in my repository (feature-2, feature-certification). Now I've received a source code from another user and I need to compare his files with my branch (feature-certification). Those files are not under git or remote branch, it's just a folder with files.

What I tried: I created a new branch and added all the files that I've received then I pushed to the new branch but when I tried to merge into feature-certification I noticed that ALL files are treated like new even when they're not new

Is there any way to check the diff between my branch and the files of the other folder that I have?

Upvotes: 1

Views: 153

Answers (1)

VonC
VonC

Reputation: 1329262

In my working directory just copy and paste the new files?

Yes, as long as your working directory is clean, meaning all your current files are added and committed.

Then you can copy/overwrite your files with the new ones: a git status/git diff will show you the differences.

At any point, you can get back to your original state with git reset --hard.


A less intrusive option would be:

 cd /path/to/my/repo
 git --work-tree=/path/to/receives/files/folder diff

That would show you the difference between the common files and your current index.

Upvotes: 2

Related Questions