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

Git Basics: Version Control Workflow

Uploaded by

mukeshchevula
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 views4 pages

Git Basics: Version Control Workflow

Uploaded by

mukeshchevula
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

Roll No: 160122733033 Exp No 1 Date : 25-07-2025

WEEK-1

Aim:

To learn and demonstrate the basic usage of Git for version control, including initialising a
repository, configuring user details, staging and committing files, creating branches, pushing to
remote repositories, and switching between branches.

Description:
This experiment covers the basic workflow in Git, including:

1. Configuring user information ([Link] and [Link])


2. Initialising a new Git repository
3. Adding and committing files
4. Connecting to a remote repository
5. Creating and switching branches
6. Pushing branches to GitHub
7. Observing the status at each step

Code :

git --version

mkdir 160122733053
cd 160122733053

git config --global [Link] "bandarirohit@[Link]"


git config --global [Link] "bandarirohit"

git init

git status

# Creating a new file ([Link])


echo "" > [Link]

git add [Link]


git status

git commit -m "1st file added on 10-07-2025 11:37"


git status

# List files tracked by git


git ls-files

# Add a remote repository (replace URL with your own repo)


git remote add origin [Link]
git remote show origin

# Create a new file ([Link])


echo "" > [Link]
git add [Link]

Page 1
Roll No: 160122733033 Exp No 1 Date : 25-07-2025

git commit -m "added file2 on 10-07-2025 12:12PM"

# Create and switch branches


git branch qa
git checkout qa

# List all branches


git branch

# Push branches to remote


git push -u origin qa
git checkout master
git push -u origin master

# View commit log


git log

# Show remote details


git remote -v

Output:

Page 2
Roll No: 160122733033 Exp No 1 Date : 25-07-2025

Page 3
Roll No: 160122733033 Exp No 1 Date : 25-07-2025

Output Analysis:

The user successfully configures their identity for commits. Initializes a Git repository and creates/
commits the files ([Link], [Link]). Sets up a remote repository and confirms the
configuration. Creates and switches to a new branch (qa). Code and branches are pushed to the
remote repository on GitHub, confirming successful authentication and data upload. The commands
verify that the working tree is clean after each operation and that branches are up to date with their
remote counterparts. Final command shows switching between branches and keeping them in sync.

Key Takeaways:
• User is able to manage both master and feature (qa) branches.
• Local changes and their statuses are tracked throughout the process.
• Remote repository operations (push) are successfully performed for both branches.
• Branch switching allows for isolated development and parallel work.
• Frequent use of git status and git log provides clear feedback and state awareness.

Conclusion:
This experiment demonstrates the fundamental Git operations required for effective version control
in software development, including initialising a repository, committing changes, branching, and
interacting with remote repositories. The practical steps shown here are essential for collaborative
and individual development workflows, ensuring that code changes are safely tracked and managed
at every step.

Page 4

You might also like