Jose David Restrepo
Jose David Restrepo

Reputation: 31

Merging unversioned files with GIT

I'm working on a project and a co-worker modified some files that I modified too, the problem is that I was versioning using GIT and he was not, so the files modified by this person were never commited to the project repository, he just sent them by email.

Is there a way to merge these files using a GIT merge tool?

Upvotes: 0

Views: 525

Answers (2)

Greg Burghardt
Greg Burghardt

Reputation: 18783

  1. Create a new branch locally on your machine from a commit before you made changes to the same files
  2. Copy the other person's files into your working directory
  3. Commit the changes to the new branch
  4. Merge the two branches like normal

Upvotes: 3

sehe
sehe

Reputation: 393064

There is nothing to merge if only one side ever had the files. Just add them to the branch of your choice

 git add file1 file2 file3

and commit

 git commit -m 'merged the missing files'

Upvotes: 0

Related Questions