Advertisement
Guest User

Untitled

a guest
Dec 5th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.78 KB | None | 0 0
  1. $ git init Test
  2. Initialized empty Git repository in /home/weronika/Pulpit/Test/.git/
  3.  
  4. $ cd Test
  5.  
  6. $ git status
  7. On branch master
  8.  
  9. No commits yet
  10.  
  11. nothing to commit (create/copy files and use "git add" to track)
  12.  
  13. $ git add hello.c
  14.  
  15. $ git commit -m "dodanie pliku hello.c do mastera"
  16. [master (root-commit) 7b3dbc1] dodanie pliku hello.c do mastera
  17. 1 file changed, 7 insertions(+)
  18. create mode 100644 hello.c
  19.  
  20. $ git checkout -b nowyBranch
  21. Switched to a new branch 'nowyBranch'
  22.  
  23. $ git add integer.c
  24.  
  25. $ git commit -m "dodanie pliku integer.c do nowyBranch"
  26. [nowyBranch ec83dc2] dodanie pliku integer.c do nowyBranch
  27. 1 file changed, 13 insertions(+)
  28. create mode 100644 integer.c
  29.  
  30. $ git log --all --graph --decorate
  31. * commit ec83dc201e70d33cf5952c1c060e032307e4a663 (HEAD -> nowyBranch)
  32. | Author: 236733 <236733@student.pwr.edu.pl>
  33. | Date: Fri Nov 30 00:35:27 2018 +0100
  34. |
  35. | dodanie pliku integer.c do nowyBranch
  36. |
  37. * commit 7b3dbc1b57d2f9f1b1cb5abef10cb61001f23e73 (master)
  38. Author: 236733 <236733@student.pwr.edu.pl>
  39. Date: Fri Nov 30 00:34:15 2018 +0100
  40.  
  41. dodanie pliku hello.c do mastera
  42.  
  43. $ git checkout master
  44. Switched to branch 'master'
  45.  
  46. $ git checkout -b testowyBranch
  47. Switched to a new branch 'testowyBranch'
  48.  
  49. $ git add ten.c
  50.  
  51. $ git commit -m "dodanie pliku ten.c do testowyBranch"
  52. [testowyBranch d0d1e82] dodanie pliku ten.c do testowyBranch
  53. 1 file changed, 14 insertions(+)
  54. create mode 100644 ten.c
  55.  
  56. $ git checkout master
  57. Switched to branch 'master'
  58.  
  59. $ git log --all --graph --decorate
  60. * commit d0d1e82bea18dda9499bf751dc92a7a886bfab0c (testowyBranch)
  61. | Author: 236733 <236733@student.pwr.edu.pl>
  62. | Date: Fri Nov 30 00:37:49 2018 +0100
  63. |
  64. | dodanie pliku ten.c do testowyBranch
  65. |
  66. | * commit ec83dc201e70d33cf5952c1c060e032307e4a663 (nowyBranch)
  67. |/ Author: 236733 <236733@student.pwr.edu.pl>
  68. | Date: Fri Nov 30 00:35:27 2018 +0100
  69. |
  70. | dodanie pliku integer.c do nowyBranch
  71. |
  72. * commit 7b3dbc1b57d2f9f1b1cb5abef10cb61001f23e73 (HEAD -> master)
  73. Author: 236733 <236733@student.pwr.edu.pl>
  74. Date: Fri Nov 30 00:34:15 2018 +0100
  75.  
  76. dodanie pliku hello.c do mastera
  77.  
  78. $ git checkout -b branchDoTestowSkryptu
  79. Switched to a new branch 'branchDoTestowSkryptu'
  80.  
  81. $ git add year.c
  82.  
  83. $ git commit -m "dodanie pliku yer.c do branchDoTestowSkryptu"
  84. [branchDoTestowSkryptu f4d95af] dodanie pliku yer.c do branchDoTestowSkryptu
  85. 1 file changed, 27 insertions(+)
  86. create mode 100644 year.c
  87.  
  88. $ git log --all --graph --decorate
  89. * commit f4d95af47bbc928e4cc3a149109ed38a12fec273 (HEAD -> branchDoTestowSkryptu)
  90. | Author: 236733 <236733@student.pwr.edu.pl>
  91. | Date: Fri Nov 30 00:40:35 2018 +0100
  92. |
  93. | dodanie pliku yer.c do branchDoTestowSkryptu
  94. |
  95. | * commit d0d1e82bea18dda9499bf751dc92a7a886bfab0c (testowyBranch)
  96. |/ Author: 236733 <236733@student.pwr.edu.pl>
  97. | Date: Fri Nov 30 00:37:49 2018 +0100
  98. |
  99. | dodanie pliku ten.c do testowyBranch
  100. |
  101. | * commit ec83dc201e70d33cf5952c1c060e032307e4a663 (nowyBranch)
  102. |/ Author: 236733 <236733@student.pwr.edu.pl>
  103. | Date: Fri Nov 30 00:35:27 2018 +0100
  104. |
  105. | dodanie pliku integer.c do nowyBranch
  106. |
  107. * commit 7b3dbc1b57d2f9f1b1cb5abef10cb61001f23e73 (master)
  108. Author: 236733 <236733@student.pwr.edu.pl>
  109. Date: Fri Nov 30 00:34:15 2018 +0100
  110.  
  111. dodanie pliku hello.c do mastera
  112.  
  113. $ git checkout master
  114. Switched to branch 'master'
  115.  
  116. $ git branch -D nowyBranch
  117. Deleted branch nowyBranch (was ec83dc2).
  118.  
  119. $ git branch -D branchDoTestowSkryptu
  120. Deleted branch branchDoTestowSkryptu (was f4d95af).
  121.  
  122. $ git log --all --graph --decorate
  123. * commit d0d1e82bea18dda9499bf751dc92a7a886bfab0c (testowyBranch)
  124. | Author: 236733 <236733@student.pwr.edu.pl>
  125. | Date: Fri Nov 30 00:37:49 2018 +0100
  126. |
  127. | dodanie pliku ten.c do testowyBranch
  128. |
  129. * commit 7b3dbc1b57d2f9f1b1cb5abef10cb61001f23e73 (HEAD -> master)
  130. Author: 236733 <236733@student.pwr.edu.pl>
  131. Date: Fri Nov 30 00:34:15 2018 +0100
  132.  
  133. dodanie pliku hello.c do mastera
  134.  
  135. $ git reflog
  136. 7b3dbc1 (HEAD -> master) HEAD@{0}: checkout: moving from master to master
  137. 7b3dbc1 (HEAD -> master) HEAD@{1}: checkout: moving from branchDoTestowSkryptu to master
  138. f4d95af HEAD@{2}: commit: dodanie pliku yer.c do branchDoTestowSkryptu
  139. 7b3dbc1 (HEAD -> master) HEAD@{3}: checkout: moving from master to branchDoTestowSkryptu
  140. 7b3dbc1 (HEAD -> master) HEAD@{4}: checkout: moving from testowyBranch to master
  141. d0d1e82 (testowyBranch) HEAD@{5}: commit: dodanie pliku ten.c do testowyBranch
  142. 7b3dbc1 (HEAD -> master) HEAD@{6}: checkout: moving from master to testowyBranch
  143. 7b3dbc1 (HEAD -> master) HEAD@{7}: checkout: moving from nowyBranch to master
  144. ec83dc2 HEAD@{8}: commit: dodanie pliku integer.c do nowyBranch
  145. 7b3dbc1 (HEAD -> master) HEAD@{9}: checkout: moving from master to nowyBranch
  146. 7b3dbc1 (HEAD -> master) HEAD@{10}: commit (initial): dodanie pliku hello.c do mastera
  147.  
  148. $ bash skrypt.sh
  149. Already on 'master'
  150. Note: checking out 'ec83dc2'.
  151.  
  152. You are in 'detached HEAD' state. You can look around, make experimental
  153. changes and commit them, and you can discard any commits you make in this
  154. state without impacting any branches by performing another checkout.
  155.  
  156. If you want to create a new branch to retain commits you create, you may
  157. do so (now or later) by using -b with the checkout command again. Example:
  158.  
  159. git checkout -b <new-branch-name>
  160.  
  161. HEAD is now at ec83dc2 dodanie pliku integer.c do nowyBranch
  162. Switched to a new branch 'branchec83dc2'
  163. Switched to branch 'master'
  164. * commit d0d1e82bea18dda9499bf751dc92a7a886bfab0c (testowyBranch)
  165. | Author: 236733 <236733@student.pwr.edu.pl>
  166. | Date: Fri Nov 30 00:37:49 2018 +0100
  167. |
  168. | dodanie pliku ten.c do testowyBranch
  169. |
  170. | * commit ec83dc201e70d33cf5952c1c060e032307e4a663 (branchec83dc2)
  171. |/ Author: 236733 <236733@student.pwr.edu.pl>
  172. | Date: Fri Nov 30 00:35:27 2018 +0100
  173. |
  174. | dodanie pliku integer.c do nowyBranch
  175. |
  176. * commit 7b3dbc1b57d2f9f1b1cb5abef10cb61001f23e73 (HEAD -> master)
  177. Author: 236733 <236733@student.pwr.edu.pl>
  178. Date: Fri Nov 30 00:34:15 2018 +0100
  179.  
  180. dodanie pliku hello.c do mastera
  181. Note: checking out 'f4d95af'.
  182.  
  183. You are in 'detached HEAD' state. You can look around, make experimental
  184. changes and commit them, and you can discard any commits you make in this
  185. state without impacting any branches by performing another checkout.
  186.  
  187. If you want to create a new branch to retain commits you create, you may
  188. do so (now or later) by using -b with the checkout command again. Example:
  189.  
  190. git checkout -b <new-branch-name>
  191.  
  192. HEAD is now at f4d95af dodanie pliku yer.c do branchDoTestowSkryptu
  193. Switched to a new branch 'branchf4d95af'
  194. Switched to branch 'master'
  195. * commit f4d95af47bbc928e4cc3a149109ed38a12fec273 (branchf4d95af)
  196. | Author: 236733 <236733@student.pwr.edu.pl>
  197. | Date: Fri Nov 30 00:40:35 2018 +0100
  198. |
  199. | dodanie pliku yer.c do branchDoTestowSkryptu
  200. |
  201. | * commit d0d1e82bea18dda9499bf751dc92a7a886bfab0c (testowyBranch)
  202. |/ Author: 236733 <236733@student.pwr.edu.pl>
  203. | Date: Fri Nov 30 00:37:49 2018 +0100
  204. |
  205. | dodanie pliku ten.c do testowyBranch
  206. |
  207. | * commit ec83dc201e70d33cf5952c1c060e032307e4a663 (branchec83dc2)
  208. |/ Author: 236733 <236733@student.pwr.edu.pl>
  209. | Date: Fri Nov 30 00:35:27 2018 +0100
  210. |
  211. | dodanie pliku integer.c do nowyBranch
  212. |
  213. * commit 7b3dbc1b57d2f9f1b1cb5abef10cb61001f23e73 (HEAD -> master)
  214. Author: 236733 <236733@student.pwr.edu.pl>
  215. Date: Fri Nov 30 00:34:15 2018 +0100
  216.  
  217. dodanie pliku hello.c do mastera
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement