Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2025/git/01_Git_and_Github_Basics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Remove non-technical/personal line to keep docs neutral and professional.

“Jay shree mahakal” is out of scope for technical documentation and may not be appropriate for a community repo.

Apply this diff:

-Jay shree mahakal
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Jay shree mahakal
🧰 Tools
🪛 LanguageTool

[grammar] ~14-~14: There might be a mistake here.
Context: ...ls provided at the end). --- Jay shree mahakal ## Challenge Tasks ### Task 1: Fork and Cl...

(QB_NEW_EN)

🤖 Prompt for AI Agents
In 2025/git/01_Git_and_Github_Basics/README.md around line 14, remove the
personal/non-technical line "Jay shree mahakal" to keep the documentation
neutral and professional; edit the file to delete that line and ensure
surrounding content and formatting remain consistent (no other text changes).

## Challenge Tasks

### Task 1: Fork and Clone the Repository
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions networking.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Himanshu
149 changes: 149 additions & 0 deletions solution/gitsol.txt
Original file line number Diff line number Diff line change
@@ -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 <your-fork-url>
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 <your-username>, <your-PAT>, and <repository-name> with your actual GitHub username, your PAT, and the repository name respectively:

git remote add origin https://<your-username>:<your-PAT>@github.com/<your-username>/90DaysOfDevOps.git
If a remote named origin already exists, update it with:

git remote set-url origin https://<your-username>:<your-PAT>@github.com/<your-username>/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:
Comment on lines +49 to +57
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Replace token-in-URL guidance with safer approaches; prevent PAT leakage.

Embedding PATs in remotes is risky (shell history, logs, screenshots, and .git/config). Prefer HTTPS with credential helpers or gh CLI.

Apply this diff:

-git remote add origin https://<your-username>:<your-PAT>@github.com/<your-username>/90DaysOfDevOps.git
-If a remote named origin already exists, update it with:
-
-git remote set-url origin https://<your-username>:<your-PAT>@github.com/<your-username>/90DaysOfDevOps.git
+git remote add origin https://github.com/<your-username>/90DaysOfDevOps.git
+If a remote named origin already exists, update it with:
+
+git remote set-url origin https://github.com/<your-username>/90DaysOfDevOps.git
+
+Tips:
+- When prompted for credentials on push, use your PAT as the password.
+- Prefer using Git Credential Manager or GitHub CLI (`gh auth login`) to avoid storing secrets in plain text.
+- If you previously embedded a PAT in a URL, rotate the token on GitHub and remove it from `.git/config`.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
git remote add origin https://<your-username>:<your-PAT>@github.com/<your-username>/90DaysOfDevOps.git
If a remote named origin already exists, update it with:
git remote set-url origin https://<your-username>:<your-PAT>@github.com/<your-username>/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:
git remote add origin https://github.com/<your-username>/90DaysOfDevOps.git
If a remote named origin already exists, update it with:
git remote set-url origin https://github.com/<your-username>/90DaysOfDevOps.git
Tips:
- When prompted for credentials on push, use your PAT as the password.
- Prefer using Git Credential Manager or GitHub CLI (`gh auth login`) to avoid storing secrets in plain text.
- If you previously embedded a PAT in a URL, rotate the token on GitHub and remove it from `.git/config`.
Push Your Commit to Remote:
Push your current branch (typically main) and set the upstream:
git push -u origin main
(Optional) Pull Remote Changes:
🧰 Tools
🪛 LanguageTool

[grammar] ~49-~49: There might be a mistake here.
Context: ...b.com//90DaysOfDevOps.git If a remote named origin already exists,...

(QB_NEW_EN)


[grammar] ~52-~52: There might be a mistake here.
Context: ...b.com//90DaysOfDevOps.git Push Your Commit to Remote: Push your c...

(QB_NEW_EN)


[grammar] ~55-~55: There might be a mistake here.
Context: ...h (typically main) and set the upstream: git push -u origin main (Optional) Pull ...

(QB_NEW_EN)


[grammar] ~56-~56: There might be a mistake here.
Context: ...et the upstream: git push -u origin main (Optional) Pull Remote Changes: Verify ...

(QB_NEW_EN)

🤖 Prompt for AI Agents
In solution/gitsol.txt around lines 49 to 57, the instructions embed a personal
access token directly in the remote URL which risks leaking credentials; replace
that guidance with safe alternatives: remove any examples that include tokens in
URLs and instead instruct users to configure a credential helper
(git-credential-manager, osxkeychain, or credential-store) or authenticate via
the GitHub CLI (gh auth login), then add the remote using the standard HTTPS URL
without credentials and push normally (git remote add origin
https://github.com/<your-username>/90DaysOfDevOps.git; git push -u origin main).
Also add a note to rotate any PATs that may have been exposed and to prefer SSH
keys or gh CLI for automation.


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 [email protected]:<your-username>/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