ipad developers: Please give me a decent solution for code editing with git integration
ipad developers: Please give me a decent solution for code editing with git integration
So maybe dropbox is just meant to sync across your development area and github is still where the version control takes place?
If someone can elaborate on why they like this dual model, please let me know if I'm on the right track... or if there is a git-only solution that works as well.
With a dev branch, you have the flexibility to just what you describe-- commit broken or half-completed code in order to move to another box-- and still clean up the commit or merge it with others before you move it to your "master" branch for deployment or sharing.
Try git add -p (or -i, I prefer -p though) and you will see (and incidentally, never ever use commit -a any more)
And to alter commits before merging, use rebase -i and make use of the edit and squash options.
You can also commit parts then stash the rest, test, pop the stash, commit more, stash, test, etc, etc. You can add things to commits with --amend, so you can tweak them if you notice something is missing after you added things with git add -p and then commited. I do this a lot when I want to split a commit and use git add -p.
If you really want to test things from somewhere else, use git new-workdir to create a new working dir based off your local clone. Whatever you stash or commit to one, the other will see, since they're really pointing to the same local git clone (if you look at the .git/ dir of a workdir, you'll notice it's all symlinks to the original clone). Just make sure every local workdir you create like this is on a different branch, otherwise it will get confused when you change things on one side (because, of course, they're all pointing to the same local clone, but suddenly the local files won't match). I use this to have a "test workdir", which is based on a clean and permanently updated branch, where I cherry-pick/merge from the work branch into it, build and test, without having to stash on my work branch, reconfigure things and otherwise stop the coding workflow.
git checkout -b tmp
git commit -a -m "throwaway"
git push wherever tmp
#switch machines
git checkout development
git fetch wherever
git merge wherever/tmp --no-ff
git reset HEAD^
git push wherever :tmp
and you could automate that with a pair of scripts.Then I push to our Gitorious (not trusting github with company internal code, so preferring a self-hosted solution) which we use as a sandbox and/or for code reviews and discussion.
Then, at home, I pull and continue working.
Once the topic branch is completed, I rebase -i to edit and or squash to finally clean out that temp commit. Once I,'m happy, I push to our main repository (which is hosted using gitosis and works quite like a central svn repository where the whole team has push access and where we deploy from)
This works for me because I'm totally comfortable with rebase -i, add -i, squash and amend now so I can get rid of that temp commit.
If I weren't (some people refuse to rebase even on their topic branches and want to work exactly like subversion), then the dtopbox solution would be compelling because of that ugly temporary commit that I can't get rid of without rebase.