Some more success
May. 1st, 2011 01:16 pmManaged to get everything into a git repository on my laptop.
Then push that to github.
Then retrieve the files from github onto my desktop.
Then fix the readme on the desktop, push that back to github, and pull the changes down onto my laptop.
So I can now edit files on either machine, and move them back and forth via github.
Next up, I guess, is working out how to make a branch so that I can do temp stuff back and forth without breaking the head...
Then push that to github.
Then retrieve the files from github onto my desktop.
Then fix the readme on the desktop, push that back to github, and pull the changes down onto my laptop.
So I can now edit files on either machine, and move them back and forth via github.
Next up, I guess, is working out how to make a branch so that I can do temp stuff back and forth without breaking the head...
no subject
Date: 2011-05-01 06:08 pm (UTC)no subject
Date: 2011-05-01 06:10 pm (UTC)I'd rather like to be using a tool that supports atomic commits :->
no subject
Date: 2011-05-01 03:07 pm (UTC)git co -b branchname
all commits now are on that branch.
no subject
Date: 2011-05-01 05:53 pm (UTC)no subject
Date: 2011-05-01 06:22 pm (UTC)I'm doing a session on git workflow at the Drupal camp that's coming up...
no subject
Date: 2011-05-01 06:35 pm (UTC)no subject
Date: 2011-05-01 07:08 pm (UTC)$ git push origin branchname
assuming your remote is called 'origin', which it probably is. Do:
$ git remote -v
to list remotes with info about them.
When you're happy with the work on your branch, you have several ways to incorporate it to the master branch.
If you want all the commits from the dev branch to exist on the master, as if you'd been working on master all along, do:
$ git co master
$ git merge dev
If on the other hand, your commits are full of cruft (like mine are) and you just want a clean single commit that holds the entirety of the branch, do:
$ git co master
$ git merge --squash dev
You then need to make a commit -- this has the same effect as applying a patch. Which you can do too:
$ git co dev
$ git diff master
gets you a patch of dev, relative to master (ie, apply it to master to get what you have on dev).
Where git gets awesome is this: suppose that in the meantime, you made some bugfixes on master. You can rewrite history so the dev branch branches off master *after* those commits, like this:
$ git co dev
$ git rebase master
That moves the base of dev to the tip of master -- so it begins after your bugfix commits.
Though a word of warning -- if you're pushing dev to github, that might cause all sorts of problems; best read up on it. For local branches, it's fantastic though.
no subject
Date: 2011-05-01 07:16 pm (UTC)This was all easier with SVN - probably because the choices were more limited :->
no subject
Date: 2011-05-01 07:22 pm (UTC)no subject
Date: 2011-05-01 06:22 pm (UTC)