, git branch -d git branch -d, git , . , , .
.
$ touch initial ; git add initial ; git commit -m 'Initial commit'
[master (root-commit) 2182bb2] Initial commit
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 initial
$ git checkout -b mybranch
Switched to a new branch 'mybranch'
master mybranch
commit, , , .
$ git lola
* 2182bb2 (HEAD -> mybranch, master) Initial commit
, git lola , ,
$ git log --graph --decorate --pretty=oneline --abbrev-commit --all
* 2182bb2 (HEAD -> mybranch, master) Initial commit
mybranch.
$ touch mybranch ; git add mybranch ; git commit -m 'My branch'
[mybranch 7143aa4] My branch
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 mybranch
.
$ git lola
* 7143aa4 (HEAD -> mybranch) My branch
* 2182bb2 (master) Initial commit
, git .
$ ls -R .git/refs
.git/refs:
heads tags
.git/refs/heads:
master mybranch
.git/refs/tags:
, , .
$ cat .git/refs/heads/master .git/refs/heads/mybranch
2182bb2d5a0a7f57d0b74e95d37e208dac41f95b
2182bb2d5a0a7f57d0b74e95d37e208dac41f95b
, git refs ,
SHA1
. , git lola (2182bb2) cat .
git refs , .
, master zap mybranch
$ git checkout master ; git branch -D mybranch
Switched to branch 'master'
Deleted branch mybranch (was 7143aa4).
, ref
$ ls -R .git/refs
.git/refs:
heads tags
.git/refs/heads:
master
.git/refs/tags:
.
$ git show
7143aa477735382e7a0ed11c9e4b66c1f27583df My branch
diff
new file mode 100644
index 0000000..e69de29
mybranch ,
$ git checkout -b mybranch 7143aa4
Switched to a new branch 'mybranch'
$ git branch mybranch 7143aa4
, ,
. ,
, git lola
$ git lola
* 7143aa4 (mybranch) My branch
* 2182bb2 (HEAD -> master) Initial commit
, , . . . git reflog git gc.
, SHA1
, ,
, .
-d -d .
-d
--delete
. HEAD, --track --set-upstream.
-d
--delete --force.
-f
--force
Reset branchname , branchname. -f git . -d ( --delete) & hellip;