🚨 What to watch out for when using GitHub (Security – Hacking prevention)

🚨 Important Considerations When Using GitHub (Security and Hacking Prevention)

1. Be cautious with files containing sensitive information

  • Never upload important information like passwords, API keys (authentication keys), or personal information!
  • Information uploaded to GitHub can be easily viewed by others.

🪄 Analogy:

  • It's like leaving your house key in front of your door—anyone can walk right in.

💡 Example solution:

# 잘못된 예 (민감한 정보 직접 포함 ❌)
API_KEY = "123456789abcdef"

# 올바른 예 (별도 파일로 관리 ✅)
.env 파일에 저장 후, .gitignore로 관리

2. Always use the `.gitignore` file

  • Specify files that should not be uploaded to Git to prevent accidental uploads.

🪄 Analogy:

  • It's like hiding important items in a safe so others can't see them!

💡 Usage Example:

# .gitignore
.env
password.txt
node_modules/
__pycache__/

3. Always verify before committing and pushing

  • Don't commit or push hastily—always double-check your file contents!

🪄 Analogy:

  • It's like the habit of rereading a message before sending it to a friend to avoid sending the wrong content!

💡 Good Habit Example:

git status         # 변경된 파일 목록 보기
git diff 파일명 # 파일 내 변경 내용 확인

4. Be especially careful with public repositories

  • Public repositories are visible to anyone on the internet.
  • Always store sensitive information in private repositories or manage it separately.

🪄 Analogy:

  • Wouldn't it be risky to post your personal information on a bulletin board anyone can see?

5. Beware of hacking risks when forking or cloning

  • When forking or cloning a project created by someone else Forkor Clonemay contain hacking code or malicious code.

🪄 Analogy:

  • Wouldn't it be risky to just plug a USB drive given by a stranger into your computer?

💡 Prevention method:

  • Only use official and trustworthy projects.
  • After downloading code, always verify the file contents!

Points to note when using Git commands (commit, branch, merge, push, pull, etc.)

1. Commit Precautions

  • Write meaningful commit messages. (This makes it easy to understand what changes were made later!)

Good example ✅

git commit -m "feat(login): 로그인 버튼 추가"

Bad example ❌

git commit -m "수정"

📌 2. Branch Precautions

  • Do not work directly on the main branch. It's better to work on a separate branch and then merge it.

Example of creating a branch

git checkout -b feat/login-page

🪄 Analogy:

  • Think of it like drafting (on a separate branch) and then moving it to the original (main branch) once complete!

📌 3. Merge Precautions

  • Always check for and resolve conflicts before merging.

Example of resolving conflicts

# 브랜치 전환 및 머지
git checkout main
git merge feat/login-page

🪄 Analogy:

  • Imagine two different people writing on the same note at the same time—you'd need to neatly organize the overlapping content, right?

📌 4. Push Precautions

  • Always double-check file contents before pushing, and correct any incorrect commits before pushing.

Push Command Example

git push origin main

🪄 Analogy:

  • Like double-checking before sending an email or message!

📌 5. Pull Precautions

  • Always update to the latest state before starting work (git pull) to incorporate others' changes.

Pull command example

git pull origin main

🪄 Analogy:

  • When writing a shared note with a friend, if they added content first, it's best to review their changes before starting your work!

✅ Must-remember one-line summary tip!

  • Never upload sensitive information to GitHub, and always double-check your file contents! 📌🔐

By carefully following these basic security and precautionary measures, you can use Git and GitHub safely and effectively.

Git and GitHub concepts in a nutshell

This guide is essential for those new to coding, unfamiliar with programming collaboration, or beginners who found learning Git and GitHub confusing. It explains Git and GitHub—essential development tools—in an easy-to-understand way using relatable analogies, helping anyone grasp and utilize them effortlessly.

Below, you can review the concepts of Git and GitHub, commonly used terminology, understanding their structure, and security precautions.

🔍 이 글과 함께 알아두면 좋은 꿀팁

