From bbeac17a73d405781511c0eda1ce57974bb47d54 Mon Sep 17 00:00:00 2001 From: anaghapuv Date: Wed, 16 Oct 2024 17:00:10 +0530 Subject: [PATCH 1/9] Added hello.txt --- hello.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 hello.txt diff --git a/hello.txt b/hello.txt new file mode 100644 index 000000000..0ad03a948 --- /dev/null +++ b/hello.txt @@ -0,0 +1 @@ +welcome to the git workshop by coc :> \ No newline at end of file From 775ba51b6f9419cd429bd2978065b48e6cc73cd4 Mon Sep 17 00:00:00 2001 From: CarolChopde Date: Wed, 16 Oct 2024 17:00:28 +0530 Subject: [PATCH 2/9] added hallo.txt test file --- hallo.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 hallo.txt diff --git a/hallo.txt b/hallo.txt new file mode 100644 index 000000000..c744b7382 --- /dev/null +++ b/hallo.txt @@ -0,0 +1 @@ +hello carol here wippee :3 \ No newline at end of file From af1be83dd2feed67f8fef908f86ce2f1ec24f6c9 Mon Sep 17 00:00:00 2001 From: anaghapuv Date: Wed, 16 Oct 2024 17:02:10 +0530 Subject: [PATCH 3/9] Modified README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51fc1f691..525437fbb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Complete Git and Pull Request Tutorial (Git Together) -Welcome to the comprehensive Git and Pull Request tutorial for the Xplore project! This guide will walk you through the entire process of contributing to the project, from forking the repository to creating a pull request. We'll cover basic and advanced Git commands, error handling, and best practices. +Welcome to the comprehensive Git and Pull Request tutorial for the Xplore project! This guide will walk you through the entire process of contributing to the project, from forking the repository to creating a pull request. We'll cover basic and advanced Git commands, error handling, and best practice. ## Table of Contents From 8e9589e55f41e0ab5c82bcfa76cd0b452ec8e8e2 Mon Sep 17 00:00:00 2001 From: CarolChopde Date: Wed, 16 Oct 2024 17:03:19 +0530 Subject: [PATCH 4/9] modified README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51fc1f691..a0bd10ea5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Complete Git and Pull Request Tutorial (Git Together) -Welcome to the comprehensive Git and Pull Request tutorial for the Xplore project! This guide will walk you through the entire process of contributing to the project, from forking the repository to creating a pull request. We'll cover basic and advanced Git commands, error handling, and best practices. +Welcome to the comprehensive Git and Pull Request tutorial for the Xplore project! This guide will walk you through the entire process of contributing to the project, from forking the repository to creating a pull request. We'll cover basic and advanced Git commands, error handling, and best practicesss. ## Table of Contents From e9eb003388f6594496a4cb9e9e8304434daf14c2 Mon Sep 17 00:00:00 2001 From: reynyx Date: Wed, 16 Oct 2024 17:15:31 +0530 Subject: [PATCH 5/9] Added modified files --- README.md | 1 + hallo.txt | 1 + hello.txt | 0 3 files changed, 2 insertions(+) create mode 100644 hallo.txt create mode 100644 hello.txt diff --git a/README.md b/README.md index 51fc1f691..d00c5a67f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Complete Git and Pull Request Tutorial (Git Together) +ok Welcome to the comprehensive Git and Pull Request tutorial for the Xplore project! This guide will walk you through the entire process of contributing to the project, from forking the repository to creating a pull request. We'll cover basic and advanced Git commands, error handling, and best practices. ## Table of Contents diff --git a/hallo.txt b/hallo.txt new file mode 100644 index 000000000..3f4e34c2a --- /dev/null +++ b/hallo.txt @@ -0,0 +1 @@ +gedagedigedagedago \ No newline at end of file diff --git a/hello.txt b/hello.txt new file mode 100644 index 000000000..e69de29bb From ae86c84614502b3c85bc191154c70532212ae7b9 Mon Sep 17 00:00:00 2001 From: reynyx Date: Wed, 16 Oct 2024 17:39:21 +0530 Subject: [PATCH 6/9] asdfgasdfg --- 1.html | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 1.html diff --git a/1.html b/1.html new file mode 100644 index 000000000..d01f779ff --- /dev/null +++ b/1.html @@ -0,0 +1,11 @@ + + + + + + Document + + + + + \ No newline at end of file From b01735335d1e4e5e5eb66d943d19dc0d144e32ef Mon Sep 17 00:00:00 2001 From: reynyx Date: Wed, 16 Oct 2024 17:48:49 +0530 Subject: [PATCH 7/9] new html --- thedamhtml.html | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 thedamhtml.html diff --git a/thedamhtml.html b/thedamhtml.html new file mode 100644 index 000000000..76f564911 --- /dev/null +++ b/thedamhtml.html @@ -0,0 +1,11 @@ + + + + + + Document + + +

