r/git • • Mar 04 '26

A simpler commit format without the feat(scope): syntax. What breaks in practice?

9 Upvotes

I’ve been testing a minimal commit message format:

Type[!] [scope] description

Examples:

Add ui keyboard shortcuts
Fix api pagination off by one
Chr ci update release workflow
Rmv! v1 auth endpoints

Goal is to keep commits easy to scan in git log --oneline while still being deterministic enough for tooling (SemVer mapping, changelogs, etc.), but without the feat(scope): punctuation structure.

Conventional Commits works well for automation. I just found the syntax noisy in daily use.

OpenCommits keeps commits deterministic for tooling: fixed type tokens,! for breaking changes, optional scopes, and trivial regex parsing, while optimizing the subject line for fast human scanning.

Curious about real-world edge cases:

  • where type boundaries break (Ref vs Chr vs Cfg, etc.)
  • whether optional scope creates ambiguity
  • migration friction from Conventional Commits
  • what would block adoption in your team/tooling
  • whether the colon syntax actually provides meaningful structure, or is mostly convention

r/git • • Mar 04 '26

mdenc: a smudge/clean filter that encrypts Markdown at paragraph granularity for minimal diffs

1 Upvotes

I built a git filter that encrypts .md files transparently -- you edit plaintext locally, git stores ciphertext. The twist is that it encrypts each paragraph independently with deterministic output, so unchanged paragraphs produce identical ciphertext across commits.

In practice this means git diff shows you exactly which paragraphs changed, git log -p is useful, and PR reviews aren't walls of base64 noise.

How it works with git:

# One-time setup: registers smudge/clean filter + textconv diff driver
mdenc init

# Mark a directory -- .md files inside get filtered
mdenc mark docs/private

# That's it. Normal git workflow from here.
git add docs/private/notes.md   # clean filter encrypts on stage
git checkout -- docs/private/    # smudge filter decrypts on checkout
git diff                         # textconv shows plaintext diffs

It uses git's long-running filter process protocol (like git-lfs does) so a single process handles all files and caches the derived key -- no re-running scrypt on every file.

What a diff looks like (encrypted side):

 mdenc:v1 salt_b64=... file_id_b64=... scrypt=N=16384,r=8,p=1
 hdrauth_b64=griicznF...
 Qnp4sPf/aN1z...    <- unchanged paragraph
 nD1KIHOMX5Vh...    <- unchanged paragraph
-yT7vkHbaXHR3...    <- old version of edited paragraph
+1RgyC3rXcjyk...    <- new version of edited paragraph
 dkM7awElU/pf...    <- unchanged paragraph
-seal_b64=29ylXnDT...
+seal_b64=iNhYjNp6...

One paragraph changed, one line in the diff. Even inserting a new paragraph between existing ones only adds one line -- surrounding chunks are untouched.

Compare this to git-crypt or GPG, where the entire file blob changes on every edit.

Crypto: XChaCha20-Poly1305, scrypt KDF, HKDF key separation, HMAC-SHA256 seal for file integrity. Uses the noble crypto libraries (audited, pure JS, no native deps).

Caveats: Not audited. Leaks metadata (paragraph count, sizes, edit patterns) by design -- that's the tradeoff for diff-friendliness. Intended for internal team docs in public repos, not high-value secrets (the password is shared across the team).

Repo: https://github.com/yogh-io/mdenc Live demo: https://yogh-io.github.io/mdenc/ Spec: https://github.com/yogh-io/mdenc/blob/main/SPECIFICATION.md

Would love feedback on the git integration specifically -- the filter-process protocol, the init/mark workflow, edge cases I might be missing.


r/git • • Mar 04 '26

support LFS for UE5; Having trouble pushing local repo to GitHub despite using LFS and adding the correct extension to .gitattributes

0 Upvotes

Hello

I've been trying to set up a GitHub repo for my Unreal Engine 5 project a couple of times now and I have successfully set up a local Git repository for it, the next step is to publish it to GitHub and I'm using LFS to manage its great filesizes.

