From 54a8a65d005df5e5bc26cd88f9bbbd5b4556136d Mon Sep 17 00:00:00 2001 From: Uzair Fasih Date: Tue, 10 Oct 2023 09:19:41 -0400 Subject: [PATCH 1/9] 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 2/9] 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 3/9] 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 4/9] 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 5/9] 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 6/9] 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 7/9] 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 8/9] 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 a3668c7f4bd82e3076c6131dd7c529f613440739 Mon Sep 17 00:00:00 2001 From: Kenny Thomas Date: Tue, 10 Oct 2023 10:22:31 -0400 Subject: [PATCH 9/9] Chose my Greek god --- greek_gods.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/greek_gods.txt b/greek_gods.txt index 80796e3..bbc0f1e 100644 --- a/greek_gods.txt +++ b/greek_gods.txt @@ -1 +1,2 @@ -Zeus \ No newline at end of file +Zeus +Ares \ No newline at end of file