From 54a8a65d005df5e5bc26cd88f9bbbd5b4556136d Mon Sep 17 00:00:00 2001 From: Uzair Fasih Date: Tue, 10 Oct 2023 09:19:41 -0400 Subject: [PATCH 01/12] Initial commit --- greek_gods.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/greek_gods.txt b/greek_gods.txt index e69de29..80796e3 100644 --- a/greek_gods.txt +++ b/greek_gods.txt @@ -0,0 +1 @@ +Zeus \ No newline at end of file From 809ba6c03f579cf4e4a9df3a8db9b04e09244ee7 Mon Sep 17 00:00:00 2001 From: Uzair Fasih Date: Tue, 10 Oct 2023 09:31:22 -0400 Subject: [PATCH 02/12] Changed god --- greek_gods.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/greek_gods.txt b/greek_gods.txt index 80796e3..c298119 100644 --- a/greek_gods.txt +++ b/greek_gods.txt @@ -1 +1 @@ -Zeus \ No newline at end of file +Odin \ No newline at end of file From dade5c00d7e2860cc7f0197ddd719c4832153dd0 Mon Sep 17 00:00:00 2001 From: Uzair Fasih Date: Tue, 10 Oct 2023 09:39:33 -0400 Subject: [PATCH 03/12] Made an edit --- greek_gods.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/greek_gods.txt b/greek_gods.txt index c298119..80796e3 100644 --- a/greek_gods.txt +++ b/greek_gods.txt @@ -1 +1 @@ -Odin \ No newline at end of file +Zeus \ No newline at end of file From 6ce698e573cf31f111a5160ece2ce1ff3e41e24a Mon Sep 17 00:00:00 2001 From: Uzair Fasih Date: Tue, 10 Oct 2023 09:48:32 -0400 Subject: [PATCH 04/12] Updated readme --- README.md | 54 +++++++++++++++++++----------------------------------- 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index d027d6e..a551082 100644 --- a/README.md +++ b/README.md @@ -22,14 +22,21 @@ By the end of this tutorial, you should be able to: Start by cloning the existing repository. This repository is located on a remote server, which is typically GitHub for most projects. By cloning it, you create a local copy on your machine which you can edit and push back to the remote repository. ```bash -$ git clone https://github.com/Waseem0912-coder/Introduction_to_Git +$ git clone https://github.com/Uzair-Fasih/Introduction_to_Git/ +``` + +If you check the repo, you'll find two branches `main` and `dev` + +```bash +$ git branch --list ``` #### 2. Create a New Branch: -To avoid conflicts with the main codebase, always work on a new branch. +Checkout out the `dev` branch and then create a new branch from dev using the following command ```bash +$ git checkout dev $ git checkout -b [your_name]-choice ``` @@ -37,9 +44,8 @@ Replace `[your_name]` with your actual name. #### 3. Choose Your Greek God: -Open the provided text file in the repository. Choose one Greek god from the following list and add it to the file: +Open the provided text file `greek_gods.tx` in the repository. Choose one Greek god from the following list and add it to the file: -- Zeus - Hera - Poseidon - Demeter @@ -64,23 +70,20 @@ $ git commit -m "Chose my Greek god" $ git push origin [your_name]-choice ``` -#### 5. Rebase: +#### 5. Raise a Pull Request: -Before raising a PR, ensure your branch has the latest changes from the main branch of the remote repository. Rebasing allows you to apply your changes on top of the latest changes in the main branch. +Now, return to the GitHub repository online: -```bash -$ git checkout main -$ git pull origin main -$ git checkout [your_name]-choice -$ git rebase main -``` +1. Click on "Pull Requests". +2. Select "New Pull Request". +3. For the base branch, choose "main". For the compare branch, pick your branch (`[your_name]-choice`). +4. Review your changes and click "Create Pull Request". +5. Add a title and description for your PR and submit. -If you encounter conflicts during the rebase (which is expected given the Greek god choice), proceed to step 6. If not, move on to step 7. +If you encounter conflicts during the PR (which is expected given the Greek god choice), proceed to step 6. #### 6. Resolve Merge Conflicts: -Multiple students might have chosen the same Greek god, leading to a merge conflict. - Open the text file, and you'll see conflict markers: ``` @@ -97,25 +100,6 @@ To resolve this: 2. Remove the conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`). 3. Save the file. -After resolving all conflicts: - -```bash -$ git add . -$ git rebase --continue -``` - -If more conflicts arise, resolve them. Once there are no more conflicts, the rebase will conclude. - -#### 7. Raise a Pull Request: - -Now, return to the GitHub repository online: - -1. Click on "Pull Requests". -2. Select "New Pull Request". -3. For the base branch, choose "main". For the compare branch, pick your branch (`[your_name]-choice`). -4. Review your changes and click "Create Pull Request". -5. Add a title and description for your PR and submit. - ---- +After resolving all conflicts, create the PR Congratulations! You've now tackled changes, navigated conflicts, and initiated a PR. Handling merge conflicts can seem daunting at first, but with practice, it becomes intuitive. This exercise imparts the collaborative flow of team projects using Git and GitHub, enhancing your version control skills. From a2bf1721459bdeda65b2947283443598fe28c509 Mon Sep 17 00:00:00 2001 From: Uzair Fasih Date: Tue, 10 Oct 2023 09:50:11 -0400 Subject: [PATCH 05/12] Fixed readme --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a551082..300c8a1 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,8 @@ By the end of this tutorial, you should be able to: 1. Clone a repository. 2. Make changes and push them. -3. Resolve merge conflicts. -4. Use the rebase command. -5. Raise a pull request (PR). +3. Raise a pull request (PR). +4. Resolve merge conflicts. ### Let's Get Started! From d35ceec39f32f266cc98ce5cb30fd53a1a583370 Mon Sep 17 00:00:00 2001 From: Uzair Fasih Date: Tue, 10 Oct 2023 09:57:07 -0400 Subject: [PATCH 06/12] Updated readme --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 300c8a1..747841a 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,14 @@ By the end of this tutorial, you should be able to: ### Let's Get Started! -#### 1. Clone the Repository: +#### 1. Fork the Repository: -Start by cloning the existing repository. This repository is located on a remote server, which is typically GitHub for most projects. By cloning it, you create a local copy on your machine which you can edit and push back to the remote repository. +Start by forking the existing repository. This repository is located on a remote server, which is typically GitHub for most projects. By forking it, you create a local copy which you can edit and push back to the remote repository. + +Next clone the repo ```bash -$ git clone https://github.com/Uzair-Fasih/Introduction_to_Git/ +$ git clone https://github.com/[YOUR_GITHUB_ID]/Introduction_to_Git/ ``` If you check the repo, you'll find two branches `main` and `dev` From 28113159613728a99e15ea58c9422c27f1439565 Mon Sep 17 00:00:00 2001 From: Uzair Fasih Date: Tue, 10 Oct 2023 10:01:53 -0400 Subject: [PATCH 07/12] Updated readme 2 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 747841a..eba35e8 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Next clone the repo $ git clone https://github.com/[YOUR_GITHUB_ID]/Introduction_to_Git/ ``` -If you check the repo, you'll find two branches `main` and `dev` +If you check the repo, you'll find two branches `main` and `dev` (You may not see the `dev` branch since it's remote) ```bash $ git branch --list @@ -85,7 +85,7 @@ If you encounter conflicts during the PR (which is expected given the Greek god #### 6. Resolve Merge Conflicts: -Open the text file, and you'll see conflict markers: +Open the text file on GitHub by selecting the option to `Resolve Conflicts`, and on the web editor you'll see conflict markers: ``` <<<<<<< HEAD @@ -97,7 +97,7 @@ Athena To resolve this: -1. Decide which choice to keep or combine them. +1. Decide which choice to keep or combine them (in this case, keep your changes). 2. Remove the conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`). 3. Save the file. From 1b90ebe9827bd41cf328edce8c52b5163a345272 Mon Sep 17 00:00:00 2001 From: Uzair Fasih Date: Tue, 10 Oct 2023 10:11:37 -0400 Subject: [PATCH 08/12] Updated readme 3 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index eba35e8..0f3d06f 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ By the end of this tutorial, you should be able to: Start by forking the existing repository. This repository is located on a remote server, which is typically GitHub for most projects. By forking it, you create a local copy which you can edit and push back to the remote repository. +> When you fork the project, make sure to unselect the option to Copy the main branch only only + Next clone the repo ```bash From 70e61a8a989b496012aca7422b6cf6e6d53a642c Mon Sep 17 00:00:00 2001 From: Uzair Fasih Date: Tue, 10 Oct 2023 10:21:44 -0400 Subject: [PATCH 09/12] Updated readme 4 --- README.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0f3d06f..2d7cd7b 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ By the end of this tutorial, you should be able to: Start by forking the existing repository. This repository is located on a remote server, which is typically GitHub for most projects. By forking it, you create a local copy which you can edit and push back to the remote repository. -> When you fork the project, make sure to unselect the option to Copy the main branch only only +> When you fork the project, make sure to unselect the option to Copy the main branch only Next clone the repo @@ -28,18 +28,18 @@ Next clone the repo $ git clone https://github.com/[YOUR_GITHUB_ID]/Introduction_to_Git/ ``` -If you check the repo, you'll find two branches `main` and `dev` (You may not see the `dev` branch since it's remote) +If you check the repo, you should see the two branches `main` and `dev` ```bash -$ git branch --list +$ git branch -a ``` #### 2. Create a New Branch: -Checkout out the `dev` branch and then create a new branch from dev using the following command +Checkout out the remote `dev` branch and then create a new branch from dev using the following command ```bash -$ git checkout dev +$ git checkout remotes/origin/dev $ git checkout -b [your_name]-choice ``` @@ -79,7 +79,7 @@ Now, return to the GitHub repository online: 1. Click on "Pull Requests". 2. Select "New Pull Request". -3. For the base branch, choose "main". For the compare branch, pick your branch (`[your_name]-choice`). +3. For the base branch, choose "main" **from your Fork**. For the compare branch, pick your branch (`[your_name]-choice`) **from your Fork**. 4. Review your changes and click "Create Pull Request". 5. Add a title and description for your PR and submit. @@ -105,4 +105,9 @@ To resolve this: After resolving all conflicts, create the PR -Congratulations! You've now tackled changes, navigated conflicts, and initiated a PR. Handling merge conflicts can seem daunting at first, but with practice, it becomes intuitive. This exercise imparts the collaborative flow of team projects using Git and GitHub, enhancing your version control skills. +#### 6. Merge the PR + +Finally, merge the PR. + +Congratulations! You've now tackled changes, navigated conflicts, and initiated a PR. Handling merge conflicts can seem daunting at first, but with practice, it becomes intuitive. This exercise imparts the collaborative flow of team projects using Git and +GitHub, enhancing your version control skills. From cc757a31223f9cdaa256f2d244bb7da70a138f8e Mon Sep 17 00:00:00 2001 From: Uzair Fasih Date: Tue, 10 Oct 2023 10:44:14 -0400 Subject: [PATCH 10/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d7cd7b..48d43df 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Replace `[your_name]` with your actual name. #### 3. Choose Your Greek God: -Open the provided text file `greek_gods.tx` in the repository. Choose one Greek god from the following list and add it to the file: +Open the provided text file `greek_gods.tx` in the repository. Choose one Greek god from the following list and __replace__ the one in the file: - Hera - Poseidon From 2b1547ce3a9353935e80e37972d8754ad66351ad Mon Sep 17 00:00:00 2001 From: Uzair Fasih Date: Tue, 10 Oct 2023 10:47:04 -0400 Subject: [PATCH 11/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 48d43df..33e5338 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## Git Tutorial: Handling Merges, Rebases, and Pull Requests +## Git Tutorial: Handling Merges and Pull Requests ### Prerequisites: From a34fa08ff2f77656d6f076e892ea4293b2750413 Mon Sep 17 00:00:00 2001 From: lnsidiou5 <133141678+lnsidiou5@users.noreply.github.com> Date: Tue, 10 Oct 2023 12:08:52 -0400 Subject: [PATCH 12/12] Chose Greek God --- greek_gods.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/greek_gods.txt b/greek_gods.txt index 80796e3..2ab6151 100644 --- a/greek_gods.txt +++ b/greek_gods.txt @@ -1 +1 @@ -Zeus \ No newline at end of file +Hera