Git development
 help / color / mirror / Atom feed
* bug - Inconsistency of git status and branch, ./git/branches and ./git/HEAD
@ 2023-09-30  6:51 Irina Gulina
  2023-09-30  7:03 ` Irina Gulina
  2023-09-30 11:28 ` Chris Torek
  0 siblings, 2 replies; 5+ messages in thread
From: Irina Gulina @ 2023-09-30  6:51 UTC (permalink / raw)
  To: git; +Cc: Tomas Tomecek

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
1. create an empty directory in CLI: mkdir test_repo
2. convert it to a git directory: cd test_repo & git init
3. 'git status' will say you are "On branch master"
4. 'git branch', 'git branch --all', or 'git branch --list' - nothing
will say the master branch exists. And per man pages definition the
branch command displays existing branches. So the question is why 'git
status' says "On branch master", but 'git branches' don't?
5. check on 'ls -la ./git/branches' - it's empty
6. check on 'ls -la ./git/refs/heads' - it's empty
7. check on 'cat ./git/HEAD' - it shows 'ref: refs/heads/master' -
why? if we didn't create any commit, and no branch exists?

What did you expect to happen? (Expected behavior)
git status should not say "On branch master", cat ./git/HEAD should be
empty.  Or the master branch should be created in ./git/branches and
the 'git branch' command should display it.

What happened instead? (Actual behavior)
Inconsistency between 'git status', 'git branch', ./git/branches and ./git/HEAD

What's different between what you expected and what actually happened?

Anything else you want to add:

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.41.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 6.4.12-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 23
17:46:49 UTC 2023 x86_64
compiler info: gnuc: 13.1
libc info: glibc: 2.37
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-09-30 17:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-30  6:51 bug - Inconsistency of git status and branch, ./git/branches and ./git/HEAD Irina Gulina
2023-09-30  7:03 ` Irina Gulina
2023-09-30 17:25   ` Junio C Hamano
2023-09-30 11:28 ` Chris Torek
2023-09-30 11:32   ` Chris Torek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox