Skip to content

Instantly share code, notes, and snippets.

@asynchroza
Last active March 22, 2025 21:04
Show Gist options
  • Save asynchroza/7094aba3853a05220d55043dc352074c to your computer and use it in GitHub Desktop.
Save asynchroza/7094aba3853a05220d55043dc352074c to your computer and use it in GitHub Desktop.
Git commands

Rename a branch

git branch -m <old-name> <new-name>

Change base branch

git rebase --onto <target> <current-base> <your-branch>

Checkout (add) a file/folder from a different branch

git checkout <other-branch-name> -- path/to/your/folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment