|
| 1 | +--- |
| 2 | +sidebar_position: 3 |
| 3 | +title: "Connecting to the Cloud: GitHub Setup" |
| 4 | +sidebar_label: "3. GitHub Setup" |
| 5 | +description: "Learn how to create a GitHub account and connect it to your local environment." |
| 6 | +--- |
| 7 | + |
| 8 | +Think of GitHub as your **Professional Portfolio**. It’s where your code lives, where you collaborate with others at **CodeHarborHub**, and where future employers look to see your progress. |
| 9 | + |
| 10 | +To get your computer talking to GitHub, we need to follow three main steps. |
| 11 | + |
| 12 | +## 1. Create Your Account |
| 13 | + |
| 14 | +First things first: head over to [GitHub.com](https://github.com) and sign up. |
| 15 | + |
| 16 | +* **Pick a professional username:** This will stay with you for a long time (e.g., `ajay-developer` is better than `cool-gamer-99`). |
| 17 | +* **Verify your email:** You won't be able to contribute until you do! |
| 18 | + |
| 19 | +## 2. Introduce Yourself to Git |
| 20 | + |
| 21 | +[Git](https://git-scm.com/install/) is installed on your computer, but it doesn't know who you are yet. We need to give it your name and email so that your "Save Points" have your signature on them. |
| 22 | + |
| 23 | +Open your **Terminal** and type these two lines (replace with your info): |
| 24 | + |
| 25 | +```bash |
| 26 | +git config --global user.name "Your Name" |
| 27 | +git config --global user.email "your-email@example.com" |
| 28 | +``` |
| 29 | + |
| 30 | +## 3. The "Secret Handshake" (SSH Keys) |
| 31 | + |
| 32 | +GitHub needs to know that the code coming from your computer is actually from *you*. Instead of using a password every time, we use an **SSH Key**. |
| 33 | + |
| 34 | +Think of an SSH Key as a **Digital Keycard**. You keep the "Private Key" on your laptop and give the "Public Key" to GitHub. When they match, the door opens! |
| 35 | + |
| 36 | +### How to generate your Key: |
| 37 | + |
| 38 | +1. **Open your terminal** and type: |
| 39 | + |
| 40 | +```bash |
| 41 | +ssh-keygen -t ed25519 -C "your_email@example.com" |
| 42 | +``` |
| 43 | + |
| 44 | +*(Press Enter for all prompts—don't worry about a password for now.)* |
| 45 | + |
| 46 | +2. **Copy the key** to your clipboard: |
| 47 | + |
| 48 | +* **Windows:** `clip < ~/.ssh/id_ed25519.pub` |
| 49 | +* **Mac:** `pbcopy < ~/.ssh/id_ed25519.pub` |
| 50 | + |
| 51 | + |
| 52 | +3. **Add to GitHub:** * Go to GitHub **Settings** -> **SSH and GPG keys** -> **New SSH Key**. |
| 53 | +* Paste your key and give it a name like "My Laptop". |
| 54 | + |
| 55 | +## Your First Repository (Remote Storage) |
| 56 | + |
| 57 | +Now, let's create a home for your project on GitHub! |
| 58 | + |
| 59 | +1. Click the **+** icon on GitHub and select **New repository**. |
| 60 | +2. Name it `my-first-project`. |
| 61 | +3. Keep it **Public** so others can see your hard work! |
| 62 | +4. Copy the URL provided (it looks like `git@github.com:username/repo.git`). |
| 63 | + |
| 64 | +### Connecting Local to Remote: |
| 65 | + |
| 66 | +In your project folder on your computer, run this command to tell Git where the "Cloud Version" lives: |
| 67 | + |
| 68 | +```bash |
| 69 | +git remote add origin [PASTE_YOUR_URL_HERE] |
| 70 | +``` |
| 71 | + |
| 72 | +## Testing the Connection |
| 73 | + |
| 74 | +Let's see if the bridge is working. Try to push your first commit: |
| 75 | + |
| 76 | +```bash |
| 77 | +git push -u origin main |
| 78 | +``` |
| 79 | + |
| 80 | +**Success?** Refresh your GitHub page. If you see your files there, you are officially a **Cloud-Connected Developer!** |
| 81 | + |
| 82 | +## Summary Checklist |
| 83 | + |
| 84 | +* [x] I created a GitHub account. |
| 85 | +* [x] I configured my `user.name` and `user.email`. |
| 86 | +* [x] I generated and added my **SSH Key** to GitHub. |
| 87 | +* [x] I linked my local folder to a **Remote Repository**. |
0 commit comments