User Tools

Site Tools


сервис_git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
сервис_git [2022/08/14 18:18]
val [Использование персонального http/ssh/git репозитория]
сервис_git [2022/09/14 12:08]
val [On-Premise gitlab]
Line 87: Line 87:
 server#:/​var/​www/​html/​conf.git#​ git init --bare server#:/​var/​www/​html/​conf.git#​ git init --bare
  
-Не обязательно,​ но, если хочется видеть содержимое текущего репозитория по http, можно настроить hooks/​post-update ​!!! exec должна быть последняя команда+Не обязательно,​ но, если хочется видеть содержимое текущего репозитория по http, можно настроить hooks/​post-update ​
  
 server#:/​var/​www/​html/​conf.git#​ mv hooks/​post-update.sample hooks/​post-update server#:/​var/​www/​html/​conf.git#​ mv hooks/​post-update.sample hooks/​post-update
Line 94: Line 94:
  
 server#:/​var/​www/​html/​conf.git#​ cat hooks/​post-update server#:/​var/​www/​html/​conf.git#​ cat hooks/​post-update
-</​code><​code>​+</​code>​ 
 +!!! exec должна быть последняя команда 
 +<​code>​
 ... ...
 #exec git update-server-info #exec git update-server-info
Line 109: Line 111:
  
 ==== On-Premise gitlab ==== ==== On-Premise gitlab ====
 +
 +  * [[https://​stackoverflow.com/​questions/​6565357/​git-push-requires-username-and-password|Git push requires username and password]]
 +
 <​code>​ <​code>​
 $ git remote -v $ git remote -v
Line 115: Line 120:
  
 $ git branch $ git branch
 +
 +$ ### git config credential.helper store
  
 $ git push origin master $ git push origin master
 +
 +$ ### cat ~/​.git-credentials
 </​code>​ </​code>​
  
Line 158: Line 167:
 ==== On-Premise gitlab ==== ==== On-Premise gitlab ====
 <​code>​ <​code>​
-git clone http://​server.corp14.un/​student/​dhcp.git+git clone http://​server.corpX.un/​student/​dhcp.git
  
   или   или
Line 196: Line 205:
 ==== Пример с тестовой веткой ==== ==== Пример с тестовой веткой ====
 <​code>​ <​code>​
-git branch test+λ git branch test
  
-git branch -a+λ git branch -a
  
-git checkout test+λ git checkout test
  
 ... edit ... commit ... ... edit ... commit ...
  
-git push -u origin test+λ git push -u origin test
  
 +
 +root@server:​~/​openvpn1#​ git pull origin test
 +root@server:​~/​openvpn1#​ ansible-playbook ... test_nodes
 +   ​или
 ... ci/cd test ... ... ci/cd test ...
  
-$ git checkout main 
  
-git push -u origin main+λ git checkout main 
 + 
 +λ git merge test 
 + 
 +λ git push -u origin main
  
 ... ci/cd prod ... ... ci/cd prod ...
сервис_git.txt · Last modified: 2023/09/14 15:37 by val