Setup Procedure
Ingredients:
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).
PHP
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 https://github.com/mikeys4u/raspi2, 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.
1 2 3 |
git clone https://github.com/mikeys4u/raspi2.git |
Then check it has been done:
1 2 3 |
git remote -v |
It should show something like this
1 2 3 4 |
origin https://github.com/mikeys4u/raspi.git (fetch) origin https://github.com/mikeys4u/raspi.git (push) |
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
1 2 3 |
git push origin master |
Then add your username of the repositry and then your password.
And then it will push.
Part 3: Add these commands in terminal
1 2 3 4 |
git checkout master git push origin master |
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
1 2 3 4 5 |
//THIS IS USING SUBLIMES PLUGIN CALLED GIT git quick commit //FROM THE COMMAND LINE IN SUBLIME |
1 2 3 |
git push |
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.
1 2 3 |
gitk |
A fantastic tutorial is here, mark my words you have a great theme
How to use github – a simple guide