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

Git Version Control

This document provides a step-by-step guide for creating a GitHub account, setting up a Git repository, and using Git for version control and configuration management. It includes instructions for cloning the repository, adding project files, committing changes, and pushing updates to GitHub. By following these steps, users will establish a GitHub repository with version control capabilities.

Uploaded by

ankitkumar8291
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)
4 views

Git Version Control

This document provides a step-by-step guide for creating a GitHub account, setting up a Git repository, and using Git for version control and configuration management. It includes instructions for cloning the repository, adding project files, committing changes, and pushing updates to GitHub. By following these steps, users will establish a GitHub repository with version control capabilities.

Uploaded by

ankitkumar8291
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/ 2

Git Version Control & Configuration Management

Objectives:

 Create a Git (or GitHub) account


 Set up and configure a Git repository
 Upload artifacts to the repository
 Use Git for version control and basic configuration management

Prerequisites:

 A computer with Git installed (run git --version to check)


 Basic command-line knowledge

Step 1: Create a GitHub Account

1. Go to https://github.com
2. Click Sign Up
3. Fill in required details and verify your email
4. Log in to your new GitHub account

Step 2: Create and Configure a Repository

1. After logging in, click + in the top-right corner → New repository


2. Set:
o Repository name: my-first-repo
o Description: (optional)
o Choose Public or Private
o Check Initialize with a README
3. Click Create repository

Step 3: Clone the Repository to Your Local Machine

1. Open your terminal


2. Run the following (replace <your-username>):
git clone https://github.com/<your-username>/my-first-repo.git

cd my-first-repo

Step 4: Add Artifacts (Your Project Files)

1. Create or copy files into the repository folder, e.g.:


echo "Hello Git" > hello.txt

mkdir src

echo "print('Hello')" > src/app.py


Add files to Git:
git add .

Commit your changes:

git commit -m "Add initial project files"

Push to GitHub:

git push -u origin main

Step 5: Make a Change and Version It


1. Modify hello.txt:
echo "Version 2 update" >> hello.txt

2. Stage, commit, and push:


git add hello.txt
git commit -m "Updated hello.txt with version 2"
git push origin main

Summary:

 You now have a GitHub repo with version control


 You’ve uploaded files, made changes, and tracked them with Git

You might also like