Installing and Using Git and GitHub on Ubuntu Linux
Installing and Using Git and GitHub on Ubuntu Linux
Installing and Using Git and GitHub on Ubuntu Linux
The above command is for Ubuntu and works on all Recent Ubuntu versions, tested from Ubuntu
16.04 to Ubuntu 18.04 LTS (Bionic Beaver) and it's likely to work the same way on future versions.
2 Configuring GitHub
Once the installation has successfully completed, the next thing to do is to set up the
configuration details of the GitHub user. To do this use the following two commands by replacing
"user_name" with your GitHub username and replacing "email_id" with your email-id you used to
create your GitHub account.
If the repository is created successfully, then you will get the following line:
cd Mytest
gedit README
You can use any other text editors. I use gedit. The content of the README file will be:
#include<stdio.h>
int main()
{
printf("hello world");
return 0;
}
Note that the "git add" command can be used to add any number of files and folders to the index.
Here, when I say index, what I am referring to is a buffer like space that stores the files/folders
that have to be added into the Git repository.
6 Committing changes made to the index
Once all the files are added, we can commit it. This means that we have finalized what additions
and/or changes have to be made and they are now ready to be uploaded to our repository. Use
the command : Advertisement
"some_message" in the above command can be any simple message like "my first commit" or
"edit in readme", etc.
7 Creating a repository on GitHub
Create a repository on GitHub. Notice that the name of the repository should be the same as the
repository's on the local system. In this case, it will be "Mytest". To do this login to your account
on https://github.com. Then click on the "plus(+)" symbol at the top right corner of the page and
select "create new repository". Fill the details as shown in the image below and click on "create
repository" button.
Once this is created, we can push the contents of the local repository onto the GitHub repository in
your profile. Connect to the repository on GitHub using the command:
Important Note: Make sure you replace 'user_name' and 'Mytest' in the path with your Github
username and folder before running the command! Advertisement