Advertisement
sreehariskumar

git init

Feb 28th, 2023
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 KB | None | 0 0
  1. GITHUB
  2. ======
  3. $ sudo yum install git tree -y
  4. $ git --version
  5. git version 2.39.1
  6.  
  7. $ mkdir website
  8. $ cd website/
  9.  
  10. $ cat main.yml
  11. playbook
  12.  
  13. $ git init
  14. $ git config git.user sree
  15. $ git config git.email [email protected]
  16.  
  17.  
  18. $ git status
  19.  
  20. Untracked files:
  21. (use "git add <file>..." to include in what will be committed)
  22. main.yml
  23.  
  24.  
  25. $ git add main.yml
  26. $ git status
  27. Changes to be committed:
  28. new file: main.yml
  29.  
  30.  
  31. $ git ls-files -s
  32. 100644 843a4c41f380230b4ffeb00c59d18b69fb4c6bae 0 main.yml
  33.  
  34. $ git cat-file -p 843a4c41f380230b4ffeb00c59d18b69fb4c6bae
  35. playbook
  36.  
  37.  
  38. $ echo "linux" > centos.txt
  39. $ echo "linux" > redhat.txt
  40.  
  41. $ git status
  42. Changes to be committed:
  43. new file: main.yml
  44.  
  45. Untracked files:
  46. (use "git add <file>..." to include in what will be committed)
  47. centos.txt
  48. redhat.txt
  49.  
  50. $ git add centos.txt redhat.txt
  51.  
  52. $ git status
  53. Changes to be committed:
  54. new file: centos.txt
  55. new file: main.yml
  56. new file: redhat.txt
  57.  
  58. $ git ls-files -s
  59. 100644 a08e1f35eb7c510c1d29584d7edc575339876a01 0 centos.txt
  60. 100644 843a4c41f380230b4ffeb00c59d18b69fb4c6bae 0 main.yml
  61. 100644 a08e1f35eb7c510c1d29584d7edc575339876a01 0 redhat.txt
  62.  
  63. $ git cat-file -p a08e
  64. linux
  65.  
  66.  
  67. $ echo "linux version1" > centos.txt
  68.  
  69.  
  70. $ git status
  71. Changes to be committed:
  72. new file: centos.txt
  73. new file: main.yml
  74. new file: redhat.txt
  75.  
  76. Changes not staged for commit:
  77. modified: centos.txt
  78.  
  79. $ git add centos.txt
  80.  
  81. $ git status
  82. Changes to be committed:
  83. new file: centos.txt
  84. new file: main.yml
  85. new file: redhat.txt
  86.  
  87. $ git ls-files -s
  88. 100644 a4e92f028a473a8af1ae075e99cf37099967b852 0 centos.txt
  89. 100644 843a4c41f380230b4ffeb00c59d18b69fb4c6bae 0 main.yml
  90. 100644 a08e1f35eb7c510c1d29584d7edc575339876a01 0 redhat.txt
  91.  
  92. $ git cat-file -p a4e9
  93. linux version
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100. $ echo "linux version2" > centos.txt
  101. $ git status
  102. Changes to be committed:
  103. new file: centos.txt
  104. new file: main.yml
  105. new file: redhat.txt
  106.  
  107. Changes not staged for commit:
  108. modified: centos.txt
  109.  
  110. $ git add centos.txt
  111. $ git status
  112. Changes to be committed:
  113. new file: centos.txt
  114. new file: main.yml
  115. new file: redhat.txt
  116.  
  117. $ git ls-files -s
  118. 100644 3347ced1991155b3e01fbf6671a62e53121d185b 0 centos.txt
  119. 100644 843a4c41f380230b4ffeb00c59d18b69fb4c6bae 0 main.yml
  120. 100644 a08e1f35eb7c510c1d29584d7edc575339876a01 0 redhat.txt
  121.  
  122. ├── objects
  123. │   ├── 33
  124. │   │   └── 47ced1991155b3e01fbf6671a62e53121d185b
  125. │   ├── 84
  126. │   │   └── 3a4c41f380230b4ffeb00c59d18b69fb4c6bae
  127. │   ├── a0
  128. │   │   └── 8e1f35eb7c510c1d29584d7edc575339876a01
  129. │   ├── a4
  130. │   │   └── e92f028a473a8af1ae075e99cf37099967b852
  131.  
  132.  
  133.  
  134. $ git rm --cached centos.txt
  135. rm 'centos.txt'
  136.  
  137. $ git ls-files -s
  138. 100644 843a4c41f380230b4ffeb00c59d18b69fb4c6bae 0 main.yml
  139. 100644 a08e1f35eb7c510c1d29584d7edc575339876a01 0 redhat.txt
  140.  
  141. ├── objects
  142. │   ├── 33
  143. │   │   └── 47ced1991155b3e01fbf6671a62e53121d185b
  144. │   ├── 84
  145. │   │   └── 3a4c41f380230b4ffeb00c59d18b69fb4c6bae
  146. │   ├── a0
  147. │   │   └── 8e1f35eb7c510c1d29584d7edc575339876a01
  148. │   ├── a4
  149. │   │   └── e92f028a473a8af1ae075e99cf37099967b852
  150.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement