root@wang:/opt/web1# git checkout develop
Already on 'develop'
Your branch is up to date with 'origin/develop'.
切換到開發(fā)分支
root@wang:/opt/web1# git checkout
Your branch is up to date with 'origin/develop'.
查看當(dāng)前分支
root@wang:/opt/web1# git checkout master
切換到master分支
這個配置文件會記錄究驴,有幾個分支
root@wang:/opt/web1# vim index.html
v4
修改代碼吹艇,
root@wang:/opt/web1# git add ./*
git add:把要提交的所有修改放到暫存區(qū)(Stage)
root@wang:/opt/web1# git commit -m "v4"
git commit:一次性把暫存區(qū)的所有修改提交到分支
root@wang:/opt/web1# git push
537951f..170cda2 develop -> develop
往開發(fā)分支提交诱建,克隆的是那個分支提交的就是哪個分支
合并分支
image.png
image.png
image.png
接下來用管理員用戶登錄
同意合并稀并,
等下午視頻在看
git 緩存區(qū)與工作區(qū)等概念: 工作區(qū):clone 的代碼或者開發(fā)自己編寫的代碼文件所在的目錄仅颇,通常是代碼所在的一 個服務(wù)的目錄名稱。 暫存區(qū):用于存儲在工作區(qū)中對代碼進(jìn)行修改后的文件所保存的地方碘举,使用 git add 添 加忘瓦。 本地倉庫:用于提交存儲在工作區(qū)和暫存區(qū)中改過的文件地方,使用 git commi 提交引颈。 遠(yuǎn)程倉庫:多個開發(fā)共同協(xié)作提交代碼的倉庫耕皮,即 gitlab 服務(wù)器
image.png
2.1.3.20: gitlab 數(shù)據(jù)備份恢復(fù):
2.1.3.20.1: 停止 gitlab 數(shù)據(jù)服務(wù):
root@s1:~# gitlab-ctl stop unicorn
ok: down: unicorn: 1s, normally up
root@s1:~# gitlab-ctl stop sidekiq
ok: down: sidekiq: 0s, normally up
2.1.3.20.2: 手動備份數(shù)據(jù):
# gitlab-rake gitlab:backup:create #在任意目錄即可備份當(dāng)前 gitlab 數(shù)據(jù)
# gitlab-ctl start #備份完成后啟動 gitlab
gitlab備份腳本
root@wang:/opt/web1# cat git-bakup.sh
#!/bin/bash
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-rake gitlab:backup:create
gitlab-ctl start
Creating backup archive: 1573202159_2019_11_08_11.11.5_gitlab_backup.tar ... done
這個是備份的時間戳和文件
/var/opt/gitlab/backups/1573202159_2019_11_08_11.11.5_gitlab_backup.tar
備份的文件在這個目錄里
刪除項目,
刪除
恢復(fù)文件
/var/opt/gitlab/backups/ # Gitlab 數(shù)據(jù)備份目錄蝙场, 需要使用命令備份的
/var/opt/gitlab/nginx/conf #nginx 配置文件
/etc/gitlab/gitlab.rb #gitlab 配置文件
執(zhí)行恢復(fù):
刪除一些數(shù)據(jù)明场,測試能否恢復(fù)
# gitlab-ctl stop unicorn
# gitlab-ctl stop sidekiq #恢復(fù)數(shù)據(jù)之前停止服務(wù)
root@s1:~# gitlab-rake gitlab:backup:restore BACKUP=備份文件名只到版本號,
root@wang:/var/opt/gitlab/backups# gitlab-rake gitlab:backup:restore BACKUP=1573202159_2019_11_08_11.11.5
恢復(fù)數(shù)據(jù),然后輸入兩邊yes李丰,
root@wang:/var/opt/gitlab/backups# gitlab-ctl start
然后在啟動服務(wù),驗證數(shù)據(jù)是否恢復(fù)了
查看剛才刪除的兩個項目,已經(jīng)回來了
設(shè)置漢化
image.png
在這里改成簡體中文
https://gitlab.com/xhang/gitlab
下載漢化包
root@wang:/var/opt/gitlab/backups# gitlab-ctl stop
停止服務(wù)
gitlab-v11.11.5-zh.tar
拖過漢化包
root@wang:/var/opt/gitlab/backups# tar xf gitlab-v11.11.5-zh.tar
root@wang:/var/opt/gitlab/backups# cd gitlab-v11.11.5-zh/
root@wang:/var/opt/gitlab/backups/gitlab-v11.11.5-zh# cp -rf * /opt/gitlab/embedded/service/gitlab-rails/
拷貝漢化包過去
root@wang:/var/opt/gitlab/backups/gitlab-v11.11.5-zh# gitlab-ctl reconfigure
重新初始化
root@wang:/var/opt/gitlab/backups/gitlab-v11.11.5-zh# gitlab-ctl start
把服務(wù)起來
發(fā)現(xiàn)已經(jīng)漢化成功
root@wang:~# head -1 /opt/gitlab/version-manifest.txt
gitlab-ce 11.11.5
查看gitlab的版本