Tutorial: Creating a Github account and add a project using the command line

In this tutorial we will try to create a Github account and try to use the terminal Gnu / Linux (I’ll use in this tutorial Bash) to add a project.

Go to the website github.com

Creating an account:

Select the plan of our account Github (Free for me):

Checking account our email:

This is now our Github account is active:

NB: We must remember our username, email and password of Github
.In this example:

  • Nickname: nexus66

  • Email: chihebnexus66@gmail.com

  • Password: My Password

Creating a new repository (Repository):

NB: Note:

  • Owner = Owner: nexus66 (for this tutorial)

  • name = Repository Repository Name: test (for this tutorial)

  • Description = Description: Some description of our deposit

  • Public / Private = Public / Private: Type of this public or private repository (I chose public)

  • Initialize this repository with a README.md = Initialize this deposit with a file README.md

  • Add .gitignore = Add .gitignore file: I added a .gitignore file for Python

  • Add a license = Add License: I added a type of license GPLv3.0

We will have a result as follows:

Back to our terminal Gnu / Linux:

First, one must install or update git. Currently I am using Ubuntu 14.04 and to update git I pass this command to my terminal (I use Bash):

For other distributions, and other OS:



 $ emerge --ask --verbose dev-vcs / git 

Arch Linux:



 $ cd / usr / ports / devel / git 

Solaris 11 Express:

 $ pkg install developer / versioning / git 


 $ pkg_add git 

git configuration:

Add our nickname nexus66 our Github account to git:

 git config --global user.name "nexus66" 

Add our email from our Github account to git:

 git config --global user.email "chihebnexus66@gmail.com" 

Note: This configuration is required only once for a single Github account. If you use multiple accounts Github, then you must configure each time so that he can track your Github account.

Clone your deposit on your computer:

to clone your repository on your computer, you must have git URL of your deposit which is in your deposit on the site Github:

Now, open the folder Github, one will find a new folder named “test” which is the clone of our deposit.

It opens and we add our project as follows:

NB: the presence of two files is noted: LICENSE and README.md that have been created on the site Github. That said, on Github repository should follow the clone downloaded on our computer and vice versa, otherwise we must do more manipulation … I leave this for the next tutorial.

Change the clone and upload it on Github:

Adding a file in the test folder (the clone on our computer), git takes it as a change and any change must be manually added and commented to be taken into account. Also, any change to the file content is a modification made by git.

So after our changes, we will upload our clone and make the deposit on Github follows our clone on our computer. To do so, we will go to the terminal and do this:


 git commit -m "first upload" 


 -u git push origin master 

And here we must write our Github username and our password.

this illustrates our orders:

Back to Github:

We now see that our amendments were taken into account and the deposit on Gihub following its clone on our computer.

Tutorial end :-).

No comments:

Powered by Blogger.