Reputation: 3254
I have a project in a repository.
A programmer (not Me) changed the deployed code on the server directly instead of editing the Git controlled repository (a lot of changes have been made).
So now the repository has an old version of code.
What should I do in this case?
Should I create a new empty branch, copy the code from server there and then make this branch master
like it's described here?
Or something else?
Upvotes: 0
Views: 275
Reputation: 15364
I think the first priority is to get that code into git. I would treat the code that's in production as new development work.
git checkout -b prod-edits origin/master
git add -A
git commit -m "Production edits"
git push origin prod-edits
cp -r /path/to/code /path/to/current
cd /path/to/current
git reset --hard && git pull
rm -fr /path/to/code && ln -s /path/to/current /path/to/code
Upvotes: 1