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 "NewUser"
$ git config --global

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)


$ git add . (Add all files)

To commit the changes, use the command:

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


$ 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

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

$ git push origin master