So far from reading the git tutorails I have understood that for sharing my project files residing in my ubuntu linux server I need to create a bare repository and link it to the actual repository, so that when users clone the actual repo they get the actual repo having the actual work files.
And when they push their changes to the server the post-receive hook now updates the actual repo containing work files.
This is all I could understand and beyound that I have a lot of confusion for which I have the foll questions:
1) How do I create my bare repo.
2) How do I link it to the actual repo consisting the actual work files.
3) And what is this post-receive hook? Where does it reside? And what configurations do I need to do for the same.
Read this.
To clone existing repository into a new
barerepo, you would run this command:Read this.
The
non-barerepository can add thebareas aremote:Then, from the
non-bare:Again, this is all covered in the Git SCM book, which I recommend you read before asking the same question again on StackOverflow.
Read the book. It gives you the terms to search for (such as
git remote repositories,git bare server, etc). There are lots of questions on StackOverflow about this, when you know what to search for.It’s a script that is run after the repository is
pushed to. (After it has received data, the repository runs thepost-receivescript – sensible naming).In the
hooksdirectory of thebarerepository; in.git/hooksotherwise. Read this.You do not need a
post-receivehook to do what you’re asking to do (set up a basicbarerepository so a small number of multiple users cangit pushandgit pullfrom it). If you do not know what ahookis, you do not need one at this point. Set up your repository, get comfortable using basic git commands and working with collaborators on abarerepo, and ask a specific question about setting up and using apost-receivehook.I can’t stress this enough: read the book. It will help. I learned a lot. 🙂 It will tell you how to:
Chapter 4).Chapter 2, section 5).Chapter 7, section 3).