Advertisement
Guest User

Untitled

a guest
Jun 26th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.08 KB | None | 0 0
  1. ➜ ~>mkdir gittest
  2. ➜ ~>cd gittest
  3. ➜ gittest>git init
  4. Initialized empty Git repository in /home/andres/gittest/.git/
  5. ➜ gittest git:(master)>nano file.txt
  6. ➜ gittest git:(master) ✗>ls
  7. file.txt
  8. ➜ gittest git:(master) ✗>nano code.py
  9. ➜ gittest git:(master) ✗>ls
  10. code.py file.txt
  11. ➜ gittest git:(master) ✗>git status
  12. On branch master
  13.  
  14. Initial commit
  15.  
  16. Untracked files:
  17. (use "git add <file>..." to include in what will be committed)
  18.  
  19. code.py
  20. file.txt
  21.  
  22. nothing added to commit but untracked files present (use "git add" to track)
  23. ➜ gittest git:(master) ✗>git add file.txt code.py
  24. ➜ gittest git:(master) ✗>git status
  25. On branch master
  26.  
  27. Initial commit
  28.  
  29. Changes to be committed:
  30. (use "git rm --cached <file>..." to unstage)
  31.  
  32. new file: code.py
  33. new file: file.txt
  34.  
  35. ➜ gittest git:(master) ✗>
  36. git commit -m "Added two simple files"
  37. [master (root-commit) ddd1e9e] Added two simple files
  38. 2 files changed, 6 insertions(+)
  39. create mode 100644 code.py
  40. create mode 100644 file.txt
  41. ➜ gittest git:(master)>ls
  42. code.py file.txt
  43. ➜ gittest git:(master)>git status
  44. On branch master
  45. nothing to commit, working directory clean
  46. ➜ gittest git:(master)>git log
  47. commit ddd1e9e91b047448ccf4e62ff2a891d1d7133cf7
  48. Author: Andres Cabrera <mantaraya36@gmail.com>
  49. Date: Tue May 26 10:29:22 2015 -0700
  50.  
  51. Added two simple files
  52. ➜ gittest git:(master)>nano code.py
  53. ➜ gittest git:(master) ✗>git status
  54. On branch master
  55. Changes not staged for commit:
  56. (use "git add <file>..." to update what will be committed)
  57. (use "git checkout -- <file>..." to discard changes in working directory)
  58.  
  59. modified: code.py
  60.  
  61. no changes added to commit (use "git add" and/or "git commit -a")
  62. ➜ gittest git:(master) ✗>git add code.py
  63. ➜ gittest git:(master) ✗>git status
  64. On branch master
  65. Changes to be committed:
  66. (use "git reset HEAD <file>..." to unstage)
  67.  
  68. modified: code.py
  69.  
  70. ➜ gittest git:(master) ✗>
  71. git commit -m "Code now asks for and prints user's name"
  72. [master 5d21265] Code now asks for and prints user's name
  73. 1 file changed, 2 insertions(+), 1 deletion(-)
  74. ➜ gittest git:(master)>git status
  75. On branch master
  76. nothing to commit, working directory clean
  77. ➜ gittest git:(master)>git log
  78. commit 5d212659635fea6fecaa85928d8b255202572901
  79. Author: Andres Cabrera <mantaraya36@gmail.com>
  80. Date: Tue May 26 10:33:39 2015 -0700
  81.  
  82. Code now asks for and prints user's name
  83.  
  84. commit ddd1e9e91b047448ccf4e62ff2a891d1d7133cf7
  85. Author: Andres Cabrera <mantaraya36@gmail.com>
  86. Date: Tue May 26 10:29:22 2015 -0700
  87.  
  88. Added two simple files
  89. ➜ gittest git:(master)>nano code.py
  90. ➜ gittest git:(master) ✗>git status
  91. On branch master
  92. Changes not staged for commit:
  93. (use "git add <file>..." to update what will be committed)
  94. (use "git checkout -- <file>..." to discard changes in working directory)
  95.  
  96. modified: code.py
  97.  
  98. no changes added to commit (use "git add" and/or "git commit -a")
  99. ➜ gittest git:(master) ✗>git reset --hard HEAD
  100. HEAD is now at 5d21265 Code now asks for and prints user's name
  101. ➜ gittest git:(master)>git status
  102. On branch master
  103. nothing to commit, working directory clean
  104. ➜ gittest git:(master)>cat code.py
  105. name = raw_input("What's your name? ")
  106. print "Hello " + name
  107. ➜ gittest git:(master)>gitk
  108. ⏎ ➜ gittest git:(master)> git gui
  109. ➜ gittest git:(master)>nano code.py
  110. ➜ gittest git:(master) ✗>git gui
  111. ➜ gittest git:(master)>gitk
  112. ➜ gittest git:(master)>git branch second_person
  113. ➜ gittest git:(master)>git status
  114. On branch master
  115. nothing to commit, working directory clean
  116. ➜ gittest git:(master)>gitk
  117. ➜ gittest git:(master)>git checkout second_person
  118. Switched to branch 'second_person'
  119. ➜ gittest git:(second_person)>gitk
  120. ➜ gittest git:(second_person)>nano code.py
  121. ➜ gittest git:(second_person) ✗>git gui
  122. ➜ gittest git:(second_person)>gitk
  123. ➜ gittest git:(second_person)>git checkout master
  124. Switched to branch 'master'
  125. ➜ gittest git:(master)>nano
  126. code.py file.txt
  127. ➜ gittest git:(master)>nano file.txt
  128. ➜ gittest git:(master) ✗>git gui
  129. ➜ gittest git:(master)>gitk
  130. ➜ gittest git:(master)>man gitk
  131. ➜ gittest git:(master)>gitk -all
  132. ➜ gittest git:(master)>gitk --all
  133. ➜ gittest git:(master)>git checkout second_person
  134. Switched to branch 'second_person'
  135. ➜ gittest git:(second_person)>cd
  136. ➜ ~>cd gittest/
  137. ➜ gittest git:(second_person)>git merge master
  138. Merge made by the 'recursive' strategy.
  139. file.txt | 2 ++
  140. 1 file changed, 2 insertions(+)
  141. ➜ gittest git:(second_person)>gitk
  142. ➜ gittest git:(second_person)>nano file.txt
  143. ➜ gittest git:(second_person) ✗>git gui
  144. ➜ gittest git:(second_person)>gitk
  145. ➜ gittest git:(second_person)>git master
  146. git: 'master' is not a git command. See 'git --help'.
  147. ➜ gittest git:(second_person)>git checkout master
  148. Switched to branch 'master'
  149. ➜ gittest git:(master)>git merge second_person
  150. Updating 5a3a51c..5be6d7f
  151. Fast-forward
  152. code.py | 3 +++
  153. file.txt | 2 +-
  154. 2 files changed, 4 insertions(+), 1 deletion(-)
  155. ➜ gittest git:(master)>gitk
  156. ➜ gittest git:(master)>git branch -d second_person
  157. Deleted branch second_person (was 5be6d7f).
  158. ➜ gittest git:(master)>gitk
  159. ➜ gittest git:(master)>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement