Help me use git the way it was intended.
July 8, 2012 12:59 PM Subscribe
I'm finally using git. Right now I'm using it stupidly: I pull from the main branch, make changes, push the changes, and then deploy. I'd like to be smarter with this process, and in particular, I'd like to be able to have (1) a process that can handle changes in priority easily and that (2) includes a clear separation between code that still needs to be tested vs. code ready to go live.
posted by jsturgill to Computers & Internet (12 answers total) 25 users marked this as a favorite
For example, several times now I've been working on a feature and then had an unrelated bug that needed fixing. Right now that requires me to do a stupid dance with my commits and deployment that isn't really optimal or sane.
My understanding is that really, to do this right, I should be creating a new branch, work on the feature, and then merge when it's done. If something crops up that needs to be addressed on the main branch, I can go ahead and fix it there, ignoring the feature branch. Then any conflicts are dealt with during the merge process.
I also believe that I should be running a testing branch for all changes, and then syncing everything to the live branch once it's good to go. Right now I just deploy the main branch to a dev server, make sure everything is OK/approved, and then deploy the same (only) branch to the live site.
I'm primarily using tortoisegit on windows, but I am not averse to command-lining it up. Actual development takes place in Linux VMs, so linux-only advice/processes are totally fine. Caveat: If I'm going to be comparing diffs and selectively choosing which portions to keep and which to discard during the merge process, it does seem that a GUI with highlighting and whatnot would make this much simpler and clearer than on the commandline. So that might be worth keeping in mind, unless I'm wrong wrong wrong.
I'd like to go slowly with this: do one small thing a better way for a few commits/features, get comfortable with it, and then add more complexity at that point rather than trying to adjust to a drastically different process all in one go. I want to keep my productivity high during the entirety of this switch to betterness.
Which new processes need to be added to my workflow? What order should I start making these changes in? Tutorials advice etc? Sections of the manual that I should RTF out of?