Showing posts with label Git GitHub Course. Show all posts
Showing posts with label Git GitHub Course. Show all posts

Thursday, February 26, 2009

Chapter 25: Git and GitHub Course: Day 6

Summary of Day 6 Work Flow (pg.87-End)
  1. $ mkdir jasnow.github.com (p.88)
    $ cd jasnow.github.com
    $ git init
    Initialized empty Git repository in c:/Users/jasnow/gitlocalrepo/jasnow.github.com/.git/
    $ touch README
    $ git add README
    $ git commit -m 'first commit README'
    [master (root-commit)]: created b4c4b7d: "first commit README"
    0 files changed, 0 insertions(+), 0 deletions(-)
    create mode 100644 README
  2. $ git remote add origin git@github.com:jasnow/jasnow.github.com.git (p.88)
  3. $ git push origin master (p.88)
    Counting objects: 3, done.
    Writing objects: 100% (3/3), 215 bytes, done.
    Total 3 (delta 0), reused 0 (delta 0)
    To git@github.com:jasnow/jasnow.github.com.git
    * [new branch] master -> master
  4. $ git symbolic-ref HEAD refs/heads/gh-pages (p.89)
    $ rm .git/index
    $ git clean -fdx
    Removing README
    $ echo "My GitHub Page" > index.html
    $ git add .
    warning: LF will be replaced by CRLF in index.html
    $ git commit -a -m "First pages commit"
    [gh-pages (root-commit)]: created f6dfa2e: "First pages commit"
    warning: LF will be replaced by CRLF in index.html
    1 files changed, 1 insertions(+), 0 deletions(-)
    create mode 100644 index.html
    $ git push origin gh-pages
    Counting objects: 3, done.
    Writing objects: 100% (3/3), 232 bytes, done.
    Total 3 (delta 0), reused 0 (delta 0)
    To git@github.com:jasnow/jasnow.github.com.git
    * [new branch] gh-pages -> gh-pages
  5. FYI: http://citizen428.net/archives/361-RubyLearning-Git-and-GitHub-course-review.html

Chapter 24: Git and GitHub Course: Day 5 (day late)

  1. Summary of Day 5 Work Flow (pg.74-86):
  2. $ git log -2 (p.74)
    commit 01e92fc455898f45fb4eff9114f10922e2fca377
    Author: Al Snow
    Date: Tue Feb 24 19:54:44 2009 -0500
    modified display.rb
    commit 8306c2e07c44062315e907da4984147065012a5d
    Merge: 89c38f3... 18e0332...
    Author: Al Snow
    Date: Tue Feb 24 19:45:19 2009 -0500
    Merge branch 'master' of git@github.com:jasnow/gittest
  3. $ git tag display_commit 8306c2e07c44062315e907da4984147065012a5d (p.74) (no response)
  4. $ git tag (p.75)
    display_commit
  5. $ git push origin display_commit (p.75)
    Total 0 (delta 0), reused 0 (delta 0)
    To git@github.com:jasnow/gittest.git
    * [new tag] display_commit -> display_commit
  6. $ git push origin --tags (p.75)
    Everything up-to-date
  7. $ git push origin :display_commit (Deleting tag. - p.76)
    To git@github.com:jasnow/gittest.git
    - [deleted] display_commit
  8. Created a new repository, my_string_extend. (p.79-80)
  9. Clicked on "RubyGem" on GitHub for step 8's REPO.
  10. $ mkdir my_string_extend (p.80)
    $ cd my_string_extend
    $ mkdir lib
  11. $ mkdir test (p.81)
    $ mkdir doc
  12. Created gemspec based on one on page 82-83.
  13. $ git init (p.84)
    Initialized empty Git repository in c:/Users/jasnow/gitlocalrepo/my_string_exten
    d/.git/
  14. $ touch my* (p.84)
  15. $ git add . (p.84)
    warning: LF will be replaced by CRLF in lib/my_string_extend.rb
    warning: LF will be replaced by CRLF in my_string_extend.gemspec
  16. $ git commit -m 'commit of gem 0.0.4 version' (p.84)
    [master (root-commit)]: created cebbc71: "commit of gem 0.0.4 version"
    warning: LF will be replaced by CRLF in lib/my_string_extend.rb
    warning: LF will be replaced by CRLF in my_string_extend.gemspec
    2 files changed, 18 insertions(+), 0 deletions(-)
    create mode 100644 lib/my_string_extend.rb
    create mode 100644 my_string_extend.gemspec
  17. $ git remote add origin git@github.com:jasnow/my_string_extend.git (p.84)
  18. $ git push origin master (p.84)
    Counting objects: 5, done.
    Compressing objects: 100% (4/4), done.
    Writing objects: 100% (5/5), 643 bytes, done.
    Total 5 (delta 0), reused 0 (delta 0)
    To git@github.com:jasnow/my_string_extend.git
    * [new branch] master -> master
  19. Wait "up to 15 minutes" - Check inbox for status (failed or success). (p.85)
  20. Found the "small red diamond" but not email in inbox. (p.85)
  21. $ gem sources -a http://gems.github.com (Added - p.86)
    http://gems.github.com added to sources
    $ gem sources --list
    *** CURRENT SOURCES ***
    http://gems.rubyforge.org/
    http://gems.github.com
  22. Later repeated some of the steps and got this email:
    github sent you a message.
    --------------------
    Subject: [my_string_extend] Gem Build Successful
    Your gem has been built, it will be added to gems.github.com soon.
  23. FINALLY: $ gem install jasnow-my_string_extend (p.86)
    Successfully installed jasnow-my_string_extend-0.0.3
    1 gem installed
  24. $ ruby program86.rb
    16

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)