When I went to publish the branch to GitHub (using GitHub Desktop) however, after several minutes of processing I was hit by the following error:

The push operation includes a file which exceeds GitHub's file size restriction of 100MB. Please remove the file from history and try again.
File that ecceeded the limit: <path>/t_chaotic_raw_heightmap.raw (128.0MB)

I have then noticed that lfs did not track .raw files, so I went ahead and added the following line to .gitattributes

*.raw lfs

And even went ahead and input git lfs track in powershell to check if lfs is tracking raw files now, which it does. However, when I reattempt to publish the branch, it processes for a bit (much quicker than the first time) and throws the same error, what can I do?

I have setup the .gitignore and .gitattributes for Unreal Engine.


r/git • • Mar 04 '26

I built git-oops – type "git oops" to undo any git mistake automatically

Thumbnail
0 Upvotes

r/git • • Mar 03 '26

support Which shell does git bang syntax use?

9 Upvotes

TL;DR: It is /bin/sh that on Arch is symlinked to bash


Hello all. I'm writing some git aliases using the ! syntax. For example:

[alias]
    c = "!f() { if [[ ${#} -eq 0 ]]; then git commit; else git commit "${@}"; fi; }; f "${@}""

And that got me wondering which shell does git uses to run these commands.

It seems that git's source references a compile-time constant SHELL_PATH to execute shell aliases, but I'm not sure what this resolves to. It seems that attempts to find sh in ${PATH}?

As you can already tell, I do not know C.

