Git is an open-source version control system used by thousands of developers around the world.
HTTP Git Server is an open-source project that uses an Nginx webserver to serve Git repositories over your Local Area Network (LAN). It is very simple and easy to set up. Anyone can manage it from the command-line interface.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
๐๐ฎ๐ซ ๐๐๐ซ๐ฏ๐๐ซ ๐๐ฉ๐๐๐ข๐๐ข๐๐๐ญ๐ข๐จ๐ง:-
๐๐ฌ : ๐๐๐๐ข๐๐ง ๐๐ ๐๐ฎ๐ฅ๐ฅ๐ฌ๐๐ฒ๐ ๐๐ ๐๐ข๐ญ || ๐๐จ๐ฌ๐ญ๐ง๐๐ฆ๐: || ๐๐ ๐๐๐๐ซ๐๐ฌ๐ฌ ๐จ๐ ๐๐๐ซ๐ฏ๐๐ซ:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
lsb_release -cd ; getconf LONG_BIT ; hostname ; hostname -I
apt install -y build-essential net-tools curl git software-properties-common nginx git fcgiwrap apache2-utils unzip
mkdir /var/www/html/myrepo ; cd /var/www/html/myrepo ; mkdir user1.git
cd user1.git ; git --bare init
git update-server-info
chown -R www-data:www-data /var/www/html/myrepo ; chmod -R 755 /var/www/html/myrepo
htpasswd -c /var/www/html/myrepo/htpasswd user1
nano /etc/nginx/conf.d/git.conf
server {
listen 80;
root /var/www/html/myrepo;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name debian.example.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location ~ (/.*) {
client_max_body_size 0;
auth_basic "Git Login";
auth_basic_user_file "/var/www/html/myrepo/htpasswd";
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
fastcgi_param GIT_HTTP_EXPORT_ALL "";
fastcgi_param GIT_PROJECT_ROOT /var/www/html/myrepo;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $1;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
}
nginx -t
systemctl restart nginx ; systemctl status nginx
mkdir project ; cd project ; git init
git config --global user.email "user1@yourdomain.com"
git config --global user.name "user1"
git remote add origin http://user1@debian.example.com/user1.git
mkdir dev01
echo "Subscribe share like " > dev01/file1
git add .
git commit -a -m "Add files and directories"
git push origin master
git clone http://user1@debian.example.com//user1.git
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
No comments:
Post a Comment