I have cloned a git repo into /tmp on my server. I then proceeded to copy the contents of the git repo to /var/my-site without actually copying the .git file itself. This was several weeks back. I have made several changes to the /var/my-site directory without worrying about the .git folder not being moved when I made the initial install to /var/my-site.
Weeks later, the remote git repo has been updated with new features that I would like to take advantage of without losing weeks of my work. Is there any way that I can update the source code of /var/my-site without having to meticulously edit each file with the new features, drag and drop, cut and paste, etc. and still maintain my previous work?
Will just moving the .git folder from /tmp to /var/my-site work, or is this not as easy as I’m thinking?
At that point, the
my-sitedirectory becomes a git repository and you will be able to:git pullto merge with the remote.git stash), run pull and then apply your changes back (git stash poporgit stash applyto keep the stash)