Pete Dermott
Pete Dermott

Reputation: 21

Trying to get git changes from a cloned source?

I have recently outsourced some work to a developer who worked on a clients website using a "staging" FTP site and I am looking to get the changes he has made back into the cloned bitbucket repo it was built on.

Is it possible to get the changes back from the cloned source?

Upvotes: 1

Views: 25

Answers (1)

Robin Green
Robin Green

Reputation: 33083

Obviously, if the developer was using git and committed their changes, it is just a matter of using git pull or git push or git send-email (that last one may need to be installed separately).

But I'm guessing he was not. (Check, though!)

If that developer is the only one who has changed the project, and your working directory is clean, you can copy the changes to a local temp directory and then use rsync with the appropriate command line options to make the git working directory be the same as what he had (this will correctly handle file deletes, renames and moves), then commit.

If you also made changes in git or in the working tree, you may need to do a three-way merge. The best way to do that is probably to create a new branch for their changes based on the original commit that they started working on, then bring his changes into the new branch using the method in the previous paragraph, then merge the two branches.

Upvotes: 1

Related Questions