📌 “그냥 쓰면 큰일 나요!” — GitHub 올리기 전 확인 필수!
처음 GitHub에 코드를 올리는 분들 중에는 실수로 API 키, 비밀번호 같은 민감한 정보를 포함하는 경우가 많아요. 이렇게 되면 보안 사고가 생길 수 있죠.

💡 해결 방법은 .gitignore 파일을 설정해 중요한 파일을 아예 업로드되지 않도록 관리하는 것이에요.

이 외에도 GitHub 사용 시 꼭 알아야 할 보안 주의사항은 이 글에서 확인하세요!

🛠️ Easily Understand Git and GitHub Concepts

We've organized the basic concepts and differences between Git and GitHub with analogies for easy understanding.

📋 Key Concepts of Git and GitHub

ConceptDefinitionAnalogyInstallation Location
GitChange History Storage ToolDiary📓My Computer
GitHubGit User Collaboration SpaceLibrary📚Internet
GitHub DesktopTools that make Git and GitHub easy to useTV Remote🎮My Computer
  • Git is a tool that stores and manages the history of file changes on your computer.
  • GitHub is a space for storing and sharing files created with Git on the internet.
  • GitHub Desktop is a program that helps you easily use Git and GitHub.

📚 Common Git and GitHub Terms Explained

This table explains terms frequently used in Git and GitHub in simple terms.

🖥 Common Git Terms

TermMeaningAnalogy
RepositoryProject folderFile storage📁
CommitSave WorkWrite Journal📓
BranchFeature Experiment SpaceNotebook📄
MergeMerge CodeBundle Posts
PushPush to GitHubPosting to the library
PullPull from GitHubDownload the diary

🌐 Common terms on GitHub

TermMeaningAnalogy
ForkCopy a projectCopy a friend's note
Pull RequestChange RequestRequest Teacher Review
IssueIssue ProposalBoard📝
CloneCopy from GitHubBook Borrowing
ActionsRun Automated TasksAutomation Robot🤖
  • A commit saves your changes; think of it like "writing in a diary."
  • Pushing is the action of uploading from your computer to GitHub, like shelving a book in the library.
  • A Pull Request is asking others to review your work and merge it.

🧩 Understanding the Structure: Where do Git, GitHub, and GitHub Desktop fit?

Let's organize the structure of Git and GitHub at a glance.

scss복사편집내 컴퓨터
├─ Git (변경 이력 관리)
├─ GitHub Desktop (편리한 도구)
인터넷
└─ GitHub (코드 협업 공간)
  • Git is installed on your computer and used locally.
  • GitHub is an online platform used on the web.
  • GitHub Desktop is a tool that easily connects Git and GitHub on your computer.

Handy Tip:
Think of Git as a 📓diary, GitHub as a 📚library, and GitHub Desktop as a 🎮remote control!

🚨 Important GitHub Precautions: Security is essential!

Here are the security rules you must follow when using GitHub.

PrecautionsDescriptionAnalogy
Prohibition of Sensitive InformationDo not upload passwords or API keysLike leaving your house key in front of the door
Use .gitignoreSet up upload prevention filesHide in a safe
Verify before committingAlways review commit contentVerify before sending messages
Caution with public repositoriesKeep sensitive information privatePosting personal information on bulletin boards
Review trustworthiness when cloningBeware of malwarePlugging in unknown USB drives
  • Always manage sensitive information .gitignoreManage it securely.
  • When setting a project to public, always verify that it does not contain passwords, keys, or similar sensitive information.
  • When copying code, it's crucial to develop the habit of verifying the source is trustworthy.

⚠️ Precautions When Using Git Commands

Here are precautions and usage examples for frequently used Git commands.

CommandPrecautionsGood ExampleBad Example
CommitUse meaningful messagesfeat: 로그인 기능 추가수정
BranchWork on a separate branchgit checkout -b feat/login
MergeCheck for conflictsgit merge 브랜치명
PushPush after reviewing changesgit push origin main
PullMust update to latest version before workinggit pull origin main
  • Writing simple and clear commit messages makes tracking easier later.
  • Always add features in a separate branch, not directly on the main branch.
  • Resolving conflicts before merging is essential.

