Skip to content
Janvi Talreja edited this page May 21, 2024 · 1 revision

Git Assignment

Objective:

This assignment aims to provide a comprehensive understanding of Git, a popular version control system (VCS). By the end of this assignment, students will be able to manage repositories, understand the configuration, stages of files, reset and revert changes, perform diffing, handle branching and merging, deal with merge conflicts, work with remotes, and use GitHub for forking and pull requests.


Part 1: Recap of VCS and Git

  1. Definition and Importance of Version Control Systems (VCS)
  • Explain what a VCS is.
  • Discuss why VCS is essential in software development.
  1. Introduction to Git
  • Describe what Git is and its main features.
  • Compare Git with other version control systems (e.g., Subversion, Mercurial).

Part 2: Repository

  1. Creating a Git Repository
  • How to initialize a new Git repository.
  • How to clone an existing repository.
  • Assignment: Create a new repository named my-first-repo and initialize it.
  1. Repository Structure
  • Explain the directory structure of a Git repository.
  • Assignment: Clone an existing repository from GitHub and explore its structure.

Part 3: Configuration

  1. Setting Up Git
  • Configure user name and email.
  • Assignment: Configure your Git environment with your name and email.

Part 4: Stages of a File

  1. Working Directory, Staging Area, and Repository
  • Explain the three stages of a file in Git.
  • Assignment: Make changes to a file, add it to the staging area, and then commit it.

Part 5: Revert

  1. Understanding Revert
  • Explain git revert and its use cases.
  • Assignment: Create a commit and then revert it.

Part 6: Diffing

  1. Using Git Diff
  • Explain the purpose of git diff.
  • How to use git diff to compare changes between commits, the working directory, and the staging area.
  • Assignment: Make some changes to a file and use git diff to view the differences.

Part 7: Branching

  1. Creating and Managing Branches
  • Explain the concept of branches in Git.
  • How to create, list, and switch branches.
  • Assignment: Create a new branch, switch to it, and make some commits.

Part 8: Merge Conflicts

  1. Understanding and Resolving Merge Conflicts
  • Explain what merge conflicts are and why they occur.
  • How to resolve merge conflicts.
  • Assignment: Create a merge conflict scenario and resolve it.

Part 9: Remote

  1. Working with Remote Repositories
  • Explain what remote repositories are.
  • How to add, fetch, pull, and push to remotes.
  • Assignment: Add a remote to your local repository and push your changes.

Part 10: GitHub

  1. Introduction to GitHub
  • Explain what GitHub is and its features.
  • How to create a repository on GitHub.
  • Assignment: Create a repository on GitHub and push your local repository to it.
  1. Forking and Pull Requests
  • Explain the concepts of forking and pull requests.
  • How to fork a repository and create a pull request.
  • Assignment: Fork a public repository, make changes, and create a pull request.

Submission:

  1. Submit a report documenting your activities for each part of the assignment.
  2. Include screenshots where applicable to demonstrate your work.
  3. Push your local repository to GitHub and submit the GitHub repository link along with your report.

Evaluation Criteria:

  • Completeness and accuracy of tasks.
  • Clarity and thoroughness of the report.
  • Proper use of Git commands and best practices.
  • Successful creation and management of repositories and branches.
  • Effective resolution of merge conflicts.
  • Proper configuration and use of remotes and GitHub features.

Additional Resources:


This assignment will help you gain practical experience with Git and GitHub, preparing you for collaborative software development in real-world projects. Happy coding!