#:gitlab状态 root@ubuntu:~# gitlab-ctl status run: alertmanager: (pid 13305) 215965s; run: log: (pid 13081) 215991s run: gitaly: (pid 13180) 215968s; run: log: (pid 12160) 216098s run: gitlab-monitor: (pid 13241) 215968s; run: log: (pid 12828) 216009s run: gitlab-workhorse: (pid 13215) 215968s; run: log: (pid 12681) 216032s run: logrotate: (pid 75944) 144715s; run: log: (pid 12738) 216021s run: nginx: (pid 12690) 216028s; run: log: (pid 12706) 216027s run: node-exporter: (pid 13228) 215968s; run: log: (pid 12793) 216013s run: postgres-exporter: (pid 13320) 215965s; run: log: (pid 13141) 215983s run: postgresql: (pid 12311) 216093s; run: log: (pid 12408) 216090s run: prometheus: (pid 13271) 215967s; run: log: (pid 12955) 215997s run: redis: (pid 12080) 216105s; run: log: (pid 12112) 216102s run: redis-exporter: (pid 13258) 215967s; RUN: log: (PID 12911 ) 216002s RUN: sidekiq: (PID 12624 ) 216040s; RUN: log: (PID 12644 ) 216039s RUN: Unicorn: (PID 12572 ) 216046s; RUN: log: (PID 12607 ) 216045s #: initialize the environment (each time you change the configuration must be done to execute this command) root @ Ubuntu: ~ # gitlab- ctl reconfigure #: lists all the current components root @ Ubuntu: ~ # gitlab-ctl Service- List #: restart gitlab (If you want to individually restart a service, followed by the service name) root @ Ubuntu: ~ # gitlab- ctl restart #: postsql into the database root @ Ubuntu: ~ # gitlab- Rails dbconsole psql ( 9.6 . 11 ) Type " Help " for Help. Gitlabhq_production => gitlabhq_production => \ db List of the Tablespaces the Name | Owner | the Location ------------ + ------------- + ---------- the pg_default tablespace is | gitlab-psql | pg_global | gitlab-psql | ( 2 rows) gitlabhq_production => \ Help #: view a separate service log root @ Ubuntu: ~ # gitlab-ctl tail nginx #: cloning project root @ Ubuntu: / opt # git clone HTTP: //192.168.6.101/linux37/web1.git
#: Git command #: First cloned down a piece of code in a remote repository root @ Ubuntu: / opt # git clone HTTP: // 192.168.6.101/linux37/web1.git Cloning INTO ' web1 ' ... the Username for ' HTTP: //192.168.6.101 ' : Xiaoming Password for ' HTTP: //[email protected] ' : Remote: Enumerating Objects: . 3 , DONE . Remote: a Counting Objects: 100 % ( . 3 / . 3 ), DONE . Remote: the Total . 3 (Delta 0), The Reused 0 (Delta 0 ) the Unpacking Objects: 100 % ( . 3 / . 3 ), DONE . The root @ Ubuntu: / opt # LS gitlab web1 #: modify the code the root @ Ubuntu: / opt # Vim web1 / index.html IS the Test Page the this the this IS the Test Page v2 root @ Ubuntu: / opt web1 # cd / #: first into the staging area root @ Ubuntu: / opt / web1 # git the Add index.html #: submitted to the local storage root @ Ubuntu: / opt / web1 # git the commit -m " v2 " #: submitted to the repository root @ Ubuntu: / opt /web1 # git the Push #: can also submit a Catalog #: create a directory root @ Ubuntu: / opt / web1 # mkdir App #: to write the code in this directory root @ Ubuntu: / opt / web1 # vim App / index .html the this IS Directory v1 #: into the staging area root @ Ubuntu: / opt / git the Add web1 #. / * #: submit to the local repository root @ Ubuntu: / opt / web1 # git the commit -m "v1" # : submit to a remote repository root @ Ubuntu: / opt / git the Push web1 # #: when just submitted to the staging area can be used to view the Status Git root @ Ubuntu: / opt / git web1 the Add index.html # root @ Ubuntu : / opt / web1 the staus # Git Git: 'the staus' IS A Git Command Not See 'Git --help'.. of The IS MOST Similar Command Status @ Ubuntu root: / opt / git Status # web1 Branch Master ON Your Branch DATE IS up to with 'Origin / Master'. Changes to BE committed: (use "git the RESET the HEAD <File> ..." to unstage) Modified: index.html #: view the log root @ ubuntu : / opt / web1 # Git log the commit 416ab98610aaa8939f48ee43be46598d75efa7ab (the HEAD -> Master, Origin / Master, Origin / the HEAD) the Author: Xiaoming <[email protected]> a Date: 29 the Sun On Sep 2019 10:46:42 +0800 V3 #: this is the content of commit comments commit 42785a48c2f235df7276ed15a2bfd14a46e1e023 #: here is the tag number Author: xiaoming <[email protected]> a Date: Sun 29 Sep 2019 10:40:23 +0800 v1 #: Code rollback (a ^ is a version ) Note: the rollback time can only roll back in time to the warehouse uncommitted root @ ubuntu: / opt / web1 # git reset --hard HEAD ^ #: query tag number root @ Ubuntu: / opt / git web1 # reflog 416ab98 (the HEAD -> Master, Origin / Master, Origin / the HEAD) the HEAD @ { } 0: pull: Fast-Forward 3d91a05 the HEAD. 1} {@: RESET: Moving the HEAD ^ to the root @ Ubuntu: / opt / web1 53082b0 RESET # # Git: rollback when rollback can specify tag number #: View all branches root @ ubuntu: / opt / web1 Git branch # * Master #: clone designated branch root @ ubuntu: / opt Git clone # -b Develop http://192.168.6.101/linux37/web1.git #: handover branch root @ ubuntu : / opt / web1 # git Checkout Master Branch 'Master' up to the SET Track Remote Branch 'Master' from 'Origin'. Switched to new new Branch A 'Master' root @ Ubuntu: / opt / git Checkout web1 # Your Branch DATE IS up to with 'Origin / Master'