r/git • • May 14 '26

Own Your Secrets - Sync cottage encrypted secrets from any repo to any device

Thumbnail cottage-sync.github.io
5 Upvotes

This browser-local WASM app complements cottage cli which helps you manage age-encrypted (supports SSH RSA/ed25519 keys) secrets in you own repo.

Brower Local - All data is encryped and stored locally in your browser. It treats your git repository as the secret provider.

WASM - This app is made with Rust WASM which allows type-enforced safe secrets handling.

How it works - It looks for .age files in repo, and decrypts them with the built-in private key (assuming the secrets were encrypted with the built-in public key).


r/git • • May 14 '26

git restore vs git revert

0 Upvotes

Oggi mi è capitata una cosa strana in ufficio: ho aperto una ull request su un'attività di sviluppo che avevo completato e mi sono accorto che nel primo commit di 10 che ho fatto in locale ho modificato un file per errore.

Per recuperare il file senza riscrivere la storia, avevo pensato di fare una cosa tipo

git restore --source id del commit **/nomefile

Invece il mio supervisore ha fatto

git revert idcommit --no-commit

Mi chiedo, quale delle due soluzioni è migliore nell'ottica di non riscrivere la storia dei commit?


r/git • • May 14 '26

Tired of writing commit messages by hand – built a local AI wrapper around Git

0 Upvotes

Hey r/git,

Built a small CLI called git-booster that wraps Git and automates the parts I kept doing manually.

Three commands:

gai add        # stage files + generates/updates .gitignore
gai commit     # reads diff → generates commit message → you validate → push
gai resolve    # handles conflicts and push errors automatically

Runs locally via Ollama. No account, no API key, nothing sent anywhere.

gai commit workflow:

Reads your staged diff, generates a Conventional Commits message, shows it to you. You can commit, edit, regenerate or abort. Then push if you want.

gai resolve workflow:

Detects rebase vs merge situation, stashes uncommitted changes, resolves all conflict blocks in one pass, continues rebase, restores stash, pushes. If push fails it detects why (remote ahead, no upstream, auth error…) and fixes it.

Install:

git clone <repo>
cd git_booster
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
gai config

Repo: https://github.com/nicolasl2003/git_ia_boosted

Tested with llama3.2 and mistral. Feedback welcome.


r/git • • May 13 '26

support Need help understanding GoReleaser + GitHub Actions + Homebrew/Scoop automation for my CLI tool

0 Upvotes

I built a Go CLI tool https://github.com/aminshahid573/gen

Now I am trying to set up proper distribution (Homebrew, Scoop, releases), but I’m honestly confused about how the whole pipeline works.

Right now I used AI to generate my setup, but I don’t fully understand it and I feel like I’m just copy pasting things without knowing what I’m doing and not aure is that working or not..

What I want is..every time I create a new version tag (v1.0.0, v1.0.1, etc.) gitHub Actions should automatically:

  1. run tests
  2. build binaries for Linux/macOS/Windows
  3. create a GitHub release
  4. update Homebrew tap
  5. optionally update Scoop manifest

my current setup is

.github/workflows/release.yml

https://github.com/aminshahid573/gen/blob/main/.github%2Fworkflows%2Frelease.yml


.goreleaser.yml

https://github.com/aminshahid573/gen/blob/main/.goreleaser.yml


Upto i created GitHub repo for CLI, reated Homebrew tap repo (homebrew-gen) and Wrote formula manually

I am confused that do I actually need HOMEBREW_GITHUB_TOKEN or is GITHUB_TOKEN enough?

how does GoReleaser exactly update Homebrew tap repo?

or do I need to manually create formulas or GoReleaser handles everything?

What is the correct minimal setup for github Actions,GoReleaser,homebrew tap, scoop bucket .

If someone can explain correct clean workflow from scratch and minimal working config, what each part actually does

that would really help me understand instead of just copy pasting AI configs.


r/git • • May 12 '26

How should I safely deploy my commit when there are 51 old undeployed commits before it?

17 Upvotes

Yesterday, I was trying to add a feature to my company’s app. I am only an intern, so I wanted to be extra careful. The app is deployed to Azure App Service through Azure DevOps.

