Guest User

Untitled

a guest
May 28th, 2018
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.36 KB | None | 0 0
  1. C:\git> ls
  2. C:\git> git init
  3. Initialized empty Git repository in C:/git/.git/
  4. C:\git [master]> echo "hello" | git hash-object --stdin
  5. ef0493b275aa2080237f676d2ef6559246f56636
  6. C:\git [master]> echo "hello" | git hash-object --stdin -w
  7. ef0493b275aa2080237f676d2ef6559246f56636
  8. C:\git [master]> git cat-file ef0493b275aa2080237f676d2ef6559246f56636 -p
  9. hello
  10. C:\git [master]> git cat-file ef0493b275aa2080237f676d2ef6559246f56636 -t
  11. blob
  12. C:\git [master]> git add .
  13. C:\git [master +1 ~0 -0 ~]> git commit -m "hello wofld"
  14. [master (root-commit) 48c8e49] hello wofld
  15. 1 file changed, 1 insertion(+)
  16. create mode 100644 hi.txt
  17. C:\git [master]> git cat-file 48c8e49 -p
  18. tree 605953bb9d6bed60e6fb1d578cc98cbc64ea8294
  19. author Casey Allen <casey.allen@readify.net> 1527136127 +0800
  20. committer Casey Allen <casey.allen@readify.net> 1527136127 +0800
  21.  
  22. hello wofld
  23. C:\git [master]> git cat-file -p 605953bb9d6bed60e6fb1d578cc98cbc64ea8294
  24. 100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad hi.txt
  25. C:\git [master]> git add .
  26. C:\git [master +1 ~0 -0 ~]> git commit -m "hi 1"
  27. [master 4fdeea7] hi 1
  28. 1 file changed, 1 insertion(+)
  29. create mode 100644 hi.1.txt
  30. C:\git [master]> git add .
  31. C:\git [master +1 ~0 -0 ~]> git commit -m "foo"
  32. [master d7ba688] foo
  33. 1 file changed, 1 insertion(+)
  34. create mode 100644 foo/foo.txt
  35. C:\git [master]> git cat-file -p d7ba688
  36. tree 63e1863f16382c5a18e7a6f29f304d92923deff5
  37. parent 4fdeea75c35ec13a971d204e653e73aa059d5b37
  38. author Casey Allen <casey.allen@readify.net> 1527136365 +0800
  39. committer Casey Allen <casey.allen@readify.net> 1527136365 +0800
  40.  
  41. foo
  42. C:\git [master]> git add .
  43. C:\git [master +0 ~1 -0 ~]> git commit -m "dfd"
  44. [master 64935fc] dfd
  45. 1 file changed, 1 insertion(+)
  46. C:\git [master]> git co 4fde
  47. Note: checking out '4fde'.
  48.  
  49. You are in 'detached HEAD' state. You can look around, make experimental
  50. changes and commit them, and you can discard any commits you make in this
  51. state without impacting any branches by performing another checkout.
  52.  
  53. If you want to create a new branch to retain commits you create, you may
  54. do so (now or later) by using -b with the checkout command again. Example:
  55.  
  56. git checkout -b <new-branch-name>
  57.  
  58. HEAD is now at 4fdeea7... hi 1
  59. C:\git [(4fdeea7...)]> git add .
  60. C:\git [(4fdeea7...) +0 ~1 -0 ~]> git commit -m "hi dfd"
  61. [detached HEAD d881a7a] hi dfd
  62. 1 file changed, 1 insertion(+)
  63. C:\git [(d881a7a...)]> git merge master
  64. Merge made by the 'recursive' strategy.
  65. foo/foo.txt | 2 ++
  66. 1 file changed, 2 insertions(+)
  67. create mode 100644 foo/foo.txt
  68. C:\git [(17010aa...)]> git cat-file -p 17010
  69. tree 1ab7c0dc45519f72b756f9b059018e0c243b8355
  70. parent d881a7a4149aed31baae0444fc2fcb4781ad5e4b
  71. parent 64935fce45df36a3677c8b4ca76e711a57737ed6
  72. author Casey Allen <casey.allen@readify.net> 1527136717 +0800
  73. committer Casey Allen <casey.allen@readify.net> 1527136717 +0800
  74.  
  75. Merge branch 'master' into HEAD
  76. C:\git [(17010aa...)]> git add .
  77. C:\git [(17010aa...) +0 ~1 -0 ~]> git commit -m "detached"
  78. [detached HEAD e2cd55d] detached
  79. 1 file changed, 1 insertion(+), 1 deletion(-)
  80. C:\git [(e2cd55d...)]> git co master
  81. Warning: you are leaving 3 commits behind, not connected to
  82. any of your branches:
  83.  
  84. e2cd55d detached
  85. 17010aa Merge branch 'master' into HEAD
  86. d881a7a hi dfd
  87.  
  88. If you want to keep them by creating a new branch, this may be a good time
  89. to do so with:
  90.  
  91. git branch <new-branch-name> e2cd55d
  92.  
  93. Switched to branch 'master'
  94. C:\git [master]> git add .
  95. C:\git [master +0 ~1 -0 ~]> git commit -m "on master"
  96. [master 7f6ab8c] on master
  97. 1 file changed, 1 insertion(+)
  98. C:\git [master]> git merge e2cd
  99. Auto-merging hi.txt
  100. CONFLICT (content): Merge conflict in hi.txt
  101. Automatic merge failed; fix conflicts and then commit the result.
  102. C:\git [master +0 ~0 -0 !1 | +0 ~0 -0 !1 !]> git st
  103. On branch master
  104. You have unmerged paths.
  105. (fix conflicts and run "git commit")
  106. (use "git merge --abort" to abort the merge)
  107.  
  108. Unmerged paths:
  109. (use "git add <file>..." to mark resolution)
  110.  
  111. both modified: hi.txt
  112.  
  113. no changes added to commit (use "git add" and/or "git commit -a")
  114. C:\git [master +0 ~0 -0 !1 | +0 ~0 -0 !1 !]> git add .
  115. C:\git [master +0 ~1 -0 ~]> git commit -m "merge commit"
  116. [master 7b419b4] merge commit
  117. C:\git [master]> git co -b feature
  118. Switched to a new branch 'feature'
  119. C:\git [feature]> git co master
  120. Switched to branch 'master'
  121. C:\git [master]> git co feature
  122. Switched to branch 'feature'
  123. C:\git [feature]> git add.
  124. git: 'add.' is not a git command. See 'git --help'.
  125.  
  126. The most similar command is
  127. add
  128. C:\git [feature +1 ~0 -0 !]> git add .
  129. C:\git [feature +1 ~0 -0 ~]> git commit -m "feature1"
  130. [feature 21b4181] feature1
  131. 1 file changed, 1 insertion(+)
  132. create mode 100644 foo/feature/file1
  133. C:\git [feature]> git add .
  134. C:\git [feature +0 ~1 -0 ~]> git commit -m "feature2"
  135. [feature a3bbbfd] feature2
  136. 1 file changed, 1 insertion(+)
  137. C:\git [feature]> git co master
  138. Switched to branch 'master'
  139. C:\git [master]> git add .
  140. C:\git [master +0 ~1 -0 ~]> git commit -m "master 23343"
  141. [master faaaae8] master 23343
  142. 1 file changed, 1 insertion(+)
  143. C:\git [master]> git co feature
  144. Switched to branch 'feature'
  145. C:\git [feature]> git rebase master -i
  146. Successfully rebased and updated refs/heads/feature.
  147. C:\git [feature]> git co a3bbb
  148. Note: checking out 'a3bbb'.
  149.  
  150. You are in 'detached HEAD' state. You can look around, make experimental
  151. changes and commit them, and you can discard any commits you make in this
  152. state without impacting any branches by performing another checkout.
  153.  
  154. If you want to create a new branch to retain commits you create, you may
  155. do so (now or later) by using -b with the checkout command again. Example:
  156.  
  157. git checkout -b <new-branch-name>
  158.  
  159. HEAD is now at a3bbbfd... feature2
  160. C:\git [(a3bbbfd...)]> git branch remember
  161. C:\git [(a3bbbfd...)]> git co master
  162. Previous HEAD position was a3bbbfd... feature2
  163. Switched to branch 'master'
  164. C:\git [master]> git reflog
  165. faaaae8 (HEAD -> master) HEAD@{0}: checkout: moving from a3bbbfd960ea0ead9f4f689612d80a4360b55921 to master
  166. a3bbbfd (remember) HEAD@{1}: checkout: moving from feature to a3bbb
  167. 1297fca (feature) HEAD@{2}: rebase -i (finish): returning to refs/heads/feature1297fca (feature) HEAD@{3}: rebase -i (pick): feature2
  168. f194ac7 HEAD@{4}: rebase -i (pick): feature1
  169. faaaae8 (HEAD -> master) HEAD@{5}: rebase -i (start): checkout master
  170. a3bbbfd (remember) HEAD@{6}: checkout: moving from master to feature
  171. faaaae8 (HEAD -> master) HEAD@{7}: commit: master 23343
  172. 7b419b4 HEAD@{8}: checkout: moving from feature to master
  173. a3bbbfd (remember) HEAD@{9}: commit: feature2
  174. 21b4181 HEAD@{10}: commit: feature1
  175. 7b419b4 HEAD@{11}: checkout: moving from master to feature
  176. 7b419b4 HEAD@{12}: checkout: moving from feature to master
  177. 7b419b4 HEAD@{13}: checkout: moving from master to feature
  178. 7b419b4 HEAD@{14}: commit (merge): merge commit
  179. 7f6ab8c HEAD@{15}: commit: on master
  180. 64935fc HEAD@{16}: checkout: moving from e2cd55d6b9241edbbcab5fa895b193199f9980f2 to master
  181. e2cd55d HEAD@{17}: commit: detached17010aa HEAD@{18}: merge master: Merge made by the 'recursive' strategy.
  182. C:\git [master]>
  183. C:\git [master]> git config -e --global
  184. C:\git [master]> git co remember
  185. Switched to branch 'remember'
  186. C:\git [remember]> git behind master
  187. 1
  188. C:\git [remember]> git lg
  189. * a3bbbfd <Casey Allen> - (HEAD -> remember) feature2 (16 minutes ago)
  190. * 21b4181 <Casey Allen> - feature1 (17 minutes ago)
  191. * 7b419b4 <Casey Allen> - merge commit (21 minutes ago)
  192. |\
  193. | * e2cd55d <Casey Allen> - detached (23 minutes ago)
  194. | * 17010aa <Casey Allen> - Merge branch 'master' into HEAD (26 minutes ago)o)
  195. | |\
  196. | * | d881a7a <Casey Allen> - hi dfd (26 minutes ago)
  197. * | | 7f6ab8c <Casey Allen> - on master (22 minutes ago)
  198. | |/
  199. |/|
  200. * | 64935fc <Casey Allen> - dfd (28 minutes ago)
  201. * | d7ba688 <Casey Allen> - foo (32 minutes ago)
  202. |/
  203. * 4fdeea7 <Casey Allen> - hi 1 (33 minutes ago)
  204. * 48c8e49 <Casey Allen> - hello wofld (35 minutes ago)
  205. C:\git [remember]> git add .
  206. C:\git [remember +0 ~1 -0 ~]> git stash push
  207. Saved working directory and index state WIP on remember: a3bbbfd feature2
  208. C:\git [remember]> git status
  209. On branch remember
  210. nothing to commit, working tree clean
  211. C:\git [remember]> git stash pop
  212. On branch remember
  213. Changes not staged for commit:
  214. (use "git add <file>..." to update what will be committed)
  215. (use "git checkout -- <file>..." to discard changes in working directory)
  216.  
  217. modified: hi.txt
  218.  
  219. no changes added to commit (use "git add" and/or "git commit -a")
  220. C:\git [remember +0 ~1 -0 !]> git cat-file -p 80e9
  221. tree fcd41781597e44f2f33af61a8572eac89ab2ca47
  222. parent a3bbbfd960ea0ead9f4f689612d80a4360b55921
  223. author Casey Allen <casey.allen@readify.net> 1527138285 +0800
  224. committer Casey Allen <casey.allen@readify.net> 1527138285 +0800
  225.  
  226. index on remember: a3bbbfd feature2
  227. C:\git [remember +0 ~1 -0 !]> git cat-file -p dd07
  228. tree fcd41781597e44f2f33af61a8572eac89ab2ca47
  229. parent a3bbbfd960ea0ead9f4f689612d80a4360b55921
  230. parent 80e96b8f66a648e494293d37d52f3c10a02d6f1f
  231. author Casey Allen <casey.allen@readify.net> 1527138285 +0800
  232. committer Casey Allen <casey.allen@readify.net> 1527138285 +0800
  233.  
  234. WIP on remember: a3bbbfd feature2
  235. C:\git [remember +0 ~1 -0 !]> git stash list
  236. C:\git [remember +0 ~1 -0 !]> git add .
  237. C:\git [remember +0 ~1 -0 ~]> git stash save "stash_1"
  238. Saved working directory and index state On remember: stash_1
  239. C:\git [remember]> git cat-file -p ef4c
  240. tree fcd41781597e44f2f33af61a8572eac89ab2ca47
  241. parent a3bbbfd960ea0ead9f4f689612d80a4360b55921
  242. parent 5fb2029ba5ce474ffb7b19065a6781902d5d7f67
  243. author Casey Allen <casey.allen@readify.net> 1527138427 +0800
  244. committer Casey Allen <casey.allen@readify.net> 1527138427 +0800
  245.  
  246. On remember: stash_1
Add Comment
Please, Sign In to add comment