0

I've made a mistake by not using git from the start of my project. I've downloaded an OS project, made some customizations, and now I would like to:

1) compare the original branch/project to mine to see the files I changed and updated 2) update my project with the files from original source that I did not change

I have no idea how to do this.

3 Answers 3

1

You can re-download the original project and initialize it as a git repo (git init). Make sure to commit the project (git commit). Then copy/paste all your changes into that same directory. Running git diff at that point should show you everything you changed.

2
  • I've git cloned repo in to a new folder, run git commit, then copied over the files in cloned directory with files from my directory, and run git diff... and I can't see the list of changed files. Apr 24, 2014 at 20:55
  • If you're doing the git clone, you don't need to do the first two steps I listed. Just copy paste your changes (basically the entire working tree) into the repo you just cloned. git diff should tell you everything that's different.
    – jnevelson
    Apr 24, 2014 at 22:10
0

If you: 1. git checkout the original branch somewhere 2. copy your modified to that working copy

then you can diff...

It might be better practice to branch the original checkout, copy to that branch, commit, then you can just keep developing on the new branch. This enables future flexibility with merging to upstream...

0
0

It's worth nothing that, if you are not already a contributor to the repository, you will probably have to submit a pull request. If git is giving you problems, you can: $ diff dir1 dir2.

Otherwise, just git clone the original repository, cp the entire contents of the edited directory to the original repository, and run git diff (or git status, after you've committed) in there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.