Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
# Set up a repository where main and feature-branch change the same line git init -q echo "Hello" > filename.txt git add filename.txt git commit -q -m "Add filename.txt" git checkout -q -b feature-branch echo "Other branch's changes" > filename.txt git commit -q -am "Change filename.txt on feature-branch" git checkout -q main echo "Your changes here" > filename.txt git commit -q -am "Change filename.txt on main" # Merge feature-branch: it stops with a conflict git merge feature-branch # Fix the conflict: write the text we want to keep echo "Your changes here, and the other branch's changes" > filename.txt git add filename.txt # Finish the merge. Git uses its default merge message here git commit git log --oneline --graph
Auto-merging filename.txt
CONFLICT (content): Merge conflict in filename.txt
Automatic merge failed; fix conflicts and then commit the result.
The Try-it editor cannot open a text editor. For a commit message, use: git commit -m "Your message"
[main beba182] Merge branch 'feature-branch'
* beba182 (HEAD -> main) Merge branch 'feature-branch'
|\
| * 6b1608c (feature-branch) Change filename.txt on feature-branch
* | 8e2d844 Change filename.txt on main
|/
* 480ca78 Add filename.txt