Skip to content

Latest commit

 

History

History
72 lines (49 loc) · 4.69 KB

README.md

File metadata and controls

72 lines (49 loc) · 4.69 KB

Version Control System

Overview

This document serves as a comprehensive guide to understanding version control systems (VCS), with a focus on Git and GitHub. The learning objectives below outline key concepts and practical tasks to help you master version control workflows.

Learning Objectives

1. Version Control Software

  • Define a Repository: A repository (or repo) is a storage location for your project files and their change history.
  • Define a Commit: A commit is a snapshot of the current state of a repository, preserving changes made to files.
  • Explain the Purpose of Version Control Software: Version control systems allow multiple people to collaborate on a project, track changes, and maintain a history of those changes.
  • Differentiate Between Centralized and Distributed VCS: Understand how distributed systems like Git differ from centralized ones like Subversion (SVN).

2. Sharing History

  • Identify the Number of Commits on the Main Branch of a Remote Repository: Learn to count the commits using tools like GitHub’s interface or Git commands.
  • Identify the Author, Time, and Message of a Given Commit on GitHub: Use GitHub’s commit history view to explore these details.
  • Explain the Difference Between Pull and Push: Understand how these operations work in a remote repository.

3. Inspecting a Commit

  • Given a Remote Repository on GitHub, Identify the Files and Folders from Any Commit in a Version Timeline: Learn to browse and view the state of the project at any point in its history.
  • Understand What a Diff Represents: Learn to read changes between commits using tools like git diff or GitHub’s diff view.

4. Inspecting Previous Versions

  • Use a Git History to View Previous Versions of a Project: Leverage Git commands or GitHub’s interface to navigate the commit history.
  • Find the Commit that Corresponds to a Particular Version of a Project: Search for commits based on messages, tags, or timestamps.
  • Understand Git Tags: Learn how tags can be used to mark specific commits, such as releases.

5. Forking a Repository

  • Create a Fork of a Repository: Use GitHub’s “Fork” button to create a personal copy of another user’s repository.
  • Understand the Role of Upstream and Origin: Configure and manage connections between the original repository and your fork.

6. Working Locally

  • Clone a Remote Repository from GitHub into a Local Folder: Use the git clone command to download a repository to your local machine.
  • Define the Terms ‘Remote’ and ‘Local’ in the Context of GitHub:
    • Remote: The version of the repository hosted on a platform like GitHub.
    • Local: The version of the repository on your computer.
  • Viewing Files from a Git Clone:
    • Open a cloned repository in VSCode.
    • Explore the repository structure using VSCode’s file explorer.
    • Open the Integrated Terminal in VSCode for Git commands.
  • Pull Changes from a Remote Repository: Use git pull to fetch and merge updates from the remote repository.

7. Branching

  • Explain Why a Git Repository May Have Multiple Branches: Branches allow parallel development and experimentation without affecting the main codebase.
  • Describe What’s Special About the Branch Named main: The main branch is the default branch where the project’s primary, stable version is maintained.
  • Create a New Local Branch in a Git Repository: Use the git branch <branch-name> command to create a new branch for development.
  • Switch Between Branches: Use git checkout or git switch to move between branches.
  • Merge Branches: Use git merge to combine changes from one branch into another.

8. Wrapping Up Git

  • Commit Changes to a Local Git Branch: Use the git add, git commit, and git push commands to save and share your changes.
  • Resolve Merge Conflicts: Understand how to identify and resolve conflicts when merging branches.

Practical Tools

  • VSCode: Recommended for viewing and editing cloned repositories.
  • Integrated Terminal: Essential for running Git commands locally.
  • Git GUI Clients: Explore GUI tools like GitHub Desktop or Sourcetree for easier repository management.
  • GitHub Actions: Learn how to set up basic workflows for CI/CD directly in GitHub.

Conclusion

By mastering these concepts and tasks, you will have a solid foundation in version control with Git and GitHub, empowering you to collaborate effectively and manage projects with confidence. Continuous practice and exploration of advanced Git features will further enhance your skills.