Hi Community
I am facing a issue because of my own bad approach for deployment . But I want to overcome from this problem. Problem is
I uploaded my local rails application on digital ocean ( 1 click installation ubuntu 14 + unicorn + nginx ) and any how i deployed it and it is now running . But during deployment I did various changes in code to make the application run .
But during this period , we carry on development on my local machine and maintained it into github . Now i have to merge the recent local code ( which is in git ) into production server .
Is there any straight forward way .
Thanks in Advanced
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Is the copy of the code on the server also in Git or was it just uploaded via SFTP? I’m guessing it isn’t. There’s not a great way to go about this if that is the case, but it’s still possible to get the changes made on the server side into your git history.
The first step is to initialize a git repository in your remote copy:
Then add your branch on GitHub as a remote branch:
This should leave you in a state where your git repository reflects what is on GitHub with your local change on the server as unstagged changes. You can then clean everything up, commit your changes, and push it back to GitHub:
This great answer on StackOverflow helps explains what’s going on when you run
git reset
: