Thread: Git

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    14
    Rep Power
    0

    Git


    Does anyone know how to setup a git repository on the live home web directory of my web server and 'connect' it to my eclipse IDE? I want to work on the project on eclipse and push commits I make on eclipse to my web server and have the committed files show up as a web site.

    Before you say it, git is the most non intuitive version control system I've encountered. I've been reading documentation after documentation on this for a week now and even lost some sleep. Its really not easy to do.
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    Here is probably how I would do it:

    Create a new repository on your web server; "git init" I think is all you need to run. Place the repository in the place where you want your files to show up. Also, when hosting a repository like this you'll want to be sure to configure your web server to block access to the .git directory to prevent leaks of your source code.

    You can clone your repository from your local machine over SSH. The clone URL will be something like git://username@hostname.com:/absolute/path/to/git/repository This path is not the relative path served by your web server. ie: if your repository it at the root of your web server's document root, you would not enter / here, you would still enter /var/www or whatever directory on the server is the web server's document root.

    Once that's set, you should just be able to pull and push changes between the two repositories.

    You'll still have to run manual commands on the web server copy to update it when you push a change. For safety reasons, by default GIT will not allow you to push to a branch that is currently checked out on the receiving repository. For this reason, you would normally set up your two repositories in the opposite way: have your live-server copy be a clone of your development copy and run a pull from the live-server to update it.

    Before you say it, git is the most non intuitive version control system I've encountered. I've been reading documentation after documentation on this for a week now and even lost some sleep. Its really not easy to do.
    Very few people would disagree with you on that. I would find it difficult to design a version control system with a more difficult to use interface.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    10
    Rep Power
    0
    I dont know what is git repository..please anybody tell me about it...

IMN logo majestic logo threadwatch logo seochat tools logo