0% found this document useful (0 votes)
10 views4 pages

GitHub Guide

This document provides a comprehensive guide on using GitHub for managing practical sessions in the IT1214 Object-Oriented Programming Design course. It covers creating a GitHub account, setting up a repository, managing practical files, and accessing the repository from different computers. Additionally, it outlines the typical Git workflow and common Git commands for effective version control and collaboration.

Uploaded by

jestudio22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views4 pages

GitHub Guide

This document provides a comprehensive guide on using GitHub for managing practical sessions in the IT1214 Object-Oriented Programming Design course. It covers creating a GitHub account, setting up a repository, managing practical files, and accessing the repository from different computers. Additionally, it outlines the typical Git workflow and common Git commands for effective version control and collaboration.

Uploaded by

jestudio22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Using GitHub for IT1214 Object-Oriented

Programming Design Practical Sessions


Dr.S.Kirushanth
Department of Physical Science
March 21, 2025

1 Introduction
GitHub is a widely used platform for version control and collaboration. In this
guide, we will walk through the steps required to set up a GitHub repository for
recording practical sessions in the IT1214 Object-Oriented Programming Design
course. We will learn how to create a GitHub account, set up a repository, and
manage their practical files using Git Bash.

2 Creating a GitHub Account


1. Visit https://github.com.

2. Click on Sign Up and fill in the required details. It is recommended to


use your personal email.
3. Verify your email and log in to your GitHub account.

3 Setting Up a Repository
1. After logging in, click on the + icon in the top-right corner and select
New repository.
2. Provide a repository name (e.g., “IT1214-Practicals”).

3. Choose visibility as Public.


4. Click Create repository.

1
4 Installing Git and Accessing the Repository
1. Download Git from https://git-scm.com/ and install it.
2. Open Git Bash.
3. Configure Git with your credentials:
git config == g l o b a l u s e r . name ”Your Name”
git config == g l o b a l u s e r . e m a i l ” your =email@example . com”

4. Clone the repository to your local system:


g i t c l o n e h t t p s : / / g i t h u b . com/ your =username / IT1214 = P r a c t i c a l s . g i t

Note: Replace ”Your Name”, ”your-email@example.com”, and ”your-username”


with appropriate values.

5 Managing Practical Files


5.1 Adding and Committing Files
1. Navigate to the cloned repository:
cd IT1214 = P r a c t i c a l s

2. Copy your practical files into this folder.


3. Add the files to the Git staging area:
g i t add .

4. Commit the files with a meaningful message:


g i t commit =m ”Added p r a c t i c a l s e s s i o n files”

5.2 Pushing Files to GitHub


1. Push the committed changes to the remote repository:
g i t push o r i g i n main

6 Viewing Files on GitHub


1. Visit https://github.com and log in.
2. Navigate to your repository (e.g., https://github.com/your-username/
IT1214-Practicals).
3. Verify that your committed files are present in the repository.

2
7 Accessing the Repository from Another Com-
puter
To continue working on your project from another computer, follow these steps:

1. Install Git if not already installed (https://git-scm.com/).


2. Open Git Bash and navigate to your working directory.
3. Clone the repository:
g i t c l o n e h t t p s : / / g i t h u b . com/ your =username / IT1214 = P r a c t i c a l s . g i t

4. Move into the cloned directory:


cd IT1214 = P r a c t i c a l s

5. Pull the latest updates before making changes:


g i t p u l l o r i g i n main

6. Continue working, adding, committing, and pushing files as described ear-


lier.

8 Repository Workflow Overview


A typical Git workflow involves cloning a repository, making changes in a local
branch, committing those changes, pushing them to the remote repository, and
then potentially merging the branch back into the main branch. Here’s a more
detailed breakdown of the process:

1. Cloning a Repository:
g i t c l o n e <r e p o s i t o r y u r l >:
This command c r e a t e s a l o c a l copy o f t h e remote r e p o s i t o r y on your machine .
This l o c a l copy i n c l u d e s a l l f i l e s , d i r e c t o r i e s , and t h e c o m p l e t e v e r s i o n
history .

2. Working with a Local Branch:


Create a Branch:
g i t c h e c k o u t =b <branch name >: C r e a t e a new branch f o r your work ,
a l l o w i n g you t o i s o l a t e your c h a n g e s from t h e main c o d e b a s e .

Make Changes: Modify the files in your working directory. Stage Changes:
g i t add < f i l e o r d i r e c t o r y >: Add t h e m o d i f i e d f i l e s t o t h e s t a g i n g area ,
p r e p a r i n g them f o r committing .

3
Commit Changes:
g i t commit =m ”<commit message >”: C r e a t e a s n a p s h o t o f t h e
s t a g e d c h a n g e s with a d e s c r i p t i v e message .

3. Pushing to the Remote Repository:


Push Changes :
g i t push o r i g i n <branch name >: Upload your l o c a l commits t o t h e
remote r e p o s i t o r y , making them a v a i l a b l e t o o t h e r d e v e l o p e r s .

Pull Requests :
I f you a r e c o n t r i b u t i n g t o a p r o j e c t , you w i l l l i k e l y submit a
p u l l r e q u e s t t o p r o p o s e your c h a n g e s f o r r e v i e w and merging .

4. Merging Changes:
Merge Changes :
g i t merge <branch name >: I n t e g r a t e t h e c h a n g e s from a branch
i n t o t h e main branch ( e . g . , main o r d e v e l o p ) .
Resolving Co nfl ict s :
I f t h e r e a r e c o n f l i c t s , you w i l l need t o r e s o l v e them manually and then
commit t h e c h a n g e s .

5. Other Common Git Commands:


g i t s t a t u s : D i s p l a y s t h e s t a t u s o f your working d i r e c t o r y , showing
which f i l e s have been m o d i f i e d , added , o r s t a g e d .

g i t l o g : Shows t h e commit h i s t o r y o f t h e r e p o s i t o r y .
g i t branch : L i s t s a l l t h e b r a n c h e s i n t h e r e p o s i t o r y .
g i t f e t c h : Downloads t h e l a t e s t c h a n g e s from t h e remote r e p o s i t o r y w i t h o u t
merging them .
g i t p u l l : F e t c h e s c h a n g e s from t h e remote r e p o s i t o r y and merges them
i n t o your c u r r e n t branch .

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy