Friday, September 20, 2019

Post#94.GitHub with Eclipse


GitHub with Eclipse ➤

GitHub is highly used software which is typically used for version control. It is helpful when more than just one person is working on a project.
Version Control System (VCS) is software that helps software developers to work together and maintain a complete history of their work.
Listed below are the functions of a VCS −
  • Allows developers to work simultaneously.
  • Does not allow overwriting each other’s changes.
  • Maintains a history of every version.
Difference between Git and GitHub
Git is a version control tool that will allow you to perform all kinds of operations to fetch data from the central server or push data to it whereas GitHub is a core hosting platform for version control collaboration.
Step 1: Creating a GitHub Repository
A repository is a storage space where your project lives. It can be local to a folder on your computer, or it can be a storage space on GitHub  or another online host. You can keep code files, text files, images or any kind of a file in a repository. You need a GitHub repository when you have done some changes and are ready to be uploaded. This GitHub repository acts as your remote repository. So let me make your task easy, just follow these simple steps to create a GitHub repository: 
  •  Go to the link: https://github.com/ . Fill the sign up form and click on “Sign up for Github”.
  •  Click on “Start a new project”.
Refer to the below screenshot to get a better understanding.

Enter any repository name and click on “Create Repository”. You can also give a description to your repository (optional).


Now, if you noticed by default a GitHub repository is public this means that anyone can view the contents of this repository whereas in a private repository, you can choose who can view the content. Also, private repository is a paid version. Also, if you refer the above screenshot, initialize the repository with a README file. This file contains the description of the file and once you check this box, this will be the first file inside your repository.

Congratulations, your repository is successfully created! It will look like the below screenshot:


Step 2: Copy the repository URL.

Step 3: Go to eclipse: In Quick Access text box Type Git and Select  option.
Select “Clone a Git Repository” Option

Now it will navigate to “Source Git Repository” window. Copy the repository URL (Step-2) and Paste it URI text box. The Host and Repository Path will be fetched automatically as shown in below.
Authentication User and Password will be your GitHub Credentials.

Click on next and finish
Now You got the Git repository into eclipse.
Create a Project in Eclipse. Here I have created a project Showcase

Right Click on the Project->Team->Share Project


Select the repository-> Finish


Then your Project will look like below
Right Click on Project->Team->Commit


Select the files that you want to commit from Unstaged changes to Staged Changes
Click on Commit and Push



Click on Next and Provide the Git Hub credentials. Then Ok


Now refresh your Git Repository. Your Projected has been pushed to your Git repository.






No comments:

Post a Comment