How to install and configure Git server on CentOS 7 and setup webserver

Published: 02 April 2020
on channel: Quick Tech Tut
8,744
67

This video provides quick but brief tutorial on how to install Git server on Linux machines and setup webserver in few minutes.

Install git on existing web-server project in centos 7
Step: Initial Configuration
1. yum -y update && upgrade
2. yum -y install epel-release
3. yum -y install mlocate htop net-tools wget git
4. sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
5. which git-shell
/bin/git-shell
echo “/bin/git-shell” > > /etc/shells
Step: User Management
6. useradd developer
7. passwd developer
8. chsh -s $(which git-shell) developer
Step: Create git repositories
9. mkdir /opt/repo
10. mkdir /opt/repo/project.git
11. cd /opt/repo/project.git
12. git init --bare
Initialized empty git repositories
13. chmod -R developer:developer /opt/repo/project.git/
14. cd /var/www/html/project
15. git init
16. git add *
17. git commit -m “Initial commit”
18. git remote add origin /opt/repo/project.git
19. git push origin master
Step: From Client
20. git clone ssh://developer@ip_address_of_git_server:port/opt/repo/project.git
21. cd project
22. Echo “This is a test file.” > test.txt
23. git add .
24. git commit -m “initial commit”
25. git push origin master
Step: From server
26. git pull origin master


#Linux #Git

Like, Subscribe and Comment for more awesome videos.