Skip to content

Instantly share code, notes, and snippets.

@karronoli
Last active February 22, 2020 13:33
Show Gist options
  • Save karronoli/47e123d9156a5e61cf77fb9c8e1466b5 to your computer and use it in GitHub Desktop.
Save karronoli/47e123d9156a5e61cf77fb9c8e1466b5 to your computer and use it in GitHub Desktop.
git fetch . feature/hello:master
$ git init /tmp/fetch_test
Initialized empty Git repository in /tmp/fetch_test/.git/
$ pushd /tmp/fetch_test
/tmp/fetch_test ~
$ git commit --allow-empty -m initial
[master (root-commit) 153b70a] initial
$ git checkout -b feature/hello
Switched to a new branch 'feature/hello'
$ git commit --allow-empty -m hello
[feature/hello b8b8f46] hello
$ git checkout -b feature/world master
Switched to a new branch 'feature/world'
$ git commit --allow-empty -m world
[feature/world 032253a] world
$ git log --pretty=oneline --abbrev-commit master
153b70a (master) initial
$ git fetch . feature/hello:master
From .
153b70a..b8b8f46 feature/hello -> master
$ git log --pretty=oneline --abbrev-commit master
b8b8f46 (master, feature/hello) hello
153b70a initial
$ git branch --merged master
feature/hello
master
$ git log --pretty=oneline --abbrev-commit
032253a (HEAD -> feature/world) world
153b70a initial
$ git branch -d feature/hello
error: The branch 'feature/hello' is not fully merged.
If you are sure you want to delete it, run 'git branch -D feature/hello'.
$ git rebase master
First, rewinding head to replay your work on top of it...
$ git branch -d feature/hello
Deleted branch feature/hello (was b8b8f46).
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment