Komut Satırından Git Temelleri
İşleme alma, dallanma ve birleştirme dahil olmak üzere sürüm denetimi için gerekli Git komutlarını öğrenin.
Komut Satırından Git Temelleri, CoddyKit'te ücretsiz bir Linux Command Line Mastery dersidir. Bu, 4 dersinin 1. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Linux Command Line Mastery öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Linux Command Line Mastery kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
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 initStaging 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.mdSaving 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 --onelineParallel 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 branchSwitching 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' branchMerging 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/loginGit 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!
Sıkça Sorulan Sorular
“Komut Satırından Git Temelleri” dersi ücretsiz mi?
Evet — “Komut Satırından Git Temelleri” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Linux Command Line Mastery kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Linux Command Line Mastery kursu toplamda 4 dersten oluşur.
“Komut Satırından Git Temelleri” dersinde ne öğreneceğim?
İşleme alma, dallanma ve birleştirme dahil olmak üzere sürüm denetimi için gerekli Git komutlarını öğrenin. Linux Command Line Mastery ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
Linux Command Line Mastery öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te Linux Command Line Mastery, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 1. dersidir.
“Komut Satırından Git Temelleri” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu Linux Command Line Mastery dersinde kod yazıp çalıştırabilir miyim?
Evet. Her Linux Command Line Mastery dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- Komut Satırından Git Temelleri
- Ortam Değişkenleri ve Takma Adlar
- Kabuk Yapılandırması: `.bashrc`, `.zshrc`, `.profile`
- Komut Satırından Git ile Dallanma ve Birleştirme