User Tools

Site Tools


public_git_repositories

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
public_git_repositories [2019/03/21 10:34]
admin
public_git_repositories [2019/03/21 10:38] (current)
admin
Line 1: Line 1:
 ====== Public git repositories ====== ====== Public git repositories ======
  
-If you have a project you'd like to make publicly available, ​these are the steps you'll need.+If you have a project you'd like to make publicly available, ​we need to tell git to update the web available files when a change has been made.  There are a number of ways to do this, but I find rsync'​ing a copy to your web root saves having to make any changes to the file permissions of your repository (useful if you have it set up for group collaboration).
  
-Move to your git repository ​and rename the existing sample hook to activate it:+Create a file called ''​post-receive''​ in the ''​hooks''​ directory of your repository.  It should contain:
  
-  ​cd /var/git/your_repo_name/hooks¬†+  ​rsync -a /var/git/sep93 /​var/​www/​git/
-  mv post-update.sample post-update+
  
-If you don't have the hooks directory, then find the ''​post-update.sample''​ file in your git installation (''/​usr/​share/​git-core/​templates/​hooks/​post-update.sample''​ on a Debian/​Ubuntu install) and copy it to the git repo you'd like to make available. 
- 
-  cp /​usr/​share/​git-core/​templates/​hooks/​post-update.sample /​var/​git/​yourprojectname/​hooks/​post-update 
-  ​ 
-Now we need to tell git to update the web available files when a change has been made.  There are a number of ways to do this, but I find rsync'​ing a copy to your web root saves having to make any changes to the file permissions of your repository (useful if you have it set up for group collaboration). 
- 
-Edit the post-update file to contain: 
- 
-  exec git update-server-info 
-  rsync -a /​var/​git/​your_repo_name /​var/​www/​git 
   ​   ​
 That's it.  Make a commit to update the repository and initiate the first transfer, then you'll be able to use (or share) this way to access the repository: That's it.  Make a commit to update the repository and initiate the first transfer, then you'll be able to use (or share) this way to access the repository:
public_git_repositories.txt · Last modified: 2019/03/21 10:38 by admin