❓Frequently Asked Questions (FAQ)

We've compiled frequently asked questions about Git and GitHub.

Do I have to use Git and GitHub together? You can
use Git alone, but using GitHub alongside it makes collaboration and backup much more convenient.

Is GitHub free?
Basic features are free, while private repositories and additional features require a paid plan.

Do I have to install GitHub Desktop?
It's not mandatory, but it's very useful if you're not familiar with Git commands.

Why are Push and Pull important?
Push uploads your work, and Pull fetches others' work. They're essential for collaboration.

Why should I use branches? They help manage code safely
when working on multiple features simultaneously or experimenting.

How do I set up .gitignore? Simply list the
filenames you don't want uploaded .gitignore in a file.

How do I manage sensitive information? Separate it into
files like .env and configure it not to be uploaded via .gitignore.

What if a merge conflict occurs? Manually resolve
the conflicting changes, then commit and push again.

What are GitHub Actions? They automate tasks like building
, testing, and deploying your code.

📢 Additional useful information

💻 How to install Git

Operating SystemInstallation MethodLink
WindowsInstall Git for WindowsOfficial Site
macOSUsing Homebrewbrew install git
LinuxUsing a Package Managersudo apt install git etc.
  • Git can be downloaded from the official website.
  • After installation, don't forget to set your user information with the `git config` command!

Git structure for easy collaboration: monorepo vs. multirepo?

Lately, while working on team projects, I hear this
concern a lot: "Our services are growing, and we're building multiple apps… Is it really okay to keep pushing everything into one repository?"
At first, it was convenient for everyone to work together in a single GitHub repository. But as
the number of files grew and CI/CD configurations started getting messy, the dilemma of 'monorepo vs. multirepo' gradually began.

I've been there too. When I was developing solo, I didn't think much about it, but once the team grew to about 3-5 people, the problems immediately surfaced.
Branch conflicts, test speed, PR merge order… each one directly impacts collaboration productivity.

So in this article, for those wondering like me, "How far should I go with one
repository?", I've summarized the differences between monorepos and multirepos, their pros and cons, the right timing for switching, and even practical structure examples.

I've broken it down step-by-step, from supermarket analogies to hands-on Git command practice
, so even if you're new to development, you can understand it. If you're currently debating your structure, use this article to get organized!

📌 Monorepo vs. Multirepo: Defining the Concepts

  • Monorepo: A method
    where the code for multiple projects (services) is managed together in a single repository.
  • Multirepo: A method where each
    project or service uses its own separate repository.

🪄 Monorepo vs. Multirepo Analogy (Think of it this way!)

  • A monorepo is like a single large supermarket where all items are stocked. You can buy everything
    you need in one place. It's efficient and fast.
  • Multirepo is like a market with separate fruit shops, bakeries, and butcher shops.
    Specialization is strong, but you have to visit multiple places.

💡 Usage Example (Actual Folder Structure)

Monorepo Structure Example

project-root/
├─ core/ # 핵심 기능 모듈
│ ├─ module1/
│ ├─ module2/
│ └─ ...
├─ apps/ # 사용자-facing 앱들
│ ├─ app1/
│ ├─ app2/
│ └─ ...
├─ shared/ # 공통 코드
│ ├─ security/
│ └─ quality/
├─ infra/ # 배포, 도커 등 인프라 설정
├─ .github/
│ └─ workflows/ # GitHub Action 자동화 설정
└─ tasks.json # 작업 관리용 설정 파일

Example Git Branch Strategy

BranchDescription
mainStable version, used for actual deployment
devBranch for integrating and testing multiple features
feat/Personal branch for new feature work → Merge into dev (PR)

🔄 Steps for a natural transition to multi-repository

  1. If a specific app is managed by a separate team, isolate only that app folder into a new repository. bash copy editgit filter-repo --subdirectory-filter apps/app1 --force
  2. Common code shared/ Reuse by separating directories into internal packages or submodules
  3. Set up CI/CD automation independently for each app (enabling separate deployments)

