r/git • • 39m ago

tutorial Two Developers OneLine GitMerge Conflict

1 Upvotes

What happens when two developers working on the same branch modify the exact same line of code differently?

Git can't automatically decide which change to keep, and that's where a merge conflict happens.

I made a short visual explanation of this using the multiverse chaos of Avengers: Doomsday.

A simple Git concept explained through a fun tech analogy.

Video: https://youtu.be/QCf2AztQOvU?si=ulEjPiaZsUNLhSYi


r/git • • 2h ago

Introducing ForkPlus --- Fork-like Git GUI and Free

Thumbnail gallery
0 Upvotes

I'm not affiliated with ForkPlus or its developer, and this is not a sponsored post. Just want to share

I have struggled between Git GUI for long time, one is Fork and the other is SourceGit. Fork is more sophisticated and intuitive and it performs better (or best?) in edge and heavy cases. But it is not open-source, no Chinese (my mother tongue) and paid software though Dan told me "Hi,

  1. As a student you can use Fork for free
  2. There is an already discounted price for China
  3. We never have discounts
  4. 2 people is cheap. We will release a paid update one day, but currently we didn't have a time for that. It will be kind of '5 years of updates'."

But I still want to pay for it because developers have to make a living. If I were a developer, I'd definitely want users to pay for my software too. And I think the couple also want me to pay for Fork. And Fork does not force users to pay, only pops up sometime, which makes me appreciate. But to be honest I am a newbie so I have not encountered the edge and heavy cases until now so Fork has almost no difference for me. But of course, Fork is maturer and a native app. Native desktop apps seem less common nowadays, perhaps because Electron apps are easier and more cost and time-effective to develop. For me, Fork would be almost perfect if it supported Chinese. The only difference I can notice is that the colorful graph of Git history is intuitive and better than SourceGit. But to be honest that I can read and type the Git professional term quick because it is short and intuitive but the Fork GUI's settings I cannot because the words are difficult for me

The SourceGit, however, almost in the opposite. Open-source, free and Chinese and to be honest, I do not care the graph of Git history very much

So I use both on my computer and I have not pay for Fork

Then, about a week ago, I discovered ForkPlus. So far, it seems to check all the boxes for me: a Fork-like interface, Chinese localization, an open-source license, and no purchase cost

PLUS: To be honest, if Fork supported Chinese, I'd definitely buy a license to support the couple

If Fork was open-source it was more convenient to support i18n and l10n because the community can add more language


r/git • • 11h ago

Limpar objetos desnecessários do Git

0 Upvotes

Como evitar que o diretório de um projeto aumente de tamanho progressivamente após executar git pull?

Tamanho da pasta: 1,8 G

$ du -sh ~/void-packages

1,8G /home/tux/void-packages

$ cd ~/void-packages

$ git gc --prune=now

Enumerando objetos: 1280134, concluído.

Contando objetos: 100% (1280134/1280134), concluído.

Compressão delta usando até 4 threads

Comprimindo objetos: 100% (397670/397670), concluído.

Escrevendo objetos: 100% (1280134/1280134), concluído.

Total 1280134 (delta 732231), reutilizados 1277709 (delta 729810), pack reutilizados 0 (de 0)

Expandindo commits alcançáveis no commit graph: 227298, concluído.

Escrevendo o commit graph em 4 passagens: 100% (909192/909192), concluído.

$ git count-objects -vH

count: 0

size: 0 byte

in-pack: 1280134

packs: 1

size-pack: 601.29 MiB

prune-packable: 0

garbage: 0

size-garbage: 0 byte

$ git pull

Já está atualizado.

$ du -sh ~/void-packages

1,8G /home/tux/void-packages

$ git maintenance run

Nada novo para empacotar.

Na pasta ~/void-packages/srcpkgs/ só tem arquivos de texto.


r/git • • 20h ago

support Committed a secrets file in my first internship week and realized I know about 6 git commands

26 Upvotes

first week of my internship and i committed an env file with sandbox keys to our team repo. nobody panicked, my mentor walked me through rotating them and rewriting the history, but watching him i realized i know maybe 6 git commands and understand none of them. my team will reimburse a course and theres 10 weeks left here. what would you have an intern learn first so they stop being scared of git??


r/git • • 2d ago

We built a time tracker that uses Git as a database

0 Upvotes

We've been using Git for version control for years, but recently we decided to try something a bit different: using it as a database for our team's time tracker.

Instead of running a backend and a database, we built a browser extension that stores everything needed for team time tracking in a private GitHub repository.