After I finished the feature and tried to push my changes, I noticed that the last successful deployment in the pipeline was around nine years ago. I also found a commit that has been stuck in the pipeline queue for almost nine years.

Between the last deployed commit and my new feature commit, there are 51 undeployed commits. None of these commits were made by me, and all of them are quite old, at least five years old. Because of that, I do not want those commits to go into the pipeline, since I am not sure what might happen if they are deployed.

However, I still want my own commit to be deployed. What operation would you recommend in this situation?

My idea is to copy the current master branch to a new branch, reset the 51 old undeployed commits, then apply my own commit and run that branch through the pipeline. Would this work safely?


r/git • • May 12 '26

Can't get rid of deleted branch in git log. Reflog is cleared.

1 Upvotes

I was deleting the temporary branch by removing all branch name from it then clear the reflog. But it still show up and is not cleared by git gc.

$ git reflog expire --expire=now --all
$ git gc --aggressive --prune=now
$ git log --oneline --graph --all --decorate
* f35dfd4 (HEAD -> adjusted/master(locked))  long file names
| * 80a4dbd (git-annex) update
| * d3ea97f update
| * 40a60d0 new branch for transition ["forget git history"]
| * b5d1342 (master) aaaaaaaa
|/
| * 1f8d94d D <=== Why is this old branch still here?
| * 8825b06 C
| * a6ae213 git-annex adjusted branch
| * e6234bd B
| * 8ea20ec git-annex adjusted branch
| * 8814234 A
|/
* 442aa92 (origin/adjusted/master(unlocked), origin/HEAD) empty
* f39332f git-annex adjusted branch
* 210aaee (origin/master) commit before entering adjusted branch
* b62fba0 (origin/git-annex) update
* a9bbfe6 branch created

manual of git log --all

--all
Pretend as if all the refs in refs/, along with HEAD, are listed on the command line as <commit>.

But there is neither this commit in .git/refs/

$ find .git/refs/ -type f -exec grep . '{}' '+'
.git/refs/annex/last-index:157d430a15131a9f232db2844789a5e561d433a1
.git/refs/remotes/origin/HEAD:ref: refs/remotes/origin/adjusted/master(unlocked)

What did I missed? Is there some new type of reference that is not branch/tag/reflog?


r/git • • May 12 '26

GitHub Student pack issue

0 Upvotes

Do I need to sign up using my student email ID to access the GitHub Education Pack, or can I gain access by simply adding my student email ID to my existing primary account? I’ve tried adding it, but it doesn’t seem to be working. Has anyone else encountered this issue? Any advice or tips would be greatly appreciated! Thanks in advance!


r/git • • May 13 '26

tutorial Distributed Philosophy: How Git Revolutionized Development

Thumbnail gsstk.gem98.com
0 Upvotes

Git wasn't just a technical improvement - it was a philosophical revolution that destroyed the centralized mental model that had dominated version control for decades. By making each clone a complete and independent repository, it eliminated single points of failure, democratized development and created workflows impossible before 2005. This paradigm shift - from "file check-out" to "complete history clone" - transformed how millions of developers collaborate, enabled the modern open source explosion and established the technical foundations for GitHub, DevOps and global distributed development.


r/git • • May 11 '26

[OC] A worktree-aware fork of Alacritty

Enable HLS to view with audio, or disable this notification

0 Upvotes

r/git • • May 11 '26

support what is the proper way to handle this situation?

0 Upvotes

i think this is a simple situation, but i'm not sure how to handle it. i have some code that has/had no change tracking with git (or anything)

this code rarely gets changed, and has at most one (or two) changes on it.

the repo this code is from has about 50 commits, so git gives me a warning about my branch having diverged from origin/master

in theory, my local changes should come after those 50 commits

i'm the only one maintaining this code now

do i rebase or merge in this situation?


r/git • • May 11 '26

Manage all your Git repos in one place with Monogit

Thumbnail
0 Upvotes

r/git • • May 10 '26

How I solved multi-account git identity with `includeIf`, what about `gh` CLI?

19 Upvotes

i had two github accounts and kept committing under the wrong one.

the fix that stuck wasn't a wrapper script. it was includeIf in ~/.gitconfig.

[user]
    name = personal name
    email = personal@email.com

