0Pricing
Linux Command Line Mastery · 강의

명령줄에서 배우는 Git 기초

커밋, 브랜치 생성, 병합을 포함한 버전 관리의 필수 Git 명령을 배웁니다.

명령줄에서 배우는 Git 기초은(는) CoddyKit의 무료 Linux Command Line Mastery 강의입니다. 이것은 4개 중 1번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Linux Command Line Mastery 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Linux Command Line Mastery 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

What is Git?

Welcome to Git basics! Git is a powerful Version Control System (VCS). Think of it as a super-smart history book for your code.

It tracks every change you make, letting you revert to older versions, collaborate with others, and manage different features without stepping on toes. It's essential for modern software development!

Starting a Git Project

To begin tracking a project with Git, you first need to initialize a repository. This creates a special .git folder in your project, where Git stores all its tracking information.

Use the git init command in your project's root directory.

mkdir my_project
cd my_project
git init

Staging Your Changes

Before saving your work, Git uses a 'staging area'. This is like a rough draft space where you select which changes you want to include in your next save.

The git add command is used to add files or changes to this staging area.

echo "My first line." > README.md
git add README.md

Saving Your Work (Commit)

Once changes are staged, you 'commit' them. A commit is a snapshot of your project at a specific point in time, with a descriptive message.

Use git commit -m "Your message" to save staged changes to your repository's history.

git commit -m "Initial commit: Added README.md"

Viewing Project History

Git keeps a detailed log of all your commits. You can review this history to see who made what changes and when.

The git log command displays your repository's commit history. The --oneline option provides a concise view.

git log --oneline

Parallel Development with Branches

Branches are a core concept in Git. They allow you to diverge from the main line of development and continue working without affecting the main project.

  • Work on new features.
  • Fix bugs without breaking stable code.
  • Experiment with new ideas.

The main (or master) branch is typically the stable version.

Creating a New Branch

To start a new line of development, you create a new branch. This doesn't move you to the new branch yet; it just creates it.

The git branch <branch-name> command creates a new branch. You can list all branches with just git branch.

git branch feature/login
git branch

Switching Between Branches

After creating a branch, you need to switch to it to start working on that specific line of development. Your files will reflect the state of that branch.

Use git switch <branch-name> to move to an existing branch. It's the modern way to navigate branches.

git switch feature/login
# Now you are on the 'feature/login' branch

Merging Branches

Once you've finished work on a feature branch, you'll want to integrate those changes back into your main development line, usually the main branch.

First, switch to the target branch (e.g., main), then use git merge <source-branch> to bring in the changes.

git switch main
git merge feature/login

Git Workflow Check

You've learned the core steps for managing changes with Git. Let's test your understanding of how to save your work.

Git Basics Summary

Great job! You've learned the fundamental Git commands:

  • git init: To start a new repository.
  • git add: To stage changes for a commit.
  • git commit: To save staged changes to history.
  • git log: To view your project's commit history.
  • git branch: To create and list branches.
  • git switch: To move between branches.
  • git merge: To combine changes from different branches.

These commands form the backbone of managing your code with Git!

자주 묻는 질문

“명령줄에서 배우는 Git 기초” 강의는 무료인가요?

네 — “명령줄에서 배우는 Git 기초” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Linux Command Line Mastery 강의 전체를 잠금 해제할 수 있습니다. Linux Command Line Mastery 강의에는 총 4개의 강의가 포함되어 있습니다.

“명령줄에서 배우는 Git 기초”에서 뭘 배우나요?

커밋, 브랜치 생성, 병합을 포함한 버전 관리의 필수 Git 명령을 배웁니다. 브라우저에서 직접 실행하는 실습 코드로 Linux Command Line Mastery을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Linux Command Line Mastery을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Linux Command Line Mastery은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 1번째 강의입니다.

“명령줄에서 배우는 Git 기초” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Linux Command Line Mastery 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Linux Command Line Mastery 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 명령줄에서 배우는 Git 기초
  2. 환경 변수 및 별칭
  3. 셸 구성: `.bashrc`, `.zshrc`, `.profile`
  4. 명령줄에서 Git으로 브랜치 만들고 병합하기
← Linux Command Line Mastery(으)로 돌아가기