*How to push your files to github*

As i had done in my previous blog post. Moving furthur, let here i am creating a file named abc.txt

Go to terminal,

cd gittest/

ls

nano abc. txt

nano is command for creating new file. And then click enter

Now, enter your code . I am here simply entering hie git.

press ctrl+o and enter to save it. Then, ctrl+x to exit.

To read it once again just enter nano abc.txt and again ctrl+x to exit.

Now, to add this file to git. We will follow same procedure as we had did in previous blog.

git add abc.txt

and then commit this file to git using

git commit -m “I am adding next file”

and then,

git remote add origin https://github.com/dsdeeptisharma/gittest.git

and then,

git push -u origin master

Now on your dashboard click on your directory name and now you will see two files.

🙂

Advertisements

*My first Github Repository*

HOW TO INSTALL GIT ON YOUR LINUX OPERATING SYSTEM?

GIT:  It is a distributed version control system (system to record changes to files over time) having many features like it helps to add access control,display content of git repository  (place where multiple files are located) and help managing multiple repositories.

You can simply install git on your system using thing command on terminal. So that you can directly link your system with your github account.

sudo apt-get install git

It will take few minutes to install.

CREATION OF AN ACCOUNT ON GITHUB

 GitHub is a web-based Git repository hosting service. It offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its own features.

Go to github website i.e

http://github.com/

Creating an account on github is not a huge task. You just need to give a username, email, password and you are done.

Screenshot from 2016-03-04 22-35-02

Above is the dashboard of git.

NOW,

NEED TO SETUP GIT USERNAME AND EMAIL ON SYSTEM OS

git config –global user.name “username”

then press enter. This will configure your username. Similarly, type  command given below in terminal

git config –global user.email “email”

then press enter.

Between ” ” you need to give your username and email address.

CREATING FIRST REPOSITORY

Go to the dashboard of git and click on the + sign which is there in right side at the top.Click on new repository.

Screenshot from 2016-03-04 22-43-56

Give your repository name and description as per your choice. Then, you can choose public or private repository. Public is free but private is paid. Then click on create repository.

Once repository is created. lets create a directory in the system. let say i am here creating it in home folder by name gittest.

mkdir gittest

ls

cd gittest/

ls

Now, go to the dashboard of git and you will see gittest (name of your directory) on the top. Click on it and you will see series of commands there under create the new repository on the command line.

Enter those commands one by one on your shell.

echo “# gittest” >> README.md

This is for creating a file README.md

gittest is here my directory name.

git init

This is to initialize git in my directory.

git add README.md

This to add file i have created to the git. Add commands add your file to the git.

git commit -m “first commit”

Between ” ” you can enter any thing, this is the commit. You need to commit your file in order to save your changes in git.

git remote add origin https://github.com/dsdeeptisharma/gittest.git

dsdeeptisharma is my username in this case furthur is name of the directory. https://github.com/dsdeeptisharma/gittest.git is the URL which gives link to the git.It links our github and local directory.

git push -u origin master

This is to push your files to github. Furthur you need to enter your github username and password in shell.

This is all about how to begin with github.

Stay tuned  … 😉