codehaven - php snippets - coding help
Generic filters
Exact matches only
  • How to set up and use a git repository

    17th December 2014


    Raspberrypi - Codehaven

    Setup Procedure

    Sublime text with the git plugin, but can be used for pretty much any git program, as its the git language that is interchangeable between platform. (but it does differ?, I find this regularly using git bash in windows and command line raspberry pi).

    To create a new repository go to github and get an account

    Part 1: Add a repository called raspi2.

    This will create the url of, that we use in the next part.
    If I am at the ‘www’ folder level when running terminal (git bash), and I run this next command, it will create a folder called raspi2 locally and the contents of the uploaded repository is downloaded into www/raspi.
    Only this folder, is part of the git hub repository.

    Meaning, when I change my files it will know that there is now a difference between the files, and tell us what files have changed. When we are happy the code has been tested is fine and dandy, we can then upload this code and make it our new master branch (best working version).

    This code can also be written in a raspberry pi command line.

    Part 2: Add this to you terminal command line using git-bash program.

    Then check it has been done:

    It should show something like this

    If I want to track the folder named WWW in my files, ie everything, that may be a bit silly as any thing you store in your www, including passwords are stored in there also!!!!
    Only add one folder that you are sharing with the world.

    Part 3: Then add this to the terminal command line

    Then add your username of the repositry and then your password.
    And then it will push.

    Part 3: Add these commands in terminal

    Then I changed a file and push again and it should update that single file….
    I get a response that tells you what files have changed.
    And when I reload that repo it should change.

    Add this

    and the uploaded version will change but it can take ten minutes or so.

    A gui at last

    Wow where did this come from!
    But its mega handy…..well it looks it till i find something more fun looking to use.

    I can now “git pull” and git push using git bash.

    A fantastic tutorial is here, mark my words you have a great theme
    How to use github – a simple guide

    Was this code snippet helpful?