Here's how it works:

  • Time entries are stored as plain JSONL files, grouped by month and user.
  • Each team member writes to their own branch.
  • Changes are saved locally and synced in the background.
  • Git gives us version history, data portability and a way to recover previous versions of our timesheets.
  • Reports and invoices are generated directly in the browser.

Our whole team at Manticore Search has been using it for about a month now, and so far it's been working well.

The project is called Clockoli. It's free and open source, with no application backend of its own.

Clockoli relies on the GitHub API, but there's no Clockoli backend, and we don't have access to your time entries.

What I like most about this approach is that even if Clockoli disappears tomorrow, your data is still there. You can clone the repo, inspect its history, analyze the data with your own scripts or build your own tools around it.

https://github.com/clockoli/clockoli


r/git • • 2d ago

I built git-lineage to trace code back to its actual origin, cutting through formatting churn and noisy Git history

0 Upvotes

Hey r/git

I was working on a richer and deeper git blame to fix my personal pain, though of externalising it. Project is live on https://github.com/NayanSrivastav/git-lineage. Would appreciate some love or hate. Please take a look and share your feedback, appreciate your time.

Usage: https://nayansrivastav.github.io/git-lineage/


r/git • • 3d ago

Goat Hooker: Git hooks that skip what didn't change. Feedback welcome

Post image
0 Upvotes

I got tired of pre-commit hooks re-running the same 10 seconds of checks every time a commit message got rejected, and of mono-repos where every hook runs on every project. So I wrote Goat Hooker, a Git hooks manager in Rust.

What it does differently:

  • Only what changed. Each hook runs on the staged files it targets, and a hook whose files didn't change since it last passed is skipped. Retrying a commit with 5 hooks takes ~24 ms instead of re-running them.
  • Sees exactly what you commit. Unstaged changes are put aside while hooks run, and files fixed by formatters are staged again.
  • Mono-repos. Each project has its own hooker.config.json. Dependencies are read from Cargo / package.json / go.mod, so changing core also runs the tests of api.
  • Hooks can depend on each other and pass values. For example, a codegen hook hands its output to a lint hook.
  • hooker watch runs the hooks while you stage, so git commit itself is instant.
  • hooker import converts husky / lint-staged, lefthook and pre-commit configs.
  • There's also a desktop app if you'd rather click than edit JSON.

I benchmarked a git commit against lefthook, pre-commit and husky + lint-staged. With one no-op hook, the overhead is about the same as lefthook (30 ms vs 28 ms). It's well below pre-commit (146 ms) and husky + lint-staged (395 ms). The method is in the repo if you want to check it.

It's pre-1.0, so the config may still change. I'd love feedback on what breaks in your workflow, or what your current hooks manager does badly.

Repo: https://github.com/zuygui/goat-hooker

If you find it useful, a ⭐ on GitHub helps a lot: it's how a small project like this gets noticed.

(Yes, I know about the name.)


r/git • • 3d ago

survey Ditched GitHub (and skipped Gitea/Forgejo) for personal repos, wiki, and dotfiles: $0 3-2-1 setup with local git + restic + free R2/Dropbox + external HDD

0 Upvotes

I used to push my personal repos, markdown wiki, and dotfiles to private GitHub repos just for peace of mind, and almost spun up Forgejo on a small VPS when I decided to move off GitHub. Then I realized I didn't actually need a web UI, PRs, issues, or another daemon to patch and back up — git is already a complete history database, and a forge doesn't even solve the two things local git misses: uncommitted work and git-ignored files like .env and tool configs.

What I ended up running instead costs $0/month and uses zero background RAM. Local git handles normal committed history, and everything else is layered on restic (whole payload after excludes is ~420 MB, so it fits free tiers with years of history):