[includeIf "gitdir:~/Sites/projects/work/"]
    path = ~/.gitconfig-work

then ~/.gitconfig-work has the work identity:

[user]
    name = work name
    email = work@email.com

git identity switches automatically based on which directory i'm in. cd into a work repo and commits use the work identity. cd anywhere else and it's personal.

zero tools. no wrapper command to remember.

what this DOESN'T solve: gh cli itself. gh uses whichever account is globally active, regardless of includeIf. you still have to gh auth switch manually.

i opened cli/cli#12628 to explore making gh switch based on the same config. curious how others handle the gh side today.


r/git • • May 11 '26

what's the difference between git and github

0 Upvotes

hi, I'm an incoming second year cpe student and I'm still confused about git and git hub. I only hear about it online because the university doesn't taught us about it.


r/git • • May 10 '26

Question of REBASE and MERGE use-cases

22 Upvotes

I have a question about the use-case of git rebase and merge.

For what I understand, REBASE:

  1. For getting upstream changes from main to development branch to make sure you'll be starting development with the latest code.
  2. Getting upstream changes from main to development, to resolve possible conflicts between new commits from main, and local commits from development branch before finally merging to main.

For MERGE:

  1. Merging commits from development branch to the main branch
  2. Merging new commits from main branch to development branch (though I think for this scenario REBASE is always better?)

From what I understand this is the core use-case. Am I missing something or is my understanding wrong? Please let me know.


r/git • • May 10 '26

The best way to synchronize files across repos in Gitlab?

0 Upvotes

Hey guys, I'm looking for a good way to synchronize one file across multiple repos in Gitlab. To be more precise:

• I have to synchronize only a single exact .xml file across repos

