Tuesday, February 24, 2009

Chapter 21: Git and GitHub Course: Day 3 (continued)

Summary of Day 3 Work Flow (pg.51-58):
  1. Had problems with understanding page 51-58, so I went back and tried it again.
  2. Summarized the commands on the pages: Originally on pages 54-58, the commands are:
    git remote add ashbb git://github.com/ashbb/gittest.git
    git remote show asbhh
    git fetch ashbb
    git log ashbb/master
    git merge ashbb/master
    get add fork.rb
    git commit -m 'fork.rb commit with ashbb changes'
    git push origin master
    So to do it for porky, I would just
    change "ashbb" to "porky" and
    change "gittest" to "mygittest".
  3. git remote add porky git://github.com/porky/mygittest.git (pg.54) (no response)
  4. $ git remote show -n porky (p.54) (Had to add "-n" before I got good response)
    * remote porky
    URL: git://github.com/porky/mygittest.git
  5. Removed all my local repositories. Ran "git init" and cloned my "mygittest" repo.
  6. $ git remote add jastix git://github.com/jastix/mygittest.git (no response
  7. $ git remote show jastix (p.54)
    * remote jastix
    URL: git://github.com/jastix/mygittest.git
    New remote branch (next fetch will store in remotes/jastix)
    master
  8. $ git fetch jastix (p.55)
    remote: Counting objects: 5, done.←[K
    remote: Compressing objects: 100% (2/2), done.←[K
    remote: Total 3 (delta 0), reused 0 (delta 0)←[K
    Unpacking objects: 100% (3/3), done.
    From git://github.com/jastix/mygittest
    * [new branch] master -> jastix/master
  9. $ git log jastix/master (p.55)
    commit 46a48026e4b05f579105a442a048d9df74be2ea7
    Author: Nickolai
    Date: Mon Feb 23 15:17:51 2009 +0300
    new line
    commit 2eca6e8195ee9a9043b300e0625fd09100ef6008
    Author: Al Snow
    Date: Sun Feb 22 12:54:57 2009 -0500
    First commit
  10. $ git merge jastix/master (p.55-56)
    Merge made by recursive.
    README | 1 +
    1 files changed, 1 insertions(+), 0 deletions(-)
    create mode 100644 README~
  11. No Merge Conflict -- WOW.
  12. "git add ." (no response) (p.54)
  13. $ git commit -m 'merged with jastix - he added line in README' (p.55)
    # On branch master
    # Your branch is ahead of 'origin/master' by 2 commits.
    #
    nothing to commit (working directory clean)
  14. git remote add kevintyll git://github.com/kevintyll/mygittest.git (p.54)
  15. $ git remote show kevintyll (p.54)
    * remote kevintyll
    URL: git://github.com/kevintyll/mygittest.git
    New remote branch (next fetch will store in remotes/kevintyll)
    master
  16. $ git fetch kevintyll (p.55)
    remote: Counting objects: 5, done.←[K
    remote: Compressing objects: 100% (2/2), done.←[K
    remote: Total 3 (delta 1), reused 0 (delta 0)←[K
    Unpacking objects: 100% (3/3), done.
    From git://github.com/kevintyll/mygittest
    * [new branch] master -> kevintyll/master
  17. $ git log kevintyll/master (p.55)
    commit 8fbc15ac76e72646760f9d7e65a7affae372c31f
    Author: Kevin Tyll
    Date: Mon Feb 23 23:38:01 2009 -0500
    modified README
    commit 22b8b693c1935696e2acee48a4185a49ac39227d
    Author: Al Snow
    Date: Mon Feb 23 12:35:38 2009 -0500
    adding fork.rb file
    commit 2eca6e8195ee9a9043b300e0625fd09100ef6008
    Author: Al Snow
    Date: Sun Feb 22 12:54:57 2009 -0500
    First commit
  18. $ git merge kevintyll/master (p.55=56)
    Auto-merging README
    CONFLICT (content): Merge conflict in README
    Automatic merge failed; fix conflicts and then commit the result.
  19. Edited the file and kept 2 lines.
  20. $ git merge kevintyll/master (p.55-56)
    fatal: You are in the middle of a conflicted merge.
  21. Step 20 was a mistake (smile) so back to page 56.
  22. $ git add . (p.56)
    warning: LF will be replaced by CRLF in h
  23. $ git commit -m 'fix merge conflict with kevintyll changes' (p.56)
    [master]: created f29253a: "fix merge conflict with kevintyll changes"
  24. Suggestion: Add (page feed) after each section/exercise for clean break.
  25. OPEN QUESTION: How to "git push" merged repository?
  26. Got this with verbose: $ git push origin master -v
    Pushing to git://github.com/jasnow/mygittest.git
    Looking up github.com ... done.
    Connecting to github.com (port 9418) ... 65.74.177.129 done.
    fatal: read error (Invalid argument)

  27. OPEN QUESTION: Why could I merge jastix and kevintyll but not porky?
  28. OPEN: THEREFORE I need more study time with this topic.
  29. See page 39 about the difference between the "public clone url" and "the clone url". The public one is READ-ONLY. See example on page 44.
  30. More details: "He made the mistake to copy the public clone URL to clipboard and not his own URL. So he forked the original master. And as long as you are not added to the list of collaborators from the project's owner, you are not allowed to push directly to his REPO.
    When you fork, the project's owner can decide whether to apply your changes or not. So he is in control, if you are actually not yet a trustworthy collaborator."

  31. BUT TIME TO MOVE ON (3:48pm)

No comments:

Post a Comment