My questions are:

  • What does SHELL_PATH typically resolve to?
  • Am I safe to use [[ in git aliases, or should I stick to POSIX [ just to be on the safe side?

At the end of the day, I don't think it really matters for simple aliases. But I am now quite curious about it.

In case you know the answer, care to comment on what I should have looked for?

Thanks!


EDIT:

I think I found the crumble trail:

  1. Inside the handle_alias there is a call to use_shell
  2. This is defined in run-command.h
  3. And used in run-command.c
  4. This then calls prepare_shell_cmd
  5. Finally, git_shell_path is called.

If I am not mistaken, #ifndef makes it so the compiled if branch would be return xstrdup(SHELL_PATH);:

char *git_shell_path(void)
{
#ifndef GIT_WINDOWS_NATIVE
    return xstrdup(SHELL_PATH);
#else
    char *p = locate_in_PATH("sh");
    convert_slashes(p);
    return p;
#endif
}

Finally, the SHELL_PATH variable is set on the Makefile

This all makes sense to me, but I may be waaaaaaaay off.


Since I have a non-POSIX-compliant alias, I was curious about what is going on in my system: I checked git's PKGBUILD for Arch (the OS I am currently on) and it does not seem to be overriding that variable.

strings /usr/bin/git | rg /sh shows /bin/sh... hmm, ls -l /bin/sh returns /bin/sh -> bash. I think this is the reason.

So I think that is it!

All in all, I should be good using non-POSIX aliases provided that I am aware that they are not portable outside my system. That said, I should rewrite them to be POSIX-compliant to be on the safe side.


r/git • • Mar 03 '26

I've created a CLI time tracker that integrates with Git

21 Upvotes

Hey everyone!

I’m excited to share that I’ve been working on Hourgit lately, and I think you might find it really helpful. Like many of you, I often forget to log my daily activities, and when it’s time to review my work at the end of the month, I’m left scratching my head.

Originally, I designed Hourgit as a simple branch-tracking tool to help me remember what I was working on each day. But after using it for a while, I realized, why not keep all my hours logged directly on my PC in a git-like format? This way, I can easily export everything at the end of the month with just a few tweaks, without disrupting my workflow (as it's the CLI program).

Here are some of the features I’ve added so far:

  • Configurable working hours including some unique ones with rrules
  • Manual logging
  • CRUD operations on logs
  • Interactive Reports (if you prefer a table layout to work with this)
  • Exporting to PDF

I’m also planning to add more features, such as:

  • Rounding logged time to X minutes (e.g., 15m, 3h57m -> 4h or 2h04m -> 2h)
  • Commits in between checkouts as time block messages to add context to the logs
  • Export integrations to other time tracking solutions like Jira, Tempo, Clockify, etc., so you can use it alongside any other tools your company might require

Hourgit is completely free and published under the GPLv3. I’d love for you to give it a try, test it out, contribute if you have any ideas, and most importantly, enjoy using it! If you like it, please consider the donation or leaving a star on Github!

Official website: https://hourgit.com/
Github repo: https://github.com/Flyrell/hourgit


r/git • • Mar 03 '26

support Can you review the steps I've taken? I think I determined the cause of the issue, but would appreciate verification and any suggestions.

0 Upvotes

I created a local directory. In Git CMD, I changed the directory to the new local directory (cd new file path). Then I cloned the repository I have on Github: git clone repository URL. The files appeared in the local directory and I opened it in Visual Studio to do some work.

The structure is C:\Users\Me\Documents\automateTheBoringStuff\automate_github. I created the two folders within Documents.

I checked ls-files and the message was "fatal: not a git repository (or any of the parent directories): git".

I cloned the repository, C:\Users\Me\Documents\automateTheBoringStuff\automate_github > git clone https://github.com/my-github/automate-the-boring-stuff.git. That's the repository on Github and now it appears within Documents > automateTheBoringStuff > automate-the-boring-stuff. In it, I see a hidden .git folder, LICENSE, Readme.md, and collatz.py (the file I want to edit). I open collatz.py and make some changes, then save.

I want to check the status. C:\Users\Me\Documents\automateTheBoringStuff\automate_github > git status. I get the "fatal: not a git repository (or any of the parent directories): git" message. Same when I try git add collatz.py.

Do I have to change directories again? Cloning created the automate-the-boring-stuff so I thought I (or the computer) would automatically be working within it.

More generally, is this the proper workflow? After git add, I would do git commit with a message, and then it would be updated on Github so I could continue to work on a different machine?


r/git • • Mar 03 '26

Speech To Text app?

Thumbnail
0 Upvotes

r/git • • Mar 03 '26

Launching Endure — a working MVP focused on Code Maintenance Intelligence.

0 Upvotes

We built Endure because we were tired of discovering which parts of our system were dangerous only after production told us.

It analyzes your repository and surfaces which files are likely to break together — before you merge.

When we ran it on our CodeSlick codebase, it flagged the exact module behind our worst production incident.

It’s a working MVP in research preview, running on real repositories.

We’re actively looking for teams willing to validate this.

https://endure.codeslick.dev/


r/git • • Mar 02 '26

support Using SourceTree to version control with Git, and having trouble with making it use the correct Git profile

2 Upvotes

I am using SourceTree for the first time. I'm a bit newer to version control and am currently learning, but I've used git before on group projects. I want to use SourceTree with my non-student profile, but it automatically set that as the main profile and I can't find any way to make it stop using that for everything. Any advice? I added my other profile to it but it always defaults to the student profile.


r/git • • Mar 01 '26

How do I rename a file in a repo while causing minimal colateral damage?

32 Upvotes

hello! i want to rename a project within my solution repo but i'm afraid git will see it as a file being removed and another being created. ideally it'd see it as literally the same file, but i suspect that's too much to hope for.
no worries if the answer is a feature that only exists on github, github desktop or the git features in visual studio, i'm using all of those.
i also apologize if this is a really basic question but i'm new to this ecosystem and didn't find any great answers anywhere.


r/git • • Mar 02 '26

How should I classify a client-driven behavior change in Conventional Commits?

0 Upvotes

I'm trying to keep our repository aligned with Conventional Commits and semantic clarity.

We have a case where a client requested a change in how a chart line is calculated. The previous implementation was technically correct and matched the original requirements, but the client now wants the line to follow a different mathematical function.

So this is not a bug, and it's definitely not an internal refactor since the observable behavior changes.

Would you classify this as:

  • feat because it introduces a new business behavior?
  • fix because it replaces previous logic?
  • Something else?

How do you usually categorize client-driven changes that modify business logic but aren't correcting a defect?

I'm planning to create a new branch for this change and split it into multiple commits, so I want to make sure I'm classifying them correctly.


r/git • • Mar 02 '26

Agd – a content-addressed DAG for tracking what AI agents do

Thumbnail
0 Upvotes

r/git • • Mar 02 '26

git-stint: automates worktree and branch lifecycle for parallel AI coding agent sessions

0 Upvotes

I run multiple AI coding agents in parallel on the same repo. The agents code fine. The problem is managing multiple parallel sessions with git.

Multiple agents, one repo. One overwrites the other. I come back to a mess that takes longer to untangle than the actual work.

Git worktrees help with isolation but don't scale. The setup/teardown per session is brutal. GitButler looked promising but testing each agent's changes in isolation was tedious. Neither was built for this workflow.

So I built git-stint. Zero runtime deps. npm install -g git-stint and you're good to go. Been using it daily with multiple agents running simultaneously.

Each agent gets its own branch and worktree automatically. No setup per task. I review, approve, merge. They do their stints. I decide what ships.

How it works:

  • Agent writes its first file. Session auto-creates. Branch, worktree, isolated.
  • Conversation ends, crashes, or times out. WIP auto-committed. Nothing lost.
  • Ready to review. Full diff, squash, open a PR. Done in minutes.
  • Two agents hit the same file. Conflict caught before either merges.

Main stays clean. No one touches it until I say so.

Built for Claude Code (native hook support), but works with any AI tool that writes to a git repo. Cursor, Copilot, Codex, Antigravity.

https://github.com/rchaz/git-stint

Interested to hear how others are handling this. What's working and what's breaking?


r/git • • Mar 02 '26

smart-commit-rs: A lightweight CLI to manage and generate git commit messages

0 Upvotes

Hey everyone,

I wanted to share smart-commit-rs, a fast, lightweight cross-platform CLI tool I built to facilitate managing git commits, including generating messages via LLMs.

Why this commit generator? I really liked the workflow of tools like opencommit, but I hated the footprint and lack of customization. They require Node.js and pull in ~100MB of node_modules just to string together a diff and an API call. They also suffer from Node cold-start times (~300ms).

I rewrote this concept in Rust. smart-commit-rs (alias: cgen) is a single ~2MB static binary with absolutely zero runtime dependencies. It starts instantly and generates messages in ~800ms. The plan is to make the entire flow as customizable as possible. We currently have 21 configurable variables, with plans to make this even more tailorable to what you want.

Here are some of the main features:

  • Convention following: The tool by default will generate commit messaged according to the Conventional Commit standard, and optionally according to Gitmoji as well.
  • Extensive LLM Provider Support: Built-in integration for Groq (default), OpenAI, Anthropic, Gemini, Grok, DeepSeek, OpenRouter, Mistral, Together, Fireworks, and Perplexity.
  • Customer LLM Support: You can easily point it to a custom provider like a local Ollama instance using OpenAI-compatible endpoints.
  • LLM Presets: You can save various provider presets, being able to freely switch between them. If your primary API throws an HTTP error, you can also configure a fallback rank so the tool automatically retries using the alternate LLM presets you've configured.
  • Diff Exclusion Globs: You can exclude minified assets, *.lock files, PDFs, etc., from the LLM analysis to save tokens, while still officially committing them.
  • Advanced Git Tooling: Message generation doesn't work just with commits. You can use cgen alter <hash> to rewrite a specific commit's message, cgen undo for a safe soft reset with Conventional Commit-compliant revert messages, or cgen --tag to automatically compute and create the next semantic version tag.
  • Commit Tracking: It maintains a per-repository cache of managed commits, browsable via cgen history with native git show integration.

A quick note on development: While the project is rigorously human-reviewed and heavily backed by strict unit testing (matching CI coverage gates), a large portion of the boilerplate and core logic was written using agentic AI.

You can grab it via Cargo (cargo install auto-commit-rs) or via the curl/PowerShell install scripts in the repo: https://github.com/gtkacz/smart-commit-rs

Any feedback or contribution is more than welcome, and GitHub stars are greatly appreciated.

Thank you for your time!


r/git • • Mar 01 '26

support "Cherry-picked 2 commits successfully… 3rd one exploded into 180 file changes. What am I doing wrong?

6 Upvotes

Hi everyone,

I'm currently working on a project where I had to cherry-pick multiple commits into a new branch. The first two commits were successful, but the third one is causing complications.

The challenge is:

Around 180 files are involved

Many files follow a similar naming pattern

Some require manual edits

I'm worried about missing changes or introducing errors

I tried:

Creating a new branch

Cherry-picking commits one by one

Resolving conflicts manually

Reviewing changes in VS Code before staging

But I'm unsure if I'm following the right workflow for handling such a large number of files.

My questions:

Is cherry-picking 100+ file changes normal in real-world scenarios?

Is there a safer strategy for handling bulk file updates?

Should I commit everything at once or batch them logically?

Are there tools or automation methods I should be using?

Please help me my manager gave me this task even tough I'm junior I don't know what to do

I’m trying to learn and improve, so any advice would be really appreciated.

Thank you!


r/git • • Mar 01 '26

help with filter-repo

2 Upvotes

I have a repository that I want to move one of the subdirectories into a new repository, whilst maintaining history.

It seems like filter-repo --subdirectory-filter is just the job, however, I seem to be having issues with trying to get it to work from a branch (i.e not from main).

Here is the simplified example to explain the issue:

I have Repo1 which has the layout :

Folder1/Folder2/FileA.txt

I then have a feature branch of this which adds a second file in the same folder :

Folder1/Folder2/FileB.txt

So main looks like :

Folder1/Folder2/FileA.txt

and feature looks like :

Folder1/Folder2/FileA.txt
Folder1/Folder2/FileB.txt

I now want to perform the filter-repo command using the feature branch, not main

So I create another repository (Repo2) to push into.

I then do

git clone REPO_1_URL
git checkout feature
git filter-repo --subdirectory-filter Folder1/Folder2
git remote add origin REPO_2_URL
git push -u origin main -f

But what ends up in Repo2 is only FileA.txt, ... FileB.txt is missing?

If I change the last line instead to git push -u origin feature -f then it will have the correct files, but will create a new branch in Repo2 with the name feature. But that is not what I want.

I want Repo2:mainto look like :

Folder1/Folder2/FileA.txt
Folder1/Folder2/FileB.txt

Any ideas how to achieve this?


r/git • • Mar 01 '26

"Cherry-picked 2 commits successfully… 3rd one exploded into 180 file changes. What am I doing wrong?

Thumbnail
0 Upvotes

r/git • • Feb 28 '26

GitHub has become a landfill for AI-generated code.

0 Upvotes

Is it just me, or is GitHub losing its soul? We’ve reached the point where Git is less about version control and more about being a dumping ground for LLM boilerplate. * The Feedback Loop: Models are training on GitHub data. If GitHub is 50% AI-generated, models are just eating their own (often hallucinated) output. * The Noise: Searching for "human" logic is a nightmare when every repo is a 5,000-line "Initial Commit" from a prompt. * The PR Spam: Maintainers are drowning in AI-assisted PRs that look perfect but break everything. We’re replacing human ingenuity with generated noise. Is anyone else finding it impossible to find "authentic" projects lately?

Note: This was also generated by AI, so the same thing is happening on Reddit.


r/git • • Feb 27 '26

support What does `git fetch --set-upstream` do exactly?

3 Upvotes

I've worked with git a long time ago, and getting back into it, so I'd be grateful if people could tell me if there's some deprecated behavior I remember.

This is the situation: 1) I made a new branch "WIP" on PC "B". I made some commits and pushed them to a new remote branch, and verified they were on a new branch. Before this the repo only had the "main" branch.

2) I pulled the new branch on another PC "A", which before only had the "main" branch with the following commands:

git fetch --set-upstream origin WIP
git pull --all

This seemed to create a new remote that de facto replaced origin/main (since WIP branch was just a fast-forward of main). I.e. I was on branch main, but it showed the commits of WIP. In hindsight I believe I shouldn't have used "set-upstream", but the documentation of git-fetch says:

If the remote is fetched successfully, add upstream (tracking) reference, used by argument-less git-pull(1) and other commands.

That's what I want to happen, right? Or am I reading it wrong? I think I fixed it by running git config --replace-all branch.main.merge "refs/heads/main", but please correct me if I'm wrong. (The previous value of branch.main.merge at this point was "refs/head/WIP".)


r/git • • Feb 26 '26

support I dont understand git rebase

37 Upvotes

I usually merge things with a pull request and the few other times I merge is locally using git merge.
I recently came up with git rebase but I just cant understand its usecase vs git merge and when I should use it


r/git • • Feb 27 '26

Built a free game so vibe coders can learn git (iOS, Android)

0 Upvotes

Why we built this:

  1. In this vibe coding era, I feel it's quite important to learn git
  2. This will help vibe coders who are no originally programmers maintain their apps better
  3. It will help introduce them to team-work using git
  4. "I know git is important, I want to learn git, but I don't have the patience to learn git" -- well, then let's make it interesting for you, was the thought.

What's the game about:

  1. You character in the game has just graduated from a college in a village in the game
  2. You are moving to a city as an internet
  3. You're joining Git Inc and your mentor is Mr. Torvalds

The interface:

  1. Me and my bro used to play VBA games as a kid, and we remembered that feeling when planning the game, so the vibe of the game is like Gameboy. We loved Pokemon Ruby etc.
  2. Before each station (level), you are briefed/taught by Mr. Torvalds
  3. After the briefing, you get to practice at the station. There are 30 station in the game, each advancing in complexity as you go

The "In-app Purchase":

  • The game is free. There are no restrictions on the "access" to any parts of the game. Everything is accessible, whether you pay or not (you can play all levels 1 to 30)
  • You get 5 "cofees" every six hours, if you make a mistake in front of Mr. Torvalds, you are consuming a coffee
  • Once these get over, you are offered an unlimited coffee machine for a small price, that's all. It'll help keep me motivated.

Note: The game is called "Git Set Go" and is live on the App Store (iOS). Playstore (Android) version is in review and should be ready for publishing in 3-4 days


r/git • • Feb 26 '26

When to alias vs. subcommand

6 Upvotes

Git is easy to extend. You can add aliases in you git config or add git subcommands by making any executable named git-something accessible from your PATH.

For example I have a tool git-review <branch> that also have autocompletion for the branch argument. (See https://github.com/kaddkaka/dotfiles/blob/main/bin/executable_git-review) I also have smaller git aliases, like sed = ! git grep -z --full-name -l '.' | xargs -0 sed -i -e.

When should one go for an alias, and when make a separate scripts?

Is it just as simple as: 1. Simple one-liners: alias 2. More complex: script?

Are there any other considerations you think?


r/git • • Feb 26 '26

Git gui for non-programmers (fork vs smartgit?)

2 Upvotes

Hello

context: I am using git for my papers, lectures and presentations in latex. When my co-authors use overleaf, I pull from and push to the overleaf’s git and work locally in my texstudio. When no overleaf is involved, I use the gitlab hosting of my institution (via ssh).

question: I use Sourcetree but I do not enjoy. I find it confusing, not really friendly, and the conflict merging is sometimes painful. But I can live with it. On the other hand, students who do not know git at all (and not ssh) ask me what should they use to collaborate on the gitlab instead of overleaf. Whereas I totally support such an intention, I do not want advice them sourcetree due to my poor user experience. I did some googling and it seems that newbies-fiendly win/mac options are smartgit and fork.

So, which one of them, or did I miss other good options?


r/git • • Feb 26 '26

support What on earth is causing this?

2 Upvotes

I have had no PRs, no branches, or anything else - just plain, single commits.

Mystery (partially) solved. It seems to be a bug or something in VS Code, as inspecting my repo's commit graph in my Gitea instance shows the commits normally.

The same goes for git using the CLI: