Changes between Version 17 and Version 18 of GitForDarcsUsers


Ignore:
Timestamp:
Aug 14, 2008 12:03:25 PM (7 years ago)
Author:
malcolm.wallace@…
Comment:

contrast git workflow with darcs workflow

Legend:

Unmodified
Added
Removed
Modified
  • GitForDarcsUsers

    v17 v18  
    1414}}}
    1515
     16= Git Overview =
    1617For an overview of what repositories (or parts of repositories) are modified by various git commands:
    1718    http://osteele.com/images/2008/git-transport.png
     
    100101== darcs pull ==
    101102
    102 There is a direct mapping for {{{darcs pull -a}}}, but not for the interactive {{{darcs pull}}}.  Cherry-picking is not as streamlined as in Darcs.  For a start, here is how you update from the source repo:
     103There is no direct mapping for the interactive {{{darcs pull}}}.  Cherry-picking is not as streamlined as in Darcs.
     104
     105=== darcs pull -a ===
     106Here is how you update (everything) from the source repo:
    103107{{{
    104108git pull
     
    110114where {{{origin}}} is the name of your default remote branch.  (You can name it as you like, but certain Git commands will use {{{origin}}} as the default if no argument is specified.)
    111115
    112 XXX: will this pull into the current branch, or always into master?
     116XXX: will this pull into the current branch, or always into master?  (Websites suggest always into master, so you likely need to follow {{{git pull}}} with {{{git rebase <branch-name>}}})
    113117
    114118Like in Darcs, you may get conflicts.  To resolve conflicts, edit the conflicting file, {{{git add}}} it, and {{{git commit}}} it.
     
    118122== darcs push ==
    119123
    120 Selectively pushing patches is not available directly in Git.  A comparable workflow is to merge a local branch into the master branch and then {{{git push}}}, which does the same as {{{darcs push -a}}}.
     124Selectively pushing patches is not available directly in Git.  {{{git push}}} does the same as {{{darcs push -a}}}.
     125
     126A comparable interactive workflow is to merge a selection of patches from a local branch into the local master branch and then {{{git push}}} that.
    121127
    122128In general, even though a central repository is possible, Git promotes a pull model.  That is, to work on a project you typically "fork" ({{{git clone}}}) the source repository, add your changes, publish ''your'' repository, and send a pull-request to the upstream maintainer.  The reasoning behind that is that you don't have something akin to a list of committers, but rather the maintainer has a set of trusted peers.  This model is very different than what seems to be common among darcs users, but it has its advantages.
     
    231237
    232238== darcs amend-record ==
     239
     240It is not easy to amend any patch except the last one committed.
    233241
    234242If the change to be amended is the latest commit
     
    307315git branch -d fix_foo # delete the branch we no longer need
    308316}}}
     317Yes, it is a bit more complicated than using darcs to do the same thing:
     318{{{
     319darcs pull <upstream>  # get latest changes
     320# ... hack ...
     321darcs record           # select the proper changes
     322# ... test ... oops, forgot something
     323darcs amend-record     # add the new patches
     324# ... test ... looks fine now
     325darcs pull             # make sure it's up to date
     326# ... if we get a conflict here, edit the file then
     327# ... darcs amend-record
     328darcs push             # push changes  <upstream>
     329}}}