hello

+ + \ No newline at end of file From be0c713a4598b9794bb2c4348c58c0f9405f49e8 Mon Sep 17 00:00:00 2001 From: reynyx Date: Wed, 16 Oct 2024 17:58:26 +0530 Subject: [PATCH 8/9] ah shit here we go again --- thedamhtml.html | 1 + 1 file changed, 1 insertion(+) diff --git a/thedamhtml.html b/thedamhtml.html index 76f564911..bb9d0c336 100644 --- a/thedamhtml.html +++ b/thedamhtml.html @@ -7,5 +7,6 @@

hello

+

COC

\ No newline at end of file From 66339f9cc12bc425c51fe8732b50cb1fe7a9416e Mon Sep 17 00:00:00 2001 From: reynyx Date: Wed, 16 Oct 2024 18:01:53 +0530 Subject: [PATCH 9/9] resolivjbg conflict --- READMEe.md | 237 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 READMEe.md diff --git a/READMEe.md b/READMEe.md new file mode 100644 index 000000000..18974c156 --- /dev/null +++ b/READMEe.md @@ -0,0 +1,237 @@ +# Complete Git and Pull Request Tutorial (Git Together) + +<<<<<<< HEAD +<<<<<<< HEAD +ok +Welcome to the comprehensive Git and Pull Request tutorial for the Xplore project! This guide will walk you through the entire process of contributing to the project, from forking the repository to creating a pull request. We'll cover basic and advanced Git commands, error handling, and best practices. +======= +Welcome to the comprehensive Git and Pull Request tutorial for the Xplore project! This guide will walk you through the entire process of contributing to the project, from forking the repository to creating a pull request. We'll cover basic and advanced Git commands, error handling, and best practicesss. +>>>>>>> origin/Carol +======= +Welcome to the comprehensive Git and Pull Request tutorial for the Xplore project! This guide will walk you through the entire process of contributing to the project, from forking the repository to creating a pull request. We'll cover basic and advanced Git commands, error handling, and best practice. +>>>>>>> origin/anagha + +## Table of Contents + +1. [Getting Started](#getting-started) +2. [Basic Git Commands](#basic-git-commands) +3. [Making Changes](#making-changes) +4. [Advanced Git Commands](#advanced-git-commands) +5. [Creating a Pull Request](#creating-a-pull-request) +6. [Troubleshooting](#troubleshooting) +7. [Best Practices](#best-practices) +8. [Interactive Practice](#interactive-practice) + +## Getting Started + +### 1. Fork the Repository + +1. Visit the [Xplore repository](https://github.com/SharanRP/Xplore) on GitHub. +2. Click the "Fork" button in the top-right corner to create a copy in your account. + +![Forking a Repository](https://github.com/SharanRP/Xplore/assets/136159249/caaa1619-d5c7-4108-b60b-16de8d26884f) + +### 2. Clone Your Fork + +Clone your forked repository to your local machine: + +```bash +git clone https://github.com/YOUR_USERNAME/Xplore.git +``` + +Replace `YOUR_USERNAME` with your GitHub username. + +### 3. Navigate to the Project Directory + +```bash +cd Xplore +``` + +### 4. Set Up Remote + +Add the original repository as a remote to keep your fork updated: + +```bash +git remote add upstream https://github.com/SharanRP/Xplore.git +``` + +## Basic Git Commands + +### Checking Status + +View the status of your working directory: + +```bash +git status +``` + +### Creating a New Branch + +Create and switch to a new branch: + +```bash +git checkout -b feature/your-feature-name +``` + +### Viewing Branches + +List all branches: + +```bash +git branch +``` + +### Switching Branches + +Switch to an existing branch: + +```bash +git checkout branch-name +``` + +## Making Changes + +1. Make your desired changes to the codebase. +2. Stage your changes: + ```bash + git add . + ``` +3. Commit your changes: + ```bash + git commit -m "Add feature xyz" + ``` +4. Push your changes to your fork: + ```bash + git push origin feature/your-feature-name + ``` + +## Advanced Git Commands + +### Stashing Changes + +Temporarily store changes: + +```bash +git stash +``` + +Apply stashed changes: + +```bash +git stash pop +``` + +### Fetching Updates + +Fetch updates from the original repository: + +```bash +git fetch upstream +``` + +### Merging Changes + +Merge updates from the original repository: + +```bash +git checkout main +git merge upstream/main +``` + +### Rebasing + +Rebase your feature branch: + +```bash +git checkout feature/your-feature-name +git rebase main +``` + +### Using git reset + +`git reset` is a powerful command for undoing changes and managing your commit history. Use it carefully to avoid losing work. + +#### Types of reset: + +1. **Soft reset** (`--soft`): Moves HEAD but doesn't change staging area or working directory. +2. **Mixed reset** (`--mixed` or default): Moves HEAD and updates staging area. +3. **Hard reset** (`--hard`): Moves HEAD, updates staging area and working directory. + +#### Common use cases: + +- Undo last commit (keep changes): `git reset HEAD~1` +- Undo multiple commits: `git reset HEAD~n` (replace `n` with number of commits) +- Reset to specific commit: `git reset commit-hash` +- Unstage changes: `git reset HEAD file-name` +- Discard all local changes (use cautiously): `git reset --hard HEAD` + +## Creating a Pull Request + +1. Go to your forked repository on GitHub. +2. Switch to your new branch. +3. Click "New Pull Request". +4. Select the base repository and branch you want to merge into. +5. Provide a title and description for your changes. +6. Click "Create Pull Request". + +![Create Pull Request](https://github.com/SharanRP/Xplore/assets/136159249/d0c7383e-9dae-436d-af27-f5728ec90e6d) + +## Troubleshooting + +### Common Errors and Solutions + +1. **"fatal: not a git repository"** + - Solution: Ensure you're in the correct directory or initialize with `git init`. + +2. **"fatal: remote origin already exists"** + - Solution: Update the remote URL: + ```bash + git remote set-url origin https://github.com/YOUR_USERNAME/Xplore.git + ``` + +3. **"error: failed to push some refs"** + - Solution: Pull the latest changes before pushing: + ```bash + git pull origin main + ``` + +4. **"You are in 'detached HEAD' state"** + - Solution: Return to the original branch: + ```bash + git checkout branch-name + ``` + +## Best Practices + +1. Keep commits small and focused on a single change. +2. Write clear, concise commit messages. +3. Pull the latest changes from upstream before starting new work. +4. Use branches for new features or bug fixes. +5. Review your changes before committing. +6. Test your changes thoroughly before creating a pull request. + +## Interactive Practice + +Try this exercise to practice the Git workflow: + +1. Create a new branch called `practice/your-name`. +2. Create a new file called `your-name.md` with some content about yourself. +3. Stage and commit this file. +4. Push the branch to your fork. +5. Create a pull request for this branch. +6. Make a change to your file, commit, and push again. +7. Use `git reset` to undo the last commit while keeping the changes. +8. Recommit the changes with a different commit message. +9. Force push the branch to update your pull request. + +## Adding Your Information + +Please add your name and registration number below: + +- Name: [Your Name] +- Registration Number: [Your Registration Number] + +Congratulations on completing this comprehensive Git and Pull Request tutorial! Remember, practice is key to mastering Git. Don't hesitate to experiment in a test repository to gain more confidence with these commands. + +If you have any questions or encounter any issues, please don't hesitate to ask for help. Happy coding! +"# INH-git"