🧠 Where is it used? (Pros and cons of each approach)

✅ When a monorepo is advantageous

  • Project initiation phase
  • When the team is small (2-5 members)
  • When features frequently impact each other
  • When you want to test and make changes quickly

✅ When multi-repository is advantageous

  • When the project grows large and services become completely independent
  • When multiple teams develop in parallel
  • When separate deployment or security permissions are required per service

✅ Quick tip summary!

Start with a single repository (mono), split it when it grows (multi)!

🚀 Actionable steps to implement right now (Practical example)

(1) Create GitHub repository + initialize

gh repo create my-monorepo --private
cd my-monorepo && git init

(2) Create folder structure scaffold & make first commit

git add .
git commit -m "chore: initial scaffold with core & apps"
git push -u origin main

(3) Set up automated testing with GitHub Actions (.github/workflows/ci.yml)

name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip install -r requirements.txt
- run: pytest

(4) Set up VSCode workspace

  • .code-workspaceInclude the core/, apps/ Include the folder to enable search and testing in one go

(5) Adding Release Tags

git tag -a v0.1.0 -m "MVP scaffold"
git push origin v0.1.0

Now you can start with a monorepo for easy management, and when
things scale up, you can naturally transition to a multirepo setup! 😄

Learn the concept of branches & how to use them for Git beginners

For beginners new to Git, you might wonder, "Why divide things up so
complicatedly?" or "Can't I just save and push?" That's why this time, I'll break down why branch strategies are needed, when to use them, and when they're useful for situations beginners face—all explained simply.

🍊 Git Branch Strategy, Made Easy for Beginners!

💡 Why do you need a Git branching strategy?

If you're working on code alone, using just the main branch is perfectly fine.
But if any of the following situations apply? A branch strategy is absolutely essential.

✅ 3 Essential Scenarios

