- 01Getting Started
- 02What Is Git? Understanding Version Control
- 03Checking the Current State with git status
- 04Understanding the "Staging Area"
- 05Recording Changes with git commit
- 06Viewing History with git log
- 07Viewing Changes with git diff
- 08What Is a Branch?
- 09Switching Branches with git checkout
- 10Merging Branches with git merge
- 11Remote Repositories and git remote
- 12Sending Changes with git push
- 13Getting Code with git pull and git clone
- 14Shelving Work Temporarily with git stash
- 15Marking Releases with git tag
- 16Unstaging with git reset
- 17Untracking a File with git rm
- 18Ignoring Files with .gitignore
- 19Deleting a Branch with git branch -d
- 20Setting Your Name with git config
- 21Viewing the Latest Commit with git show
- 22Fetching Remote Info Only with git fetch
- 23Viewing History Compactly with git log --oneline
- 24Finding Who Changed a File with git blame
- 25Undoing a Commit with git revert
- 26Fixing the Last Commit with git commit --amend
- 27Viewing the Staged Diff with git diff --staged
- 28Visualizing History with git log --graph
- 29Switching Branches with git switch (the Newer Syntax)
- 30Renaming a Branch with git branch -m
- 31Filtering History by Author with git log --author
- 32Deleting a Stash with git stash drop
- 33Deleting a Tag with git tag -d
- 34Listing Remotes with git remote -v
- 35Replaying Your Branch with git rebase
- 36Viewing Changed Files Alongside History with git log --stat
- 37Staging and Committing Together with git commit -a
- 38Discarding File Changes with git checkout --
- 39Picking Just One Commit with git cherry-pick
- 40Recording a Rename with git mv
- 41Checking HEAD's Movement History with git reflog
- 42Applying a Stash Without Removing It with git stash apply
- 43Creating an Annotated Tag with git tag -a
- 44Filtering History by Date with git log --since
- 45Viewing the Actual Changes with git log -p
- 46Getting Just the Current Branch Name with git branch --show-current
- 47Creating an Empty Commit with git commit --allow-empty
- 48Searching Commit Messages with git log --grep
- 49Removing a Remote with git remote remove
- 50Understanding the Danger of git push --force
- 51Counting Commits per Author with git shortlog
- 52Returning to Your Previous Branch with git switch -
- 53Viewing One File's Diff with git diff <file>
- 54Listing Your Settings with git config --list
- 55Checking Status Compactly with git status -s
- 56Adding Only Changes with git commit --amend --no-edit
- 57Mastering the git commit -am Shorthand
- 58Adding a Message to a Stash with git stash push -m
- 59Searching Tags by Pattern with git tag -l
Merging Branches with git merge
This lesson covers merging branches with git merge. It's for anyone searching "git merge usage."
git merge brings the changes from one branch into the branch you're currently on. Use it when you want to unify work that was developed in parallel.
In Try It, run git merge feature. This brings the changes made on the feature branch into your current branch.
A common early mistake is not expecting conflicts — if the same spot was changed differently on two separate branches, Git can't merge automatically and requires manual resolution. In real teams, once work on a feature branch is done and reviewed, merging it into the main branch is the basic flow of team development.
🧑💻 You can type this command into the Git pseudo terminal to try it yourself (this page itself has no interactive terminal).
