diff --git a/.github/.keep b/.github/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/README.md b/README.md index f70523423..9d0af8047 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-22041afd0340ce965d47ae6ef1cefeee28c7c493a6346c4f15d667ab976d596c.svg)](https://classroom.github.com/a/8wgCKhpZ) +[![Open in Visual Studio Code](https://classroom.github.com/assets/open-in-vscode-2e0aaae1b6195c2367325f4f02e2d04e9abb55f0b24a779b69b11b9e10269abc.svg)](https://classroom.github.com/online_ide?assignment_repo_id=18403592&assignment_repo_type=AssignmentRepo) # se-day-2-git-and-github ## Explain the fundamental concepts of version control and why GitHub is a popular tool for managing versions of code. How does version control help in maintaining project integrity? diff --git a/index.html b/index.html new file mode 100644 index 000000000..9e2ce30e8 --- /dev/null +++ b/index.html @@ -0,0 +1,57 @@ +##Fundamentals of Version Control and GitHub’s Popularity Version control is a +system that tracks changes to files over time, allowing developers to manage, +collaborate, and revert to previous versions if needed. Why GitHub is Popular: +Distributed Version Control – Uses Git, allowing developers to work offline and +sync changes later. Collaboration Features – Includes branches, pull requests, +and code review tools. Backup & Security – Stores code safely with cloud +backups. Integration & Automation – Supports CI/CD, issue tracking, and project +management tools. Maintaining Project Integrity: Keeps track of changes and +authorship. Prevents conflicts in collaborative environments. Enables rollback +to stable versions in case of errors. ##Setting Up a New GitHub Repository +Steps: Sign in to GitHub – Go to GitHub and log in. Create a New Repository – +Click the "+" in the top-right corner → "New repository." Repository Name – +Choose a meaningful name. Visibility Options: Public: Anyone can view the repo. +Private: Only invited collaborators can access. Initialize with: README +(optional, but recommended). .gitignore (to exclude unnecessary files). License +(defines usage rights). Click "Create Repository" – Your repository is now +ready. ##Importance of the README File A README file is the first document +people see when they visit a repository. It should include: Project Description +– What the project does. Installation Instructions – How to set it up. Usage – +Examples and commands. Contributors – How others can contribute. License & +Acknowledgments – If applicable. A well-written README improves onboarding and +collaboration. Public vs. Private Repositories Feature Public Repo Private Repo +Visibility Open to all Restricted to collaborators Collaboration Anyone can fork +& contribute Only authorized users Security Risk of exposing sensitive data More +control over access Best Use Cases Open-source projects, community collaboration +Proprietary code, confidential work ##Making Your First Commit git init git add +. git commit -m "Initial commit" git push -u origin main Branching in Git +Branches allow developers to work on features separately without affecting the +main codebase. Typical Workflow: Create a branch bash Copy Edit git branch +feature-branch git checkout feature-branch or bash Copy Edit git switch -c +feature-branch Make changes and commit bash Copy Edit git add . git commit -m +"Added new feature" Merge the branch (once tested) bash Copy Edit git checkout +main git merge feature-branch Branching ensures smoother collaboration and code +isolation. Pull Requests and Code Review A pull request (PR) is used to propose +changes before merging them. Steps: Push changes to GitHub: bash Copy Edit git +push origin feature-branch Open GitHub → Navigate to the repo → Click “Pull +Requests.” Click “New Pull Request” → Select feature-branch → main. Add a +description and reviewers. Code Review – Others review and approve changes. +Merge PR – Once approved, click “Merge Pull Request.” Pull requests ensure +quality control before changes are merged. Forking vs. Cloning Feature Forking +Cloning What it does Creates a copy of a repository under your account Copies a +repo to your local machine Ownership Independent from the original Directly +linked to the original Best for Contributing to open-source projects Working on +personal or team projects When to Use Forking: Contributing to open-source +projects. Experimenting without affecting the original repo. Issues and Project +Boards GitHub Issues help track bugs, tasks, and feature requests. GitHub +Project Boards (Kanban-style) organize tasks visually. #How They Improve +Collaboration: 1)Track progress with labels, milestones, and assignees. +2)Enhance transparency for teams. 3)Improve prioritization with task management. +Example: A team managing bug fixes and feature requests can use GitHub Issues to +assign tasks and track resolutions. Common GitHub Challenges & Best Practices +Challenges New Users Face: Merge Conflicts → When multiple changes affect the +same file. Solution: Use git pull before pushing changes and resolve conflicts +manually. Accidentally pushing sensitive data. Solution: Use a .gitignore file +and avoid committing credentials. Unclear commit messages. Solution: Follow best +practices like: bash Copy Edit git commit -m "Fix login bug by updating +validation logic"