ScenarioDescriptionWhat Git Branch Strategy Solves
Development by more than one personMultiple people editing simultaneously → Risk of conflictsWorking individually feat/*Work individually → devthen merge, minimizing conflicts
Accidentally breaking the codeApp errors caused by incorrect modifications during codingmainAlways maintain a stable state! Keep experiments devin
Experimenting with new featuresDeveloping unvalidated featuresfeat/*Experiment freely in [branch name], then get reviewed and merge

🤔 Common beginner issues vs. branch strategy

Common ProblemsChanges After Implementing Branch Strategy
"I don't know what I changed"Track history with commits & branches
"I broke the whole app while fixing one feature"feat/*Experimentation, mainAlways functions normally
"We're working together, but our code keeps getting tangled"Minimize conflicts by following: Branch → Review → Merge

🔍 When should I use which branch?

SituationBranch to useDescription
When creating a new featurefeat/기능명This is my workspace. Feel free to experiment!
When you've finished building the feature and are ready to sharePR → devAutomated testing + reviewer review
When deploying the service to usersmainOnly deploy error-free code (release tags are also created at this stage)
When urgently fixing errorshotfix/이름Fix immediately and mainand merge immediately (version tags are also created)

🧠 Core Summary Reorganized with an analogy

ConceptAnalogyRole
main🏛 Deployable Exhibition HallOnly displays completed works
dev🧪 LaboratoryWhere artists' works gather for review
feat/*🎨 Private StudioA space where each artist is engaged in creative activities

🧪 Practice Routines Beginners Can Try

🌱 1. Try applying branch strategy for the first time

# 1. dev 브랜치에서 최신 코드 받아오기
git checkout dev
git pull

# 2. 새로운 작업 브랜치 생성
git checkout -b feat/hello-api

# 3. 작업 + 저장
echo "Hello API!" >> api.py
git add api.py
git commit -m "feat(api): 인사 API 스텁 추가"

# 4. GitHub로 푸시 + PR 만들기
git push --set-upstream origin feat/hello-api

🔐 Security & Mistake Prevention Tips

ItemPoints to noteAction
Committing Sensitive Information.env, 비밀번호, API 키 etc..gitignoreExclude and verify before committing
Force Push (--force)Misuse may overwrite collaborators' workNever decide alone; notify via Slack when sharing is needed
Branch name errorsTypos or duplicatesEstablish naming conventions beforehand and verify before starting work
GitHub public reposAccidentally pushing sensitive filesUpload only code to public repos; separate configuration files

🎯 Summary: Practical Branch Strategy for Beginners

Action ItemsDescription
✅ Before working git pullAlwaysPrevent conflicts, reflect latest code
✅ One branch per featureIncrease focus and simplify history management
✅ Commit frequently in small incrementsmakes it easier to revert later
✅ Always request a code review after a PRPrevents mistakes and aids growth

🚀 Final tip: Start like this!

  1. Create a branch today dev Create a branch today.
  2. .gitignore Create a file to block sensitive files!
  3. Create a branch, README.md and practice the entire process: make changes → create a PR → request a review!

📚 Git and GitHub Glossary of Common Terms

1️⃣ Simplifying Git and GitHub Concepts

📌 What is Git?

  • One-line definition: It's a tool that stores and manages the history of changes to your code or files on your computer.
  • An easy analogy: It's like
    a diary📓 I keep. I write
    entries daily to add content, and I can edit or delete them.
    Plus, I can always revisit entries from past dates.
  • A program installed on my computer:
    Git is a program that runs directly on my computer.

📌 What is GitHub?

  • One-line definition: It's a website where people who use Git share and collaborate on files and code online.
  • An easy analogy:
    Think of it as a library📚. If you
    want to share your diary (Git) with others or collaborate, you need to upload it to the internet, right?
    GitHub is the space where you upload that diary so multiple people can view it together or edit it collaboratively.
  • A website separate from your computer:
    GitHub is a separate service existing on the internet (web), not on your computer.

📌 What is GitHub Desktop?

  • One-line definition: It's a graphical program (click with your mouse) that makes using Git and GitHub convenient.
  • An easy analogy: It's like
    a TV remote🎮. You could press buttons directly on the TV (GitHub), but using a remote is more convenient, right?
    GitHub Desktop helps you use Git and GitHub easily and simply.
  • GitHub Desktop is a program you install on your computer, while your work is stored on GitHub (the web).

2️⃣ Common terms for Git and GitHub

🖥 Common Git Terms

TermMeaning (Even elementary school students can understand!)
RepositoryA folder📁 where I store my projects or files
CommitThe act of saving your work after finishing it (like writing a daily entry in your diary!)
BranchA space to work on new features or experiments separately from the main code (Think of it as a practice notebook📄!)
MergeThe process of combining multiple branches (practice pads) back into the main branch
PushUploading modified files from your computer to GitHub (like submitting your notebook to the library!)
PullDownloading the updated content from GitHub to your computer

🌐 Common terms used on GitHub

TermMeaning (Even elementary school students can understand!)
ForkCopying someone else's project to your GitHub (like copying a friend's notes and making them your own!)
Pull RequestRequesting that your work be incorporated into the original project (Like having your homework checked by the teacher!)
IssueA board for recording and discussing problems or suggestions that arise in the project (Feels like a Q&A board📝!)
CloneCopying a GitHub project to your computer (Like borrowing a library book!)
ActionsA feature that automatically executes tasks like code testing and deployment (think of it like an automation robot🤖!)

3️⃣ Easily Understand the Structure (Let's recap!)

QuestionsSimple Answer
Is Git installed on my computer?Yes, Git is a program installed on my computer.
Is GitHub installed on my computer?No, GitHub is a website you use on the internet.
Where do I install GitHub Desktop?GitHub Desktop is a program you install on your computer to help you easily use Git and GitHub.

So, the structure is like this:

내 컴퓨터
├─ Git (변경 이력 관리)
├─ GitHub Desktop (편리한 관리 도구)

인터넷
├─ GitHub (코드를 저장하고 협업하는 곳)

✅ Quick tip to remember (don't forget!)

  • Git is my diary📓!
  • GitHub is a shared library📚!
  • GitHub Desktop is the remote control🎮 that makes it easy to use!