Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
# Create and switch to a new branch git branch feature/login # create branch git switch feature/login # switch to it git switch -c feature/login # create AND switch (shortcut) # List branches git branch # local branches git branch -a # local + remote branches # Merge a branch git switch main # go back to main git merge feature/login # merge the feature branch # Delete a branch git branch -d feature/login # safe delete (merged only) git branch -D feature/login # force delete # Resolve merge conflicts # 1. Git marks conflict in the file: # <<<<<<< HEAD # your changes # ======= # incoming changes # >>>>>>> feature/login # 2. Edit the file to resolve # 3. git add the resolved file # 4. git commit # Rebase (alternative to merge — linear history) git switch feature/login git rebase main # replay commits on top of main
Result
Open