0% found this document useful (0 votes)
11 views

Lab#02 Introduction to GitHub-II

Uploaded by

Shayan Aamir
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Lab#02 Introduction to GitHub-II

Uploaded by

Shayan Aamir
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Lab # 02 SSUET/QR/114

LAB # 02

Introduction to GitHub

OBJECTIVE
Performing commit, push, and pull operations from eclipse repository and analyzing version
changes on Git repository.

You must know:


• How to create GitHub repository
What you’ll learn:
• How to clone repository in eclipse.
• How to add eclipse project to GitHub repository.
• How to commit, push and pull the changes.
Step 01: Create GitHub Account and SignIn
Step 02: Create a Repository.

After creating repository, copy the URL.

SWE-312 Software Construction and Development


Lab # 02 SSUET/QR/114

Step 03: Start Eclipse.


Step 04: Go to Perspective → Git Repositories → Add Git Repositories
Or
Window → Perspective → Open Perspective → Other → Add Git
Or
Search for Git Repositories

As we have already created repository in GitHub, we will now clone that repository in Eclipse.

SWE-312 Software Construction and Development


Lab # 02 SSUET/QR/114

Enter the URL copied from GitHub and then Provide login credentials and enter next.

SWE-312 Software Construction and Development


Lab # 02 SSUET/QR/114

Enter Finish

We got our repository from eclipse.


Step 05: Create a Project in Eclipse.
Step 06: Right click on Project → Team → Share → Add Git Repository (the one you
created)

SWE-312 Software Construction and Development


Lab # 02 SSUET/QR/114

Select your current repository and enter Finish. The project will be now entered in your
repository.
Step 07: Commit and Push the project to the repository.
Right Click → Team → commit

Drag and drop files from Unstaged changes to staged changes, write some commit message
and enter Commit and push.

SWE-312 Software Construction and Development


Lab # 02 SSUET/QR/114

It will ask for username and password then enter finish.

Enter Push.
Refresh GitHub, now you can see your project their in the repository you created.

Step 08: Adding classes.


Create a new class in eclipse.
Go to team, perform commit.

SWE-312 Software Construction and Development


Lab # 02 SSUET/QR/114

Drag and drop files from Unstaged changes to staged changes, write some commit message
and enter commit and push.

SWE-312 Software Construction and Development


Lab # 02 SSUET/QR/114

Go to GitHub, refresh your page.


You will see that your class has been added and saved in your repository.
(Here src folder is added which contains our java class)

Lab Task:

Create account on GitHub, add a clone git repository in eclipse and push the java project on
GitHub.

SWE-312 Software Construction and Development

You might also like