รวมความรู้สำหรับ ทำ Git ใช้งานเอง ด้วย Gitlab

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: รวมความรู้สำหรับ ทำ Git ใช้งานเอง ด้วย Gitlab

Re: รวมความรู้สำหรับ ทำ Git ใช้งานเอง ด้วย Gitlab

โดย Parichat » 06/03/2018 5:34 pm

ขั้นตอนการอัพไฟล์เข้า Git :baa:
  • 1.คลิกเลือกโฟลเดอร์งานที่ต้องการ
    2.คลิกขวาเลือก Git>commit เพื่อที่จะระบุว่าเราทำอะไรไปบ้างและเพื่อบันทึกไฟล์ลงในเครื่องของเราก่อน ดังรูป
    zzzz5.png
    zzzz5.png (74.66 KiB) Viewed 1664 times
    3.คลิกขวาเลือก Git>Remote>Push เพื่อทำการอัพไฟล์ขึ้น Git ดังรูป
    zzzz4.png
    zzzz4.png (95.66 KiB) Viewed 1664 times
    4.ในการณีที่ Push ไม่ได้ก็ให้ pull เพื่อดึงข้อมูลที่มีการอัพเดสลงเครื่องของเราก่อน
    zzzz3.png
    zzzz3.png (94.59 KiB) Viewed 1664 times
    5.จากนั้นก็ลอง Push ใหม่โดยทำตามวิธีที่ 3
สีของชื่อไฟล์ที่อัพขึ้น Git มีดังนี้
  • สีเขียว คือ ไฟล์งานที่แก้ไข
    สีดำ คือ ไฟล์งานที่อัพขึ้น git เรียบร้อยแล้ว
    สีน้ำเงิน คือ ไฟล์เก่าที่มีการแก้ไข
เมื่ออัพไฟล์งานขึ้น Git แล้ว GIT มันจะเก็บโค้ดไว้ 2 ที่ คือ
  • 1.เครื่องของเรา
    2.เครื่องบน server
คำสั่งในการใช้ Git มีดังนี้
  • 1.pull คือ ดึงโค้ดจากเครื่อง server มาไว้ที่เครื่องเรา
    2.commit คือ เอาโค้ดเราบันทึกลงเครื่อง
    3.push คือ เอาส่วนที่เรา commit ไว้ในเครื่องส่งไปที่ server

Re: รวมความรู้สำหรับ ทำ Git ใช้งานเอง ด้วย Gitlab

โดย mindphp » 02/03/2018 10:45 pm

วิธีอัพเกรด Gitlab
รันคำสั่ง

โค้ด: เลือกทั้งหมด

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

โค้ด: เลือกทั้งหมด

apt-get install gitlab-ce

คำสั่ง ลัด กรณี Gitlab ใช้งานไม่ได้

โค้ด: เลือกทั้งหมด

gitlab-ctl reconfigure
gitlab-ctl status
gitlab-ctl restart

Re: รวมความรู้สำหรับ ทำ Git ใช้งานเอง ด้วย Gitlab

โดย mindphp » 02/03/2018 9:56 pm

วิธีเช็คเวอร์ชั่นของ Gitlab

โค้ด: เลือกทั้งหมด

sudo gitlab-rake gitlab:env:info
ตัวอย่างผลที่ได้
System information
System: Ubuntu 14.04
Current User: git
Using RVM: no
Ruby Version: 2.3.5p376
Gem Version: 2.6.13
Bundler Version:1.13.7
Rake Version: 12.0.0
Redis Version: 3.2.5
Git Version: 2.13.5
Sidekiq Version:5.0.4
Go Version: unknown

GitLab information
Version: 10.0.3
Revision: 8895150
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: http://IP
HTTP Clone URL: http://IP/some-group/some-project.git
SSH Clone URL: git@IP:some-group/some-project.git
Using LDAP: no
Using Omniauth: no

GitLab Shell
Version: 5.9.0
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
Git: /opt/gitlab/embedded/bin/git
Version: 10.0.3 <===== คือเวอร์ชั่นของ Gitlab ที่เราติดตั้งอยู่

รวมความรู้สำหรับ ทำ Git ใช้งานเอง ด้วย Gitlab

โดย mindphp » 02/03/2018 6:37 pm

GitLab

วิธี Backup Restore Gitlab
https://www.mindphp.com/forums/viewtopic ... 27&t=45981

ข้างบน