You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/GitHub/intro-github.md
+60Lines changed: 60 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,6 +94,66 @@ The fork is a personal copy of the repo which is already present or uploaded in
94
94
95
95
:::
96
96
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`.
- 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:
-**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.
0 commit comments