Hourly local restic snapshots run via a systemd --user timer into a separate Btrfs subvolume on the laptop (btrfs subvolume create so Snapper snapshots don't pin pack files that restic prune already deleted). That's my fast undo layer for uncommitted edits, .env files, or an accidental git reset --hard.

Every couple of weeks I plug in a USB external HDD and run one script that syncs both an encrypted restic repo and bare git clone --mirror copies for instant offline cloning. Daily offsite restic snapshots go to free-tier S3-compatible storage (Cloudflare R2's 10 GB free tier, or free Dropbox via rclone) with 14d / 8w / 12m retention, client-side AES-256 encryption, and a healthchecks.io dead man's switch that alerts me if 36 hours pass without a clean offsite run.

Compared to just pushing private repos to GitHub, the storage provider only ever sees opaque encrypted packs, accidental .env commits aren't sitting unencrypted on a third-party server, and restoring a single uncommitted file from Tuesday afternoon is one restic dump command. The only real trade-off is bootstrap discipline: if the laptop dies, you need your RESTIC_PASSWORD and offsite bucket creds stored outside the machine (password manager + paper copy) so you don't lock yourself out of your own backups.

Anyone else running pure local git + restic/borg instead of self-hosting Gitea/Forgejo, and how do you handle the "laptop stolen, need to bootstrap offsite restore from scratch" part?


r/git • • 4d ago

support What is an elegant way to jump back to the tip of the branch where you were at?

10 Upvotes

Suppose I do the following:

git checkout HEAD~5
git checkout HEAD~10
git checkout HEAD~100

I am now at a detached HEAD and it is not immediately obvious which branch I was at. What is an elegant way to go back to tip of the branch where I was originally at?

I can get a list from the reflog with git reflog --format='%gs' --grep-reflog='checkout: moving from' | awk '{print $4}' but this contains both branch names and commit hashes so I will have to further process them (git show-ref?) to discard the hashes and I'm wondering if there is a more elegant way to do it.

UPDATE: Solved


r/git • • 6d ago

Codeberg domain name suspension post-mortem

Thumbnail codeberg.org
0 Upvotes

r/git • • 7d ago

How the hell does Codeberg know which institution I go to

0 Upvotes

I just created my profile with my personal E-Mail there, made a commit to a private repository using Git GUI, and now I'm looking at it, and for some reason, it figured out my name and my instituion? I don't have that info on my E-Mail, let alone my Codeberg account... how the hell does it know this????????


r/git • • 7d ago

I got tired of my agents trampling each other's branches, so I built a Git client where each one gets its own worktree

0 Upvotes

gitmoire is a free desktop Git client I've been building (Windows, macOS, Linux). The 1-minute video above shows what it does.

What it does:

  • Battleplans. You describe a task or pick a Linear issue, review the plan, and then each agent gets its own worktree. Nobody fights over main.
  • Any AI CLI, right in the repo. It works with Claude Code, Cursor, Codex, Gemini, OpenCode and Antigravity.
  • A graph that doesn't flinch. It handles 100k commits with no lag.
  • AI does the grunt work. It drafts commit messages, reviews and atomic commits, and suggests conflict resolutions. Nothing auto-accepts and nothing auto-stages; you approve every change.
  • Diffs down to the word, plus Gitmoji-ready prefixes and saved quick commits you can reuse.
  • Keyboard-centric. There's a command palette for everything.
  • 15 themes. It can also follow your Omarchy system theme live.
  • Zero telemetry and zero accounts.

It's free. I'd love feedback from anyone running several agents at once: what breaks your flow today?

gitmoire.dev


r/git • • 8d ago

Accelerating development for massive Git repositories

Thumbnail developers.googleblog.com
0 Upvotes

r/git • • 8d ago

Codeberg.org is gone

112 Upvotes

Update: it is now back up, with whois codeberg.org reporting only Domain Status: clientTransferProhibited anymore.

FYI, Codeberg's domain is down, as per their socials: https://social.anoxinon.de/@Codeberg/117636454915265360

Almost nowhere is this being talked about (or Reddit search is just uncooperative), and r/codeberg is banned for breaking Reddit rule 2? That sub was barely even active, but anyways.

Edit: https://status.codeberg.eu/status/codeberg tracks the status on an alternative domain.


r/git • • 8d ago

I built GitCraft - a free, open-source GitKraken alternative with local AI support

Post image
0 Upvotes

r/git • • 9d ago

What's the best way to learn Git and GitHub effectively?

6 Upvotes

I'm looking to learn Git and GitHub from scratch. What's the best way to learn them effectively? Which resources would you recommend, and how should I practise to become comfortable using them in real projects? I'd appreciate advice from people who have learned them or use them regularly.


r/git • • 9d ago

Git patched six security vulnerabilities — recursive clone RCE, ref path traversal and merge/import memory issues

13 Upvotes

Based on the Git project’s technical breakdown published on November 10, 2026, and CERT-In’s CIVN-2026-0552 notice from November 16, here is the architectural impact.

The most interesting issue is CVE-2026-111760. Git’s index path handling had an integer-truncation problem: an extremely long path could pass validation under one name and be written using a shorter name. In a malicious repository, that can replace a submodule’s .git file with a symlink to attacker-controlled configuration or hooks. The vulnerable client can execute attacker-controlled code during recursive clone.

The other five issues affect different processing paths:

  • CVE-2026-113408: path traversal through a server-advertised protocol-v2 HEAD symref.
  • CVE-2026-105437: heap-buffer overflow during large merges.
  • CVE-2026-114467: stack memory corruption in GPG signature handling.
  • CVE-2026-114469: out-of-bounds read while processing binary patches.
  • CVE-2026-114466: unsafe file access through selected fast-import stream features.

The practical exposure is not restricted to developer workstations. Git is often embedded in CI images, IDEs, merge queues and import services. Updating the host OS package may leave a bundled Git binary untouched.

Git recommends 2.56.1 or the patched release for the relevant maintenance branch. Until patched, its temporary mitigations include avoiding recursive clones and merges of untrusted content, and not processing untrusted binary patches or fast-import streams.

Primary sources:

TechGines context: we previously covered the server-side Gitea diffpatch RCE. This new analysis is about Git clients and repository-processing pipelines:
https://www.techgines.com/post/gitea-cve-2026-60004-diffpatch-rce-exploited

For teams that accept external pull requests, how are you isolating recursive clone and merge operations today: disposable runners, restricted submodule URLs, network egress controls, or another design?


r/git • • 9d ago

dffy: a terminal diff viewer in Rust that stays fast on big repos

0 Upvotes

I spend my days reviewing diffs from coding agents in the terminal, sometimes from my phone over SSH, and none of the tools I liked quite fit. lumen leans on AI features I didn't want in a diff viewer, hunk runs on a JavaScript runtime, and both got slow on the monorepos I work in.

That's why I decided to build dffy: https://github.com/amalucelli/dffy a single Rust binary that combines what I liked from each of them and stays fast on big repos. It shows the first files as soon as they're found and loads the rest in the background. On the Linux repom the diff v6.0..v6.1 (~13k changed files) the first screen is up in miliseconds vs seconds from lumen and hunk.

A few other things it does:

- staged, unstaged and untracked changes in one view, conflicted files from a merge or rebase with their markers highlighted, and renames detected the way git does it

- works as git's pager, the git add -p filter and difftool, and compares plain files and folders outside a repo too

- every action is a single key, with a command panel on space, and the layout adapts down to a phone screen

- mouse selection that copies over SSH, and it plays well with multiplexers like herdr and rex

- 16 built-in themes with a live picker, and you can add your own themes that build on any of them

- extensible through renderer plugins in any language; ships with two experimental ones: Markdown diffed as rendered text, and Mermaid diagrams drawn in the terminal

- --json output and an MCP server, so scripts and agents can read a diff a page at a time

- settings in a plain config file for your dotfiles, remappable keys, and it remembers your layout between runs


r/git • • 9d ago

I built a cross-platform Git client called Tributary

0 Upvotes

I wanted to build a Git client that is free, open source and accessible to everyone, without compromising on features.

The result is Tributary, a Git client for Windows, macOS and Linux.

Some of its features include:

  • Visual commit graph and repository history
  • Git LFS and file locking
  • Visual diffs for images, 3D models, audio and video
  • GitHub and GitLab pull request management
  • Features aimed at game development and projects with large binary assets

It's free, open source and available under the MIT licence.

GitHub: https://github.com/shikoko/tributary

I'd love to hear what you think, particularly from people who regularly work with Git or have experience with other Git clients. What would you like to see in a tool like this?


r/git • • 9d ago

support Should I push these files on my repository?

0 Upvotes

Hi, I have a some kind of small project (website) and I'm using docker to test it so I have files like .env, docker-compose, dockerfile, nginx.conf etc. Additionally I have folder with assets and folder with bootstrap (bootstrap 6.0 and bootstrap icons).

And I just want to know should I push these files or how to push them. You see we have some options like git lfs.

I was thinking about 2 branches - one with bootstrap and one without but honestly this sounds strange even for me and I don't know what to do.

Look: People say you shouldn't push env file but in this project this file is important to run this project on docker. Now how about bootstrap? I'm not using cdn; I have downloaded distribution files https://getbootstrap.com/docs/6.0/getting-started/install/

So I have my own file structure, you know what I'm talking about.

So... What I should do rn? Push this all files and use lfs to whole bootstrap? Don't push and paste link to readme and show file structure? Create 2 branches?

I don't know guys... Help me, please.


r/git • • 10d ago

Anyone using ForkYard?

Thumbnail github.com
0 Upvotes

GitHub - abgebaumt/forkyard - looks like an alternative to Gitkraken

A fast, local Git client for the desktop – commit graph, line staging, conflict tool, interactive rebase. Tauri + Rust + React.

Is anyone using this? Any experiences with it?


r/git • • 10d ago

Why is .gitignore not being added

0 Upvotes

I want my .gitignore file to go with my repository, but it keeps disappearing for some reason. I am sure I added it explicitly at some point, but it's not only gone from the repository but also from the file structure. I am thoroughly confused

Edit, sorry, it didn't disappear, i just failed to see it. It's all as intended, I am just stupid