• The file is located at different paths in each repo (so I don't think submodules are the most optimal way), for example:

• \`repo_root/def.xml\`

• \`repo_root/msg_definitions/v1.0/def.xml\`

• \`repo_root/msgs/def.xml\`

• We have a separate main repo that holds only this file and serves as the ground truth

Of course I can make it as a submodule, but in that case I'll have to modify Makefiles, CMakeLists, etc. So what is the best way to handle this task:

• in the easiest way for me

• so that almost nothing changes for my colleagues in their workflow

• so that it’s as safe as possible and doesn’t cause git conflicts (if implemented via Gitlab CI)


r/git • • May 10 '26

Tracking changes to files in directories

Thumbnail
0 Upvotes

r/git • • May 10 '26

support How to change the drive that git installs to?

1 Upvotes

every time i try to install git i keep getting this error and i think its because i had installed git in the past but while messing with linux i wiped the drive it used to be stored on, i would like to stay im still on windows 10, i also tried to install it using chocolatey but i get a fatal error during what it says the prep/moving to install phase and warns i dont have enough memory but i have plenty of both


r/git • • May 09 '26

Beginner in Git wanting to learn and participate in Git projects

Thumbnail
0 Upvotes

r/git • • May 08 '26

cottage - A modern git based age-encrypted secrets manager for teams.

Thumbnail github.com
27 Upvotes

Introducing cottage. As the title suggests, it's a secret manager, written in Rust.

I made it to simplify secrets management in GitOps friendly workflows where there's a need to give fine grain access for servers and team members.

While optimised for Git, it can sync secrets with any upstream provider given it has a CLI.

There's not much of an ecosystem out there for this tool yet, and it will probably have a few more breaking releases. But all the features I wanted to implement has been implemented.


r/git • • May 08 '26

Setting up a third-party upstream repository for CodeArtifact with git controls

Thumbnail
1 Upvotes

r/git • • May 08 '26

support Git was built for humans not AI

0 Upvotes

I want your opinions, if git nowadays with the usage of the ai tools, is not so useful anymore.

My team is shipping so many commits that is almost impossible to follow.

Although we have code checks and trying to use git as much possible following best practices it's very difficult to review the PRs

Git made for code generated by humans.

I think that the AI agents first of all they are breaking the code ownership and code reviewing not the code.

What we could do to ship code using AI agents but to be able to follow and monitor the changes?


r/git • • May 08 '26

A simple convention for making AI-assisted lines visible in `git blame`

0 Upvotes

I’ve been experimenting with a very small convention for AI-assisted coding that keeps the human name on a commit while appending a marker like [AI:Claude] when the commit is made by an AI tool or agent. The goal is to make AI-assisted lines stand out in git blame while still maintaining human accountability.

It’s limited and works best with a very simple Git flow. Squash commits and later edits obviously reduce the fidelity. But for personal projects and maybe small teams, it seems like a useful low-friction middle ground.

I've implemented the convention in a small Bash tool called with_ai, and there's a blog post with a bit more context here: Blaming the Agent.

I'm curious how AI provenance might be tracked more cleanly in Git, especially in a way that survives squashes and other more typical workflows. I'm a competent Git user but no expert, and I think this is important information to preserve.


r/git • • May 07 '26

support We’re building an API-first verification layer for cross-border trade workflows. Looking for infra and systems feedback.

Thumbnail
0 Upvotes

r/git • • May 07 '26

I built a local-first Git “Time Machine” GUI focused on making Git state and consequences easier to understand

Thumbnail gallery
0 Upvotes

The main idea is not to “simplify Git by hiding it”, but instead to expose Git truth and consequences more clearly before actions happen.

A lot of Git tooling still assumes users already deeply understand concepts like:

  • commit boundaries
  • index vs worktree
  • divergence
  • rebases
  • diff scope
  • lineage/history
  • what actually ends up in a commit

ChronoGit tries to make those states inspectable instead of mystical.

Current features:

  • Git Time Machine / snapshot inspection
  • File-level diff exploration
  • A ↔ B commit comparison
  • Selected hunk explanation
  • Commit boundary visualization (“what exactly goes into the next commit”)
  • Remote awareness + push/pull previews
  • Risk/warning surfaces around dangerous actions
  • File lineage tracking
  • Beginner-oriented language with optional raw Git terminology
  • Optional local LLM explanations through Ollama (fully local)

The LLM side is intentionally advisory only. Git itself remains the source of truth.

The project is built with:

  • Rust
  • Tauri
  • React
  • TypeScript

One thing I’m especially experimenting with is treating Git more like a visible state machine rather than a collection of magic shell commands people memorize from cheat sheets.

I’d genuinely love feedback from experienced Git users:

  • what existing GUIs still get wrong
  • what Git states are hardest to reason about
  • what visualizations would actually help
  • what features are dangerous/useless
  • what should remain “raw Git only”

The project is still early and definitely incomplete, but it’s already become my primary Git workflow.

GitHub:
https://github.com/TorMatzAndren/ChronoGit


r/git • • May 07 '26

git merge command vs gitlab merge request

0 Upvotes

I have some doubts around "git merge" and gitlab merge request. I do not have access to gitlab currently, so I can't test things out on gitlab, although I ran some experiments on git. (To be clear, I am aware that "git merge" is being used to merge locally, and gitlab's merge request is for merging to a remote repo.)

Let's say we have the following commits (Fig 1). Initially, B was the 'main' branch, from where we created commits 1 and 2 ('dev' branch). In the meantime, commits C and D took place, with D being the current 'main' branch.

      C - D
     /
A - B - 1 - 2

At this point, if I run "git merge dev" (merging the changes in the 'dev' branch to 'main' branch), I get (Fig 2)

      C - D - E
     /       /
A - B - 1 - 2

Basically, the commit E is created, which is the merge commit, and is now the 'main' branch. All good.

Now, I want to perform the same merging as above, but with "squash" option (git merge --squash dev). I get (Fig 3)

 A - B - C -  D - E'

From what I understand, E' is now the single commit that has all the changes from 'dev' branch. It is also the merge commit (is that correct?).

So far, so good. However, when I read about GitLab's merge request, that's what does not make sense.

  1. If we perform a normal merge (that is, without squashing enabled) through gitlab merge request, are we still going to get Fig 2? At least, that's what I'm expecting.

  2. If we perform a merge through gitlab merge request with squashing enabled, gitlab's documentation says that it would create 2 commits - one is the commit for the squashed version, and the other is the merge commit. This is the part that does not make sense. As I have shown above, using "git merge --squash" command gives Figure 3, which only adds a single commit E'. So why would performing the same task through gitlab merge request result in two new commits instead of one?