User Tools


server:stagit

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
server:stagit [2025/08/24 07:27] – [nginx (server side)] marlonivoserver:stagit [2025/08/24 07:36] (current) – [Cloning] marlonivo
Line 74: Line 74:
 </code> </code>
  
-Set the right permissions for the whole directory, ''%%www-data%%'' for nginx and ''%%git%%'' for git:+Set the right permissions for the complete directory, ''%%www-data%%'' for nginx and ''%%git%%'' for git:
 <code> <code>
 chown -R git:www-data /var/www/stagit  chown -R git:www-data /var/www/stagit 
Line 86: Line 86:
  
 =====stagit (local side)===== =====stagit (local side)=====
- +Then go to your local project directory and initialise a git project, point it to your server's project destination and optionally set your git user name and mail:
-Then go to local project directory and initliase a git project, point it to your server's project destinatio and set your git user name:+
 <code> <code>
 cd project1 cd project1
Line 94: Line 93:
 git remote -v git remote -v
 git config user.name "Your Name" git config user.name "Your Name"
 +git config user.email "your@mail.com"
 </code> </code>
  
-Now inside your freshly generated bare git folder, change the description, owner name, url files and create a git-ademon-export-ok in order to let anyone clone your repo.+Now inside your freshly generated bare git folder found in ''%%.git%%'', change the project description, the owner name and the clone url as well as creating a git-daemon-export-ok (leave empty) in order to let anyone clone your repo.
 <code> <code>
 /project1/.git/ /project1/.git/
-  ├── description - description of the repo+  ├── description                 ← 1
-  ├── owner - owner name of the repo+  ├── owner                       ← 2
-  ├── url - e.g: git://git.example.com/project +  ├── url                         ← 3
-  └── git-daemon-export-ok - to acces via git clone+  └── git-daemon-export-ok        ← 4.
 </code> </code>
  
-As well as in your ''%%/hooks%%'' folder add a ''%%post-receive%%'' script to update all necessary files after git pushing to your server (change file destination and repo name accordingly) with the following content:+As well as in your ''%%.git/hooks%%'' folder add a ''%%post-receive%%'' script to update all necessary files after git pushing to your server (change file destination and repo name accordingly) with the following content:
 <code bash> <code bash>
 #!/bin/sh #!/bin/sh
Line 136: Line 136:
     git commit -m "$msg"     git commit -m "$msg"
     git push stagit master     git push stagit master
-#   git push aur master      <- add aur remote +#   git push aur master      <- if you own aur 
-#   git push github master   <- and github remote here+#   git push github master   <- and github remotes
 } }
 </code> </code>
Line 156: Line 156:
  
 [Service] [Service]
-ExecStart=/usr/bin/git daemon \+ExecStart=/usr/bin/git-daemon \
   --base-path=/var/www/stagit/repos \   --base-path=/var/www/stagit/repos \
   --export-all \   --export-all \
Line 176: Line 176:
 </code> </code>
  
-Then open port 9418 in your firewall:+Then open port 9418 in your firewall to let anyone clone your repo:
 <code> <code>
 sudo ufw allow 9418/tcp sudo ufw allow 9418/tcp