Skip to content

Instantly share code, notes, and snippets.

@fredsiika
Last active September 29, 2022 17:28
Show Gist options
  • Save fredsiika/c80b3f0a0cb77115a5aae0daa3ef0478 to your computer and use it in GitHub Desktop.
Save fredsiika/c80b3f0a0cb77115a5aae0daa3ef0478 to your computer and use it in GitHub Desktop.

Gitflow CLI Examples

Create new local branch from remote branch (origin)

git checkout -b <local-branch-name> --track <origin/remote-branch-name>

  • example:

git checkout -b dev --track origin/dev

Fetch latest changes from remote branch without checking out of local branch

git fetch origin <remote-branch>:<local-branch>

  • Example: fetch latest remote prod branch into local prod branch while working in a separate branch feature/my-feature-branch then
# fetch origin
git fetch origin prod:prod

# merging into my current feature branch
git merge prod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment