How to Install and set up GitHub on Centos 7

First let’s install Git:

# yum install git -y

Use the follow commands to add in the required information:

$ git config --global user.name "NewUser"
$ git config --global user.email newuser@example.com

Create a directory called myproject for our workspace environment:

$ mkdir myproject/

Change to directory myproject/.

$ cd myproject/

Create a new file called teste.txt

$ touch teste.txt

Initialized a new empty repository:

$ git init

Add the file created early called teste.txt to the new created repository:

$ git add teste.txt (Add only file teste.txt)

or

$ git add . (Add all files)

To commit the changes, use the command:

$ git commit -m “Explaining the changes” -a (To commit all files)

or

$ git commit -m “Explaining the changes” teste.txt (To commit only file teste.txt)

Pushing changes to a remote server

To add a new remote repository, use the command:

$ git remote add origin git@github.com:user/myproject.git

To push your local repository to a remote repository use the command:

$ git push origin master

Reference: https://github.com/

Leave a Reply

Your email address will not be published. Required fields are marked *