I'm a web developer currently using FTP to deploy my code and trying to move to git to help speed things up.
My current projects look like:
- webapp1_live
webapp1_dev
webapp2_live
- webapp2_dev
Both live and dev files are stored locally (complete source) because:
- I need the remote server to test my code (I have an auto upload to FTP when saving local files in Sublime Text)
- I use a diff tool to figure out which files I have modified on the dev and copy them to the live directory (manually) and then I have to manually FTP those on the live server
I would like to use git to keep track of my changes BUT also to quickly copy my changes from the dev to the live directory (I'll figure out later how to FTP those to my remote server - I've read something about hooks and such... that's a different story, I don't want to get into that now)
I have tried Sublime Merge to do what I want and I set up the dev and live as local repositories but when I try to push my changes from the dev to live, I get this error:
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: is denied, because it will make the index and work tree inconsistent
remote: with what you pushed, and will require 'git reset --hard' to match
remote: the work tree to HEAD.
I have read about the bare repository but as I understand, that doesn't have a working directory so that means it doesn't have a copy of the files?!