Create a Repository in GitHub

Hello to all,

Now I am going to share how to create a Repository in GitHub account, and how to add an initial commit into that.
First we need to create an new account in GitHub
Then you have to install Git on your Linux Desktop using the following command.

$ sudo apt-get install git-core

Create a new repository and push data using command line


Just do the following commands

$ touch README.md
$ git init
$ git add README.md
$ git commit -m "first commit"
$ git remote add origin https://github.com/Your-User-Name/Your-Repository-Name.git
$ git push -u origin master


  • The first “touch README.md” command is used to create an README file for your Repository.
  • And the second “git init” command is used to initialize an empty Repository in the current working directory of your local computer.
  • The third “git commig -m ‘first commit'” command is used to changes records to the repository.
  • The fourth “git remote add origin ”’github.com/Your-User-Name/Your-Repository-Name.git”'” command adds a new remote repository of your project
  • The final “git push -u origin master” commands pushes your new branches and data to a remote repository

    If you have any doubts means got the the Try GitHub link. It has a live demo about github.com

    With Regards,
    S. Praveen

    Advertisements
  • Leave a Reply

    Please log in using one of these methods to post your comment:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s