Monday, February 23, 2009

Chapter 20: Git and GitHub Course: Day 3

Summary of Day 3 Work Flow (pg.38-58):
  1. If you want a copy of a repo, then use "git clone".
  2. CLONE DOWN: git clone git://github.com/IndianGuru/advgame.git (p.40)
  3. Initialized empty Git repository in c:/Users/jasnow/gitlocalrepo/advgame/.git/
    remote: Counting objects: 12, done.←[K
    remote: Compressing objects: 100% (12/12), done.←[K
    remote: Total 12 (delta 2), reused 0 (delta 0)←[K
    Receiving objects: 100% (12/12), 10.37 KiB, done.
    Resolving deltas: 100% (2/2), done.
  4. cd advgame ; git log (p.40-41)
  5. GITK : cd ../mygittest ; gitk --all (p.41-42)
  6. Log into GitHub. (p.43)
  7. Fork another person's repository so you can have my own copy on GitHub. (p.43) -- Done
  8. cd .. ; git clone git@github.com:jasnow/ruby_learning_participants.git (p.44)
  9. Initialized empty Git repository in c:/Users/jasnow/gitlocalrepo/ruby_learning_p
    articipants/.git/
    remote: Counting objects: 73, done.←[K
    remote: Compressing objects: 100% (73/73), done.←[K
    remote: Total 73 (delta 34), reused 0 (delta 0)←[KKiB/s
    Receiving objects: 100% (73/73), 409.90 KiB | 236 KiB/s, done.
    Resolving deltas: 100% (34/34), done.
  10. cd ruby_learning_participants ; git remote show origin (p.44)
  11. * remote origin
    URL: git@github.com:jasnow/ruby_learning_participants.git
    Remote branch merged with 'git pull' while on branch master
    master
    Tracked remote branch
    master
  12. Edited the file using non-GNU emacs using Cygwin in separate window.
  13. $ git add README.txt (p.45)
    warning: LF will be replaced by CRLF in README.txt
  14. $ git commit -m 'added my name in README.txt' (p.45)
    [master]: created warning: LF will be replaced by CRLF in README.txt
    3e466e1: "added my name in README.txt"
    1 files changed, 1 insertions(+), 0 deletions(-)
  15. PUSH UP: $ git push origin master (p.45)
    Counting objects: 5, done.
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 372 bytes, done.
    Total 3 (delta 1), reused 0 (delta 0)
    To git@github.com:jasnow/ruby_learning_participants.git
    ab8044d..3e466e1 master -> master
  16. Note the last 3 steps are "A/C/P".
  17. Do "Pull Request" on GitHub. (p.45-47)
  18. cd ruby_learning_participants ; git remote add ashbbrlp (p.48) git@github.com:jasnow/ruby_learning_participants.git
  19. Suggest that you rename this remote to "a_snapshot" (more descriptive).
  20. $ git remote show ashbbrlp
    * remote ashbbrlp
    URL: git@github.com:jasnow/ruby_learning_participants.git
    New remote branch (next fetch will store in remotes/ashbbrlp)
    master
  21. FETCH DOWN: $ git fetch ashbbrlp (p.48)
    From git@github.com:jasnow/ruby_learning_participants
    * [new branch] master -> ashbbrlp/master
  22. PULL DOWN: $ git pull ashbbrlp master (p.49)
    From git@github.com:jasnow/ruby_learning_participants
    * branch master -> FETCH_HEAD
    Already up-to-date.
  23. Exercise 3: A/C/P (p.49-51)
  24. $ git add fork.rb (p.50)
    warning: LF will be replaced by CRLF in fork.rb
  25. $ git commit -m 'adding fork.rb file' (p.50)
    [master]: created 22b8b69: "adding fork.rb file"
    warning: LF will be replaced by CRLF in fork.rb
    1 files changed, 1 insertions(+), 0 deletions(-)
    create mode 100644 fork.rb
  26. PUSH UP: $ git push origin master (p.50)
    Counting objects: 4, done.
    Compressing objects: 100% (2/2), done.
    Writing objects: 100% (3/3), 284 bytes, done.
    Total 3 (delta 1), reused 0 (delta 0)
    To git@github.com:jasnow/mygittest.git
    2eca6e8..22b8b69 master -> master
  27. Suggest moving last two lines on page 50 dealing with what is inside fork.rb to page 49 (before the other instructions).
  28. MERGING:
  29. Now for RLGGHC's gittest repo. (p.51)
  30. $ cd .. ; git clone git@github.com:jasnow/gittest.git
    Initialized empty Git repository in c:/Users/jasnow/gitlocalrepo/gittest/.git/
    remote: Counting objects: 19, done.←[K
    remote: Compressing objects: 100% (15/15), done.←[K
    remote: Total 19 (delta 5), reused 0 (delta 0)←[K
    Receiving objects: 100% (19/19), done.
    Resolving deltas: 100% (5/5), done.
  31. Edited fork.rb. (p.51)
  32. git add fork.rb (p.51)
  33. $ git commit -m 'Added my name line to fork.rb' (p.51)
    [master]: created a9c310c: "Added my name line to fork.rb"
    1 files changed, 1 insertions(+), 0 deletions(-)
  34. $ git push origin master (p.51)
    Counting objects: 5, done.
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 312 bytes, done.
    Total 3 (delta 2), reused 0 (delta 0)
    To git@github.com:jasnow/gittest.git
    15dcc6f..a9c310c master -> master
  35. Used "pull request" on GitHub web site to inform project owner of change.
  36. CONFUSED so stopped and read/scanned to page 58 and then from page 1 to 58. Draw a diagram of different git commands. Found better one on internet.
  37. Okay, I'm back on page 52. I got a real "pull request" from jastix so I'm going to use it.
  38. Did page 52 steps and then clicked on "new line" as in page 53.
  39. $ git remote add jastix git://github.com/jastix/mygittest.git
    fatal: remote jastix already exists.
  40. Assumed step 39 is okay (did it a couple of hours ago) so continued.
  41. $ git remote show jastix
    ERROR: Permission to jastix/mygittest denied to jasnow.
    fatal: The remote end hung up unexpectedly
  42. Unclear what I did wrong in step 41.
  43. $ git fetch jastix
    ERROR: Permission to jastix/mygittest denied to jasnow.
    fatal: The remote end hung up unexpectedly
  44. Tried "git log" too and still got problems so I'm stopping here.
  45. Try Exercise 4 so I forked porky's porkygittest repository.
  46. $ git clone git@github.com:jasnow/porkygittest.git
    Initialized empty Git repository in c:/Users/jasnow/porkygittest/.git/
    remote: Counting objects: 4, done.←[K
    remote: Compressing objects: 100% (2/2), done.←[K
    remote: Total 4 (delta 0), reused 0 (delta 0)←[K
    Receiving objects: 100% (4/4), 268 bytes, done.
  47. Moved the directory under gitlocalrepo.
  48. $ git remote show origin
    * remote origin
    URL: git@github.com:jasnow/porkygittest.git
    Remote branch merged with 'git pull' while on branch master
    master
    Tracked remote branch
    master
  49. Added a line to porkgittest's README file.
  50. Then "git add README"
  51. $ git commit -m 'Added my name line to README'
    [master]: created warning: LF will be replaced by CRLF in README
    7399885: "Added my name line to README"
    1 files changed, 1 insertions(+), 0 deletions(-)
  52. $ git push origin master
    Counting objects: 5, done.
    Compressing objects: 100% (2/2), done.
    Writing objects: 100% (3/3), 307 bytes, done.
    Total 3 (delta 0), reused 0 (delta 0)
    To git@github.com:jasnow/porkygittest.git
    f94d166..7399885 master -> master
  53. Sent Porky a "Pull Request" from the GitHub web site.
  54. EX#4: Fork/Clone/Edit/Add/Commit/Push/Request Pull
  55. Repeated steps 45-54 with RLGGHC's gittest repository.
  56. Sent RLGGHC and ashbb a Pull Request.
  57. Got a Pull Request from Porky, so I tried: $ git remote add porky git://github.com/porky/gittest.git and got not response.
  58. So I did: $ git remote show porky
    fatal: protocol error: expected sha/ref, got '
    *********'
    No matching repositories found.
    *********'
  59. So I ran "git remote rm jastix" and "git remote rm kevintyll". Then "git remote show" and it shows only "origin".
  60. Stopping this post and move to the next one.





Sunday, February 22, 2009

Chapter 17: Git and GitHub Course: Day 2

Pages 29-38
  • Cygwin Specific: Need to fix .bash_profile and .bashrc. (Later fixed them I think)
  • Also get my non-GNU emacs to work inside GitBash window.
  • Suggestion: Exercise 1 could be moved to page 28 (before "Normal workflow").
  • REMEMBER to use the same repository on page 29+ as page 25.
  • Page 34
  • >>> $ git remote show origin
  • >>> * remote origin
  • >>> URL: git@github.com:jasnow/mygittest.git
  • >>> Tracked remote branch
  • >>> master
  • Page 36
  • >>> $ git push origin master
  • >>> Counting objects: 3, done.
  • >>> Compressing objects: 100% (2/2), done.
  • >>> Writing objects: 100% (3/3), 239 bytes, done.
  • >>> Total 3 (delta 0), reused 0 (delta 0)
  • >>> To git@github.com:jasnow/mygittest.git
  • >>> * [new branch] master -> master
  • Page 37: Note the the Admin link in inside the "edit" button. Had a hard time finding it.
  • Page 38: Exercise 1: Went on to the GitHub website and searched for merb-book and find it: http://github.com/mattetti/merb-book/tree/master
  • Page 38: Exercise 2: After roughly 5 tries, I successfully created and pushed my first repository : http://github.com/jasnow/mygittest/tree/master