Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Latest commit

 

History

History
executable file
·
29 lines (21 loc) · 483 Bytes

7-second-branch.md

File metadata and controls

executable file
·
29 lines (21 loc) · 483 Bytes

Working with Branches

First, we need to create a new branch:

git update-ref refs/heads/feature <commit-SHA>

Now that the branch exists, we need to check out to that branch:

git symbolic-ref HEAD refs/heads/feature

For time sake, let's create a few porcelain commits:

touch file1.md file2.md
git add file1.md
git commit -m "add file 1"
git add file2.md
git commit -m "add file 2"

How does Git know how to merge?

git merge-base master feature