From 89339f96e0c8355f2ff695b75761f9c0bcf50468 Mon Sep 17 00:00:00 2001 From: clairezhechen Date: Sun, 25 Aug 2024 21:24:23 -0400 Subject: [PATCH 1/2] Add README.md with initial content --- 02_activities/assignments/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 02_activities/assignments/README.md diff --git a/02_activities/assignments/README.md b/02_activities/assignments/README.md new file mode 100644 index 0000000..65cf247 --- /dev/null +++ b/02_activities/assignments/README.md @@ -0,0 +1 @@ +# Git Assignment - From 1f1c468164427b6ffbd7de08ccae09431dbeaedf Mon Sep 17 00:00:00 2001 From: clairezhechen Date: Sun, 25 Aug 2024 21:29:12 -0400 Subject: [PATCH 2/2] Answer all the questions --- 02_activities/assignments/README.md | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/02_activities/assignments/README.md b/02_activities/assignments/README.md index 65cf247..38bdf9a 100644 --- a/02_activities/assignments/README.md +++ b/02_activities/assignments/README.md @@ -1 +1,45 @@ # Git Assignment - + +### a. What is an issue? + +An issue is a tool for tracking tasks, enhancements, bugs, or questions in a GitHub repository. It allows collaborators and contributors to discuss the issue and track its progress until it is resolved or closed. + +### b. What is a pull request? + +A pull request (PR) is a feature on GitHub that allows a user to notify project maintainers about changes they have made in a branch. The maintainers can review the changes, discuss potential modifications, and merge the changes into the main branch if they are approved. + +### c. Describe the steps to open a pull request? + +1. Push your changes to a branch in the repository. +2. Navigate to the repository on GitHub. +3. Click the "Compare & pull request" button next to the branch you want to merge. +4. Write a title and description for the pull request, explaining what changes have been made. +5. Submit the pull request. +6. Reviewers can then comment on the pull request and approve or request further changes. + +### d. Describe the steps to add a collaborator to a repository (share write permissions) + +1. Go to the GitHub repository you want to share. +2. Click on the "Settings" tab. +3. In the left sidebar, click "Collaborators & teams". +4. Click the "Add people" button. +5. Enter the GitHub username or email of the person you want to add. +6. Select the appropriate permissions level (e.g., write, read, or admin). +7. Click "Add collaborator" to send an invitation to the user. + +### e. What is the difference between git and GitHub? + +Git is a distributed version control system that allows developers to track changes in source code during software development. It enables multiple developers to work on the same project simultaneously without interfering with each other's changes. +GitHub, on the other hand, is a cloud-based platform that hosts Git repositories. It provides a web-based interface for Git and offers additional features like pull requests, issue tracking, and collaboration tools. + +### f. What does git diff do? + +The `git diff` command shows the differences between the working directory and the staging area, or between the staging area and the last commit. It highlights the changes that have been made but not yet committed, helping developers review modifications before committing them. + +### g. What is the main branch? + +The main branch (formerly known as `master`) is the default branch in a Git repository. It typically contains the production-ready version of the code. Changes and new features are usually developed in separate branches and then merged into the main branch once they are stable and ready for deployment. + +### h. Besides our initial commit if it is a new repository, should we directly push our changes directly into the main branch? + +No, it's generally recommended to work on a separate branch rather than directly on the main branch. By doing so, you can isolate your changes and keep the main branch clean and stable. Once your work is complete and reviewed, you can merge the changes into the main branch through a pull request.