All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kristoffer Haugsbakk" <code@khaugsbakk.name>
To: Carlos <kaploceh@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: not robust inconsistent git 2.40.1 with HEAD -> master, origin/main, origin/HEAD, origin/master, main
Date: Wed, 31 May 2023 12:08:31 +0200	[thread overview]
Message-ID: <ea3e1ea7-7f2e-4f15-b910-06c3cad54e24@app.fastmail.com> (raw)
In-Reply-To: <lxh4jpacuv5ivqp35w5vpbcjlw67r7ix3yog6cc3cu5ij7yqho@mrtr24xxdstx>

Hi

On Tue, May 30, 2023, at 20:14, Carlos wrote:
> Running git 2.40.1 with HEAD -> master, origin/main, origin/HEAD,
> origin/master, main with initial commit on main does not show all the
> objects from master

Does this mean that `HEAD` and all of these other things point to the
same commit? Is this the output of `git log` with decorations?

What are `main` and `master` meant to represent? One often doesn’t use
both of these names unless you have a legacy setup (originally `master`,
then moved to `main`).

What can be confusing to me is that git(1) uses `master` as the default
branch name that you get after `git init`—this can be configured, but
`master` is currently the default.[1] Meanwhile, GitHub uses `main` as
the default name. So what sometimes happens:

1. Someone makes a local repository with `master` as the initial branch
2. They make a repository on GitHub
3. They click on “add a readme” or something
4. Then GitHub creates a branch `main` with that readme addition on it
5. They push their local changes and end up with two “default” branches:
   `master` with their own changes, and `main` with the default readme

Maybe both you (locally) and GitHub made commits named “Initial commit”?

† 1: I’ve heard that the default might be `main` on Git For Windows, though?

> ! [main] Initial commit
>  * [master] Initial commit
>   ! [origin/master] Initial commit
> ---
> +*+ [main] Initial commit
>
> the chunk of objects are on master and not main, and yet it shows
> nothing once checking out to master.

It looks like both `master` and `main` point to the same commit.

Do you have some command that you expected X output or behavior from,
but instead got Y output or behavior?

> the git-clone operation is not consistent either. It's a disaster.

What do you expect it to do and what actually happens?

Cheers

-- 
Kristoffer Haugsbakk

  reply	other threads:[~2023-05-31 10:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30 18:14 not robust inconsistent git 2.40.1 with HEAD -> master, origin/main, origin/HEAD, origin/master, main Carlos
2023-05-31 10:08 ` Kristoffer Haugsbakk [this message]
2023-05-31 10:57 ` Philip Oakley
2023-05-31 13:22   ` Philip Oakley
2023-05-31 21:35     ` Carlos
2023-05-31 22:36       ` Carlos
  -- strict thread matches above, loose matches on Subject: below --
2023-05-30 17:58 Carlos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea3e1ea7-7f2e-4f15-b910-06c3cad54e24@app.fastmail.com \
    --to=code@khaugsbakk.name \
    --cc=git@vger.kernel.org \
    --cc=kaploceh@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.