How to best use Git with PhpED? |
Guru master
|
This is probably one of those areas where opinions will vary and I'm certainly not a Git expert.
I think mapping with Samba is correct; it should be more efficient for the web server file access and I have a gut feeling it is probably more secure & manageable. Personally I use SmartGitHg on Windows, which has some nice features. It provides a very useful UI to the underlying Git tools. Git can manage the repository using the normal file system, so if you have direct local or network access to the files, you don't require a Git server or anything special, just the Git tools. That was one of the design concepts of Git; for personal repositories a special Git server is not required. You would use the Git tools from wherever is most convenient. If you are primarily using Windows for development (despite the files maybe being on Linux) then using Git from Windows seems to make sense. There are some notes in these forums about integrating the base Git tools with PhpED, using scripts and shell commands. For me, I just run SmartGit off to one side and I'm very happy with that. Typical work scenario for me: * Check project status using SmartGitHg to see I haven't committed any changed files to the repository, or ignored files that I do not want to commit. * Do my edits testing, etc. optionally committing at intervals if I feel I've reached a particularly goal. These regular commits allow me to review issues if I break anything. * Final commit at the end to my personal repository. * If in a shared project situation then also consider committing back to the central repository and obtaining other peoples latest commits (push/pull/merge). |
||||||||||||
|
|
Thanks plugnplay,
I have received many answers to this question on various forums (sorry, tried to post links, but this forum doesn't allow to prevent spam), and everyone is different. I even submitted a ticket to NuSphere (see below). I don't think this solution makes sense as I believe Tortoise Git requires Git on Windows. Agree?
I have had multiple responses not to use a shared Samba folder at all as "Git was not designed to work that way" and that "I should have separate local repositories on the PC and development server" on , but shared Samba folders sure makes PhpED's file uploads easy and I would like to use them. I am sure SmartGitHg works well, and I have heard good things about SourceTree. The drawback as I see it is that I need to do my work on PhpED, then go to the 3rd party client to check for changes, then stage them, etc, instead of staging them from within the PhpED environment. I could also run Git on the Linux box instead, however, then I will need to do similarly and even worse first SSH onto it before doing so. While the PhpED's response is correct that my questions are not specifically PhpED related, I feel it is an important enough topic a recommended example in the documentation or a whitepaper or something. Any other advice or suggestions would be very appreciated. |
||||||||||||||
|
Guru master
|
For my own work environment, whilst I use a Samba share to access the Linux server, I'm the only person accessing it. So there are no issues with multiple people (a team) accessing that same Git repository and that is maybe what people are referring to; I believe the whole concept of these Git repositories are that they are effectively private and not shared, before committing to a central truly shared repository.
I also have both Windows Server 2003 (older projects) and 2012 (newer projects) as development/staging servers, both accessed in a similar way from PhpED. My PhpED computer does not have any project files stored on it; there is nothing for me to commit on the PhpED computer. I use SmartGit from the PhpED computer to manage the Git repository that is stored on the shared drive, plus it can also push commits to a remote repository. It sounds like you are referring to a private Git repository only accessed by you but on a shared drive? I'm not sure why that would be considered a problem, unless people assume you are referring to a shared repository, because you said it is on a shared drive. It is true that file access over a shared drive from PhpED & SmartGit is slower than local storage, but local storage does not work for me and I certainly haven't found performance bad. The Samba share seems faster than a Windows share, plus the Linux Apache is a lot faster than running Apache from Windows, so my clients get a much faster web site response time when they are reviewing the site. I allow some of my clients to directly access the development servers and see progress. |
||||||||||||
|
|
Thanks pluginplay,
Do you have Git running on the Linux server, the Windows PC, or both? I currently have it running on both, and I haven't had any big problems yet, but see some differences when running commands on the two platforms (Windows sometimes shows a file being modified twice). I am thinking having it running on both is not a good idea. My reason is Git on both machines will be looking for changes in the directory and attempting to update the hidden Git directory and associated database. Does this make any sense? So if it has to be one or the other, which machine? To you TortoiseGit, I believe I need to run it on the Windows PC. The problem with this is my Linux server needs Git to run GitLab, and I don't know how to tell configure Git on one machine not to track a given directory, but to still do so on the other machine. Any thoughts? Thank you |
||||||||||||
|
Guru master
|
I just run SmartGitHg on Windows; nothing on Linux. My own Git requirements are relatively simple; for management of my own personal developments.
Probably the private .Git repository directory within the project should only be accessed by a single Git tool at any time. With the Git server on Linux, you might have to run Git just on Linux. Others would have to confirm this, but would a normal Git scenario be something like: * You have your development project and your private Git repository; only you access that Git repository, not the server. That might also be an accessible development server to allow full testing. It is not staging, because you will potentially have test data. * When you are happy with your developments you push them to the central repository, which is the one the Git server manages. That repository probably would not be used for running a staging/development service as it needs to remain more 'pure'. * The staging server would pull from the central repository. So you have two separate Git repositories and file bases? |
||||||||||||
|
How to best use Git with PhpED? |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by