Skip to content

Commit 039c3ab

Browse files
committed
Docs: Add troubleshooting tips and real-world use cases to GitHub intro
1 parent 291c637 commit 039c3ab

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

Documentation.hi.md

Whitespace-only changes.

docs/GitHub/intro-github.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,66 @@ The fork is a personal copy of the repo which is already present or uploaded in
9494

9595
:::
9696

97+
## Troubleshooting & Common Issues
98+
99+
Beginner GitHub users often run into similar problems when setting up or contributing. Here are some common issues and their solutions:
100+
101+
:::info
102+
103+
### 1. Git Command Not Working
104+
- **Problem:** Running Git commands like `git status` or `git commit` throws an error.
105+
- **Fix:** Make sure Git is installed on your machine by running `git --version` in the terminal. If it’s not installed, [download Git](https://git-scm.com/).
106+
- If installed but commands still fail, try restarting your terminal or reinstalling Git.
107+
108+
### 2. Cannot Push to Repository
109+
- **Problem:** Errors such as “Permission denied” or “Authentication failed” when using `git push`.
110+
- **Fix:** Set up your Git global configuration:
111+
git config --global user.name "Your Name"
112+
git config --global user.email "[email protected]"
113+
- Use a Personal Access Token instead of a password for GitHub authentication. Learn how to [set up a token here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).
114+
- Confirm you’re pushing to the right repo:
115+
116+
### 3. Merge Conflicts
117+
- **Problem:** Cannot merge branches; get conflict notifications.
118+
- **Fix:** Open the files listed by Git, edit them to keep only the correct code, and then mark them as resolved:
119+
git add <file>
120+
git commit
121+
- Detailed steps: [Resolving merge conflicts](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts).
122+
123+
### 4. Cannot Install Dependencies
124+
- **Problem:** Running `npm install` fails due to missing modules or permission errors.
125+
- **Fix:** Try deleting the existing dependencies and reinstalling:
126+
rm -rf node_modules
127+
npm install
128+
129+
:::
130+
131+
_For more troubleshooting tips, see the [Beginner Git Guide](https://rogerdudler.github.io/git-guide/) or [GitHub Troubleshooting Docs](https://docs.github.com/en/contributing/setting-up-your-environment-to-work-on-github-docs/troubleshooting-your-environment)._
132+
133+
---
134+
135+
## Real-World Use Cases & Examples
136+
137+
Seeing how GitHub is used in genuine projects makes concepts easier to grasp:
138+
139+
:::info
140+
### Example 1: Team Collaboration Workflow
141+
Suppose a team is building an e-commerce platform:
142+
- Developer 1 codes the men’s section on a separate branch.
143+
- Developer 2 creates the women’s section in another branch.
144+
- Developer 3 works on the login feature in a third branch.
145+
- All changes are pushed to their respective branches, reviewed as pull requests, and merged into the main branch once approved.
146+
147+
### Example 2: Issue Tracking
148+
- A user spots a bug, opens a GitHub Issue describing the problem.
149+
- Maintainer labels the issue (“bug”, “good first issue”), assigns it, and links any related pull requests.
150+
- Once a fix is merged, the issue auto-closes, keeping project history clear.
151+
152+
### Example 3: Open Source Contributions
153+
- A contributor finds a typo in the documentation.
154+
- They fork the repo, fix the typo, and open a pull request.
155+
- Maintainers review and merge, improving the docs for everyone.
156+
:::
97157

98158

99159
### Watch the video Tutorial

0 commit comments

Comments
 (0)