diff --git a/2025/git/01_Git_and_Github_Basics/README.md b/2025/git/01_Git_and_Github_Basics/README.md index 589e08c57..f7c779924 100644 --- a/2025/git/01_Git_and_Github_Basics/README.md +++ b/2025/git/01_Git_and_Github_Basics/README.md @@ -11,7 +11,7 @@ Welcome to the Week 4 Challenge! In this task you will practice the essential Gi To make this challenge more difficult, additional steps have been added. You will also be required to explore SSH authentication as a bonus task. Complete all the tasks and document every step in `solution.md`. Finally, share your experience on LinkedIn (details provided at the end). --- - +Jay shree mahakal ## Challenge Tasks ### Task 1: Fork and Clone the Repository diff --git a/README.md b/README.md index c075658e1..9740827d5 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Let's come together to grow and achieve new heights in DevOps! 📖 **Discover More in Our Detailed Table of Contents!** Explore the richness of our content and find what you're looking for efficiently. Check out our [TOC here](./TOC.md). ## Steps: - +Himanshu Namdeo - Fork[https://github.com/LondheShubham153/90DaysOfDevOps/fork] the Repo. - Learn Everyday and add your learnings in the day wise folders. - Check out what others are Learning and help/learn from them. diff --git a/networking.txt b/networking.txt new file mode 100644 index 000000000..782446ccf --- /dev/null +++ b/networking.txt @@ -0,0 +1 @@ +Himanshu diff --git a/solution/gitsol.txt b/solution/gitsol.txt new file mode 100644 index 000000000..baa68a8e3 --- /dev/null +++ b/solution/gitsol.txt @@ -0,0 +1,149 @@ +Week 4: Git and GitHub Challenge +Welcome to the Week 4 Challenge! In this task you will practice the essential Git and GitHub commands and concepts taught by Shubham Bhaiya. This includes: + +Git Basics: git init, git add, git commit +Repository Management: git clone, forking a repository, and understanding how a GitHub repo is made +Branching: Creating branches (git branch), switching between branches (git switch / git checkout), and viewing commit history (git log) +Authentication: Pushing and pulling using a Personal Access Token (PAT) +Critical Thinking: Explaining why branching strategies are important in collaborative development +To make this challenge more difficult, additional steps have been added. You will also be required to explore SSH authentication as a bonus task. Complete all the tasks and document every step in solution.md. Finally, share your experience on LinkedIn (details provided at the end). + +Challenge Tasks +Task 1: Fork and Clone the Repository +Fork the Repository: + +Visit this repository and fork it to your own GitHub account. If not done yet. +Clone Your Fork Locally: + +Clone the forked repository using HTTPS: +git clone +Change directory into the cloned repository: +cd 2025/git/01_Git_and_Github_Basics +Task 2: Initialize a Local Repository and Create a File +Set Up Your Challenge Directory: + +Inside the cloned repository, create a new directory for this challenge: +mkdir week-4-challenge +cd week-4-challenge +Initialize a Git Repository: + +Initialize the directory as a new Git repository: +git init +Create a File: + +Create a file named info.txt and add some initial content (for example, your name and a brief introduction). +Stage and Commit Your File: + +Stage the file: +git add info.txt +Commit the file with a descriptive message: +git commit -m "Initial commit: Add info.txt with introductory content" +Task 3: Configure Remote URL with PAT and Push/Pull +Configure Remote URL with Your PAT: +To avoid entering your Personal Access Token (PAT) every time you push or pull, update your remote URL to include your credentials. + +⚠️ Note: Embedding your PAT in the URL is only for this exercise. It is not recommended for production use. + +Replace , , and with your actual GitHub username, your PAT, and the repository name respectively: + +git remote add origin https://:@github.com//90DaysOfDevOps.git +If a remote named origin already exists, update it with: + +git remote set-url origin https://:@github.com//90DaysOfDevOps.git +Push Your Commit to Remote: + +Push your current branch (typically main) and set the upstream: +git push -u origin main +(Optional) Pull Remote Changes: + +Verify your configuration by pulling changes: +git pull origin main +Task 4: Explore Your Commit History +View the Git Log: +Check your commit history using: +git log +Take note of the commit hash and details as you will reference these in your documentation. +Task 5: Advanced Branching and Switching +Create a New Branch: + +Create a branch called feature-update: +git branch feature-update +Switch to the New Branch: + +Switch using git switch: +git switch feature-update +Alternatively, you can use: +git checkout feature-update +Modify the File and Commit Changes: + +Edit info.txt (for example, add more details or improvements). +Stage and commit your changes: +git add info.txt +git commit -m "Feature update: Enhance info.txt with additional details" +git push origin feature-update +Merge this branch to main via a Pull Request on GitHub. +(Advanced) Optional Extra Challenge: + +If you feel confident, create another branch (e.g., experimental) from your main branch, make a conflicting change to info.txt, then switch back to feature-update and merge experimental to simulate a merge conflict. Resolve the conflict manually, then commit the resolution. +Note: This extra step is optional and intended for those looking for an additional challenge. + +Task 6: Explain Branching Strategies +Document Your Process: +Create (or update) a file named solution.md in your repository. +List all the Git commands you used in Tasks 1–4. +Explain: Write a brief explanation on why branching strategies are important in collaborative development. Consider addressing: +Isolating features and bug fixes +Facilitating parallel development +Reducing merge conflicts +Enabling effective code reviews +Bonus Task: Explore SSH Authentication +Generate an SSH Key (if not already set up): + +Create an SSH key pair: +ssh-keygen +Follow the prompts and then locate your public key (typically found at ~/.ssh/id_ed25519.pub). +Add Your SSH Public Key to GitHub: + +Copy the contents of your public key and add it to your GitHub account under SSH and GPG keys. +(See Connecting to GitHub with SSH for help.) +Switch Your Remote URL to SSH: + +Change the remote URL from HTTPS to SSH: +git remote set-url origin git@github.com:/90DaysOfDevOps.git +Push Your Branch Using SSH: + +Test the SSH connection by pushing your branch: +git push origin feature-update +📢 How to Submit +Push Your Final Work: + +Ensure your branch (e.g., feature-update) with the updated solution.md file is pushed to your fork. +Create a Pull Request (PR): + +Open a PR from your branch to the main repository. +Use a clear title such as: +Week 4 Challenge - DevOps Batch 9: Git & GitHub Advanced Challenge +In the PR description, summarize your process and list the Git commands you used. +Share Your Experience on LinkedIn: + +Write a LinkedIn post summarizing your Week 4 experience. +Include screenshots or logs of your tasks. +Use hashtags: #90DaysOfDevOps #GitGithub #DevOps +Optionally, share any blog posts, GitHub repos, or articles you create about this challenge. +Additional Resources +Git Documentation: +https://git-scm.com/docs + +Creating a Personal Access Token: +GitHub PAT Setup + +Forking and Cloning Repositories: +Fork a Repository | Cloning a Repository + +SSH Authentication with GitHub: +Connecting to GitHub with SSH + +Understanding Branching Strategies: +Git Branching Strategies + +