What is the best way to use Git with a remote testing environment?
-
We've been using Dreamweaver to see remote websites and edit/upload over FTP, as well as using its built in file lock/unlock to manage the code for a development team of 2-3. I'm sick of Dreamweaver and am in the process of switching to Sublime Text. But since we lose the check-in/out mechanism, I've been trying to wrap my mind around how to convert our workflow to Git. We've needed version control for a long time anyway, and I believe branching and merging will be better than the unreliable check-in/out system. I'm having some trouble visualizing the exact set up though. The biggest issue is that we can't test the web-app locally. I won't get into specifics, but we can't duplicate our Linux server set up on our Windows machines. None of that can change. We need to get the files on our development server to actually test them. The easier that is, the better. Right now I've got us set up like this: I've converted our website folder to a bare repository, and did a git clone twice - making two folders named app-<name of programmer>. We've got the server set up to route testing URLs to the right place so everything works like it does in production. We still use SFTP to edit the files in our "branch" and then git commands over SSH to do pulling and pushing and syncing. I would like to move to a workflow similar to this: But I've run into a few problems trying to do this. I can git clone app-dev1 to my computer just fine, but when I do a git push I get error messages saying I can't push to a non-bare repository because it will mess up the tracking. I also tried to git clone the bare repository to my local machine and then set up app-dev1 as a remote, but I run into the same problem when I try to git push to that remote. I even tried doing the dangerous stuff the error message suggests and set receive.denyCurrentBranch to false. It allows the push but the working directory does not seem to be updated in place, and when I run git status on that remote repo, it tells me there is an uncommitted file (even then I committed that on my local machine before the push, and when I do git log I see the commit). Is there a way to get this to work? Or should I scrap the development server repositories and only have branches on our local machines that git push/pull from origin/master and then use SFTP to just stick the files in our test folders on the dev server? Keep in mind This won't cause the normal problems when pushing to a checked out branch. The app-dev1 "branches" will NEVER be directly edited once this is all in place. They will just be mirrors of our local repositories so that we can test them on our development server.
-
Answer:
Congratulations, you have committed to a very important workflow improvement. Start simple. Initially, get both of you working from a single master branch; you and your colleague will pull each other's changes and push when convenient. If you work on larger, independent features, you may later decide to create local "feature branches." But having separate remote branches for each developer seems like a big complication you don't need while you are starting out.
Toby Thain at Quora Visit the source
Related Q & A:
- What is the best way to distribute an audio/video feed from a computer to TVs over existing indoor coax cable?Best solution by Audio-Video Production
- What is the best way to calculate a date difference?Best solution by Stack Overflow
- What's the best way to get a job in a restaurant?Best solution by Yahoo! Answers
- What's the best way to make a good impression at a job interview?Best solution by Yahoo! Answers
- What is the best way to negotiate a salary for a new position?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.