this post was submitted on 22 Mar 2024
9 points (90.9% liked)

Git

2632 readers
25 users here now

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Resources

Rules

  1. Follow programming.dev rules
  2. Be excellent to each other, no hostility towards users for any reason
  3. No spam of tools/companies/advertisements. It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.

Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.

founded 1 year ago
MODERATORS
top 3 comments
sorted by: hot top controversial new old
[–] [email protected] 4 points 6 months ago

I like how the author is proceeding and how they explain the changes in the .git directory, but I think they're overcomplicating things a little.

[–] [email protected] 3 points 6 months ago (1 children)

They're mixing and messing definitions and concepts and separation together and then get confused because of it. It describes a behavior analysis discovery but lacks the useful, valid discovery. I don't think this is useful for others to read, and detrimental for git newbies, because it's more difficult and confusing than helpful.

  • git says HEAD defines the current branch
  • rebase is a process operating on commits and branches - it breaks out of the simple "current repository state" because there's a process and process state around that. They notice things being different, but fail to elevate their view or discover that they have to interpret it differently.
  • bare repository has no workspace - as such, workspace commands won't work, and there is no workspace current branch. HEAD defines the default/main branch.
[–] [email protected] 2 points 6 months ago

And they never ger into the got worktree subcommand and probably don't know you can have multiple things checkedout at once in a different Dir but still all pointing to the same local git clone.

Also with them you can have a bare repo with multiple worktrees at once. Have been working this way for a few months now and it is very nice when switching branches as that becomes a simple cd instead of a git switch or checkout. Which means you don't need to stash any pending changes before you switch branch.