• Tell by mail
  • Export to OpenOffice
  • Export to PDF
  • Add page to book
  • Tools:

Retour page des tutoriels ou page d'accueil.

GitHub

Created Saturday 11 April 2015

this is a practical tutorial to guide Open Source Ecologie collaborators to participate actively to our effort of a common development.

As a basic concept, Github helps to manage the different file revisions that each contributor can add.

The general procedure is to :

1- get involved with the Open Source Ecologie organisation in Github,

2- clone the common repository to your local folder (commonly using a GUI) oor Fork the repository if you are not part of Open Source Ecologie organisation

3- modify the files on the local repository you just cloned

4- Commit your changes

5- push your changes to the open source ecologie repository (or if you forked, push to your repository and then submit a pull request to merge the 2 repositories)

You will find the instructions for

Windows Users using the standard GUI,

Mac and Linux users using GitEYE (compatible also for Windows)

Linux users using the terminal with SSH encryption.

GIT Hub guide to OSE Collaborators

Create your account

first you need to create your account on www.github.com

Follow us on Git HUB

Go to https://github.com/osefrance/SolarConcentrator,

add us as favorite (Star) to notify us with your account

and follow us (Watch) to be notified of the changes applied to the repository.

Be part of the organization

Once you follow us, I will add you to the organization if we are already in touch. Those who are not yet part of the organization,contact us http://www.osefrance.fr/?page_id=33

or you can submit your changes to our repository by forking our repository in stead of cloning.

Windows users

Click to “Clone in Desktop”

you will be redirected to windows.github.com.

Alternatively you can download and install GitEye as our Linux and MAC contributors. see below for instructions

Download and install

Download and install the application from windows.github.com that helps you manage the local repositories and to commit your changes back to the master repository.

Clone locally

Add a repository by cloning https://github.com/osefrance/SolarConcentrator

Before doing this step you may want to configure your Git local Repository.

- Click on the top left corner arrow beside the “+”

- Choose “Clone” tab and select the OSEFrance/SolarConcentrator repository

capturewiki.jpg

- It will Clone the remote Master repository to your local repository folder

Ready to make your changes

that's it, now you are ready to make your modification to the files locally. as many as you want.

Commit your changes

When you are ready to load it on Github, open the github host program you previously installed, select “Show uncommitted changes” and add your comments, then click on “commit” Be as much descriptive as possible in your comments so that anyone can easily follow the changes you made

Upload

once committed, your files are ready to be submitted. just click Sync (top right of your program)

Linux and MAC users - Using GitEye

requirements

1- Open an account in Github (if you already have it go to point 2)

2- Get associated with Open source Ecologie

3- Perform the basic operations (Clone, Commit, Push, Pull)

Open an account

go on https://github.com/ fill the form (username, email, password) and sign in

in order to collaborate with other organizations, you can proceed with the default free account

click on finish sign up

Open the Git Repository in your Browser

Download your GUI

after testing several GUI for GIT we found out that GitEye is the best and most compatible amongst all. You can install it on both Linux and Mac.

Download GitEye

Install the GUI

Decompress the file and move it into the applications

in Linux (method tested on Fedora 21):

mv Downloads/GitEye-1.10* /usr/share/GitEye-1.10

Then create a symbolic link

ln -s /usr/share/GitEye-1.10/GitEye /bin/giteye

you can also create a shortcut to the main menu:

gedit /usr/share/applications/giteye.desktop

copy and paste the following and save the file.

[Desktop Entry]

Name=GitEye

Comment=Launcher for GitEye

Exec=/usr/share/GitEye-1.10/GitEye

Icon=/usr/share/GitEye-1.10/configuration/org.eclipse.osgi/15/0/.cp/icons/branding/giteye-logo-16.png

Categories=Application;Electronics;IDE;

Type=Application

Terminal=false

Configure GitEYE

- Accept all messages at startup

- Click on Git Settings

- configure your default Local Git repository folder

- Add the entries user.name and user.email and click on ok.

Clone with GitEYE

- Run giteye as user, for Windows and mac simply start it from the applications menu.

In Linux (if you followed the previous installation method):

   ''giteye''

- Select Clone Repository (except if you have already a repository in your local drive)

- Select from Github

- Search for “SolarConcentrator” and select the master from OSEFrance

- Clone the Master repository only

- Once it completes to clone, you are ready to go. You can close GitEye

Modify your files

Using your file browser, go to your local repository, modify on your local drives the files. Save all changes to your local drive.

Commit your changes on GitEYE

- Once you completed all changes reopen GitEye and open “Git Files” tab

- Click on Refresh if you cannot see the changed files in “Working Tree Files” Show pending

- Drag & Drop the files you changed to the “Staged changes” and write the commit message

- Commit and push your changes.

If you cloned using ssh and you added your passphrase to your key, you will be prompted to write your passphrase

once the push is complete you can close GitEYE

Ready for your next changes?

Before your next changes, ensure you have the latest version of the repository:

- Reopen GitEYE

- Right-click on the repository in GitEye

- Select “Pull”

Linux users - Using the Terminal and SSH

using the SSH Key

test your access using the ssh key

https://help.github.com/articles/error-permission-denied-publickey/

ssh -vT git@github.com

if you get an error to access

ssh-add -l

if no keys follow the following procedure

(extracted from: Github help )

ls -al ~/.ssh

ssh-keygen -t rsa -C “your_email@example.com”

eval “$(ssh-agent -s)”

ssh-add ~/.ssh/id_rsa

gedit ~/.ssh/id_rsa.pub

copy key content and paste it into your account on https://github.com/settings/ssh (section 4)

verify with:

ssh -T git@github.com

Initialize and Clone in Terminal

$ mkdir git-repo

$ cd git-repo

$ git clone git@github.com:osefrance/SolarConcentrator.git

Now you can make all changes to the files in your local repository then continue with the following when you are ready to upload them.

Commit and push / merge with git in Terminal

$ git status

$ git add .

$ git commit

Will open an editor where you can type the summary and changes to your project. in vi press “i” as insert before start typing your comments for commit.

if you are in vi esc :wq to write and quit the vi editor after saving.

(or ctrl+x to close and save in nano editor)

$ git push

after prompting for login and password your files will be loaded into the original repository on Git-hub

Congratulations! you contributed to development of the project! Thanks!

if you were in a branch or a fork you can propose a pull for a merge.

first make sure you are in the master branch

$ git checkout master

then you can pull your changes from the branch you were (heliostat in the exemple) into Master

$ git merge –no-ff heliostat

$ git push origin master

Main Terminal commands of Git for Linux Users

git config –global user.name “YOUR NAME”

git config –global user.email “YOUR EMAIL ADDRESS”

git config –global credential.helper 'cache –timeout=7200'

git clone git@github.com:osefrance/SolarConcentrator.git git@github.com:osefrance/SolarConcentrator.git

git status

before any change, ensure you have the latest repository

git pull

after changing the files in your local repository

git commit

git add .

git push

  • Tell by mail
  • Export to OpenOffice
  • Export to PDF
  • Add page to book
  • Tools:
QR Code
QR Code github (generated for current page)