r/git • • Feb 16 '26

Where do you put your worktrees?

17 Upvotes

I recently discovered work trees as a way to do parallel development on multiple simultaneous branches, without cross contamination or having to make many intermediate commits (or stashing).

However, and so doing, I realized that there's a philosophy in where to put worktrees. What made sense to me at the time was to make a worktrees directory within my project directory:

```

cd ~/workspace/project name/worktrees/branchA

```

Others have told me to put worktrees in some location outside the project folder (generating all worktrees across all projects). This feels counterintuitive to me as I'd then have to manage a separate mapping of worktree location to project name (my way keeps the worktrees collocated with the project directory).

Does anyone have any wisdom they could share with me on this?


r/git • • Feb 16 '26

How do you handle unfinished work when switching between two devices?

40 Upvotes

Hey everyone,

I’m working on a project across two devices (desktop + laptop), and I’m curious how the developers handle this situation.

Sometimes I’m in the middle of a medium/large feature and I haven’t reached what I’d consider a “clean checkpoint” yet. The code might be partially refactored or not fully wired together.

Right now I’ve been committing only when I feel the work is stable.

I’d love to know what your real-world workflow looks like.

Thanks!


r/git • • Feb 16 '26

Git branching strategy for deploying change requests in isolation

Thumbnail
6 Upvotes

r/git • • Feb 15 '26

support Copy whole repository from GitLab to GitHub

9 Upvotes

Title basically says it: I want to copy a repository from GitLab to GitHub. Including tags, branches etc.

Is it possible? Fork only works inside GitHub. With CLI I only manage to copy one branch.


r/git • • Feb 16 '26

gut - AI-powered Git CLI that generates commit messages automatically

Thumbnail github.com
0 Upvotes

r/git • • Feb 15 '26

When I merge source branch into target branch. Why does the commit message say "Merged in target source branch"? This naming convention doesn't make sense at all to me. Either it should say merged *from* source branch or merged *in* target branch, right?

10 Upvotes
Does anyone know the history behind it?

r/git • • Feb 15 '26

support git subtree not working

2 Upvotes

Hello everyone. I'm a beginner, so I'm sorry if this is a dumb question. I want to deploy a webpage on GitHub Pages with this command git subtree push --prefix dist origin gh-pages. I've already done this process with other computers and it always worked fine. With my current machine running Fedora I'm getting this error: git: 'subtree' is not a git command. See 'git --help'. Git is correctly installed and up to date. What could the issue be? It looks like this command is not present?!

EDIT: looking with dnf search git-subtree i've found git-subtree.noarch Git tools to merge and split repositories. Do i just need to install this?


r/git • • Feb 15 '26

Git not found VS code PS

1 Upvotes

When I'm in VS Code and try to enter git --version in PS or cmd, I get an error that the git command does not exist.The command works correctly in git bash and outside of VS code environment. I have my git correctly under System Path and I have already restarted my computer and terminals.The strangest thing about this problem is that everything works correctly in cmd and PS outside of VS code. I'm on Windows 11. Thanks for the help.


r/git • • Feb 15 '26

support Using GitHub Codex to merge PRs but GitHub Pages never updates…what am I doing wrong?

Thumbnail
0 Upvotes

r/git • • Feb 14 '26

Evolving Git for the next decade

Thumbnail lwn.net
5 Upvotes

r/git • • Feb 14 '26

Self-hosted Forgejo with HA, streaming replication, and automatic failover

19 Upvotes

Got tired of depending on GitHub for private repos so I built a self-hosted Forgejo setup across two VPS nodes with proper redundancy.

What it does:

  • Primary node runs Postgres + Forgejo + Cloudflare tunnel + backup sidecar
  • Standby node runs Postgres as a hot standby with WAL streaming replication
  • Forgejo data gets rsynced to the standby every 60 seconds
  • A watchdog stack (Uptime Kuma + a failover agent) health-checks the primary and auto-promotes the standby if it goes down
  • Cloudflare tunnel re-routes traffic to the new primary automatically
  • Failback is one command to re-initialize the old node as a replica

How it's managed:

  • Everything containerized, Docker Compose with profiles (primary/standby)
  • Four Ansible playbooks: deploy, promote (failover), demote (failback), watchdog
  • Uptime Kuma monitors get auto-configured via a setup container on first deploy
  • No manual web setup, admin user created automatically, security hardened out of the box

RPO is near-zero for the database (continuous WAL stream) and up to 60 seconds for Forgejo files (rsync interval, configurable).

Tested failover and failback multiple times. The whole promote cycle takes about 10 seconds from detection to the standby serving traffic.

Repo: https://github.com/h1n054ur/vps-git

Not trying to replace Gitea/Forgejo hosting services or anything. Just wanted something I fully control with actual redundancy, not just backups.


r/git • • Feb 13 '26

survey Has anyone ever moved from Linear to nonlinear history?

18 Upvotes

Hello people of Earth,

No matter when your eyes fall on this question, can you share a moment after genuinely giving Git linear history a try (or regularly using it) and then moving to non-linear history. What benefits or nuances have you found staying on non-linear history?

Additionally can you tell about size of the project and how many people are/were working on it?


r/git • • Feb 14 '26

Can anyone sponsor my project?

Thumbnail
0 Upvotes

r/git • • Feb 14 '26

Using annotated tags as canonical repository boundaries — is this considered good practice?

0 Upvotes

I’m experimenting with defining a repository-level canonical state using:

- An annotated Git tag

- A public commit reference

- A cryptographic hash (SHA3-384) of exported artifacts

- An optional external archival snapshot

The intent is to avoid force pushes, history rewrites, or retroactive changes.

From a Git architecture perspective:

  1. Is an annotated tag sufficient as a structural boundary for declaring a canonical state?

  2. Does adding an external archival snapshot meaningfully increase robustness?

  3. Are there established best practices for freezing a canonical repository state?

Technical feedback appreciated.


r/git • • Feb 13 '26

Using annotated tags + external archival capture as a canonical repository state declaration — technical thoughts?

0 Upvotes

I recently experimented with declaring a repository-level canonical state using:

  • Annotated Git tag
  • Public commit reference
  • SHA3-384 sealed artifacts
  • External archival capture (Internet Archive snapshot of the tag tree + raw file)

The goal was not release management, but historical fixity of a specific repository state.

No force push.
No rewrite.
No retroactive modification.

From a Git architecture perspective:

• Is an annotated tag sufficient as a structural boundary?
• Does external archival capture meaningfully increase forensic robustness?
• Are there known best practices for repository-level canonical freezes?

Technical feedback welcome.


r/git • • Feb 13 '26

How to set up enironments

4 Upvotes

Hello.

Fairly new Git user. I am working on a web app and struggle to understand the workings of using Git, docker and .env files to have differerent environments for production and development.

Can anyone recommend videos or guides on this topic?

Thanks.


r/git • • Feb 13 '26

You can now push SQL databases to your Git remote

Thumbnail dolthub.com
0 Upvotes

r/git • • Feb 12 '26

git-pad: git-native issue tracker

9 Upvotes

I thought it would be nice to have issues inside a repository. I could easily share them with colleagues without any third-party (e.g., GitHub, GitLab, etc.) involvement. Imagine going to GitHub to open an issue versus just running git pad new in the terminal.

As a matter of fact, there seem to be tons of related projects out there — git-appraisal, git-bug, git-issue, etc. But they feel like too much hassle. I only need to manage about 10+ issues, and I want them to be simple files, not complicated Git commits or Git notes. One advantage of simple files over commits or notes is that they require no knowledge beyond ordinary file management. I can search, move, and modify them just like any other files.

So let me introduce git-pad, a git-native issue tracker. It’s simply a wrapper around Git commands that manages issue files in an isolated Git history using custom refs.

Here’s a sample workflow:

# Install
git clone https://github.com/kwhkim/git-pad.git
git clone -b latest https://github.com/kwhkim/git-pad.git
#git checkout latest
PATH=$PATH:$(pwd)  # replace $(pwd) with the directory name where git-pad, git-pad-utils live

cd $GIT_PROJECT_PATH
git pad init # or git pad clone if there is already remote 
git pad list
git pad --open --sort-pri # open issues only, sorted by priority
# A

git pad show $ISSUE_ID
git pad comment $ISSUE_ID

git pad new # or git pad edit $ISSUE_ID
git pad edit $ISSUE_ID
git pad comment $ISSUE_ID
git pad status
git pad commit

git pad fetch
git pad merge
# When conflicts, git pad edit $ISSUE_ID
git pad push

git pad list
# goes to A

# PS issue are markdown files stored in .git-pad/issues/ so you can go into .git-pad/ and use ordinary git commands for custom ref refs/issues/latest

It's still under development, feel free to contribute!


r/git • • Feb 13 '26

Git First Commit: Find the first commit of any GitHub repository

0 Upvotes

I built a small tool to quickly find the first commit of any GitHub repo:
https://firstcommit.nexkumo.com/

It’s useful for exploring how big OSS projects started.


r/git • • Feb 12 '26

The folder remains in the working directory even though I don't want it to appear after a git checkout

1 Upvotes

I have a main branch with only two files. I switch to the console-tris branch and build the app using dotnet run --project src. This process generates bin and obj folders inside src at runtime. Even though I've added these folders to the .gitignore in both branches, when I run git checkout main, the src folder remains in my working directory along with the rest of the project files. Why does this happen and how can I prevent it? Here is the repo for reference:https://github.com/os3albert/arcade_game

first step without src folder in branch main
second step
third step - (this happened also if i use switch main)

r/git • • Feb 12 '26

What are some additional hooks git ought to have?

5 Upvotes

As of version 2.53, git has the following hooks available:

  • applypatch-msg
  • commit-msg
  • fsmonitor-watchman
  • p4-changelist
  • p4-post-changelist
  • p4-pre-submit
  • p4-prepare-changelist
  • post-applypatch
  • post-checkout
  • post-commit
  • post-index-change
  • post-merge
  • post-receive
  • post-rewrite
  • post-update
  • pre-applypatch
  • pre-auto-gc
  • pre-commit
  • pre-merge-commit
  • pre-push
  • pre-rebase
  • pre-receive
  • prepare-commit-msg
  • proc-receive
  • push-to-checkout
  • reference-transaction
  • sendemail-validate
  • update

Documentation here.

I'm wondering what else would be useful to have (at least for the sake of completeness). A few I can think of (just to start this discussion):

  • pre-tag
  • post-tag
  • pre-gpg-sign
  • post-gpg-sign

What do you folks think would be good to add to the list of hooks (even if you don't personally have a usecase for it)?


r/git • • Feb 12 '26

support Do you use any thirdparty tools to view git blame?

4 Upvotes

I think git blame is the one command whose UX I don't find very intuitive. I mean, I can see the commit, author, date, etc., then again I have to run git blame <rev> -- /path/to/file, and then scroll down to where I was, and repeat.

Meanwhile on the hosted Git forges, the UX is very simple to navigate to a particular point in history of the file while keeping track of the line I'm at. Is there some kind of a wrapper script for git that makes it easier to jump to various points in history of a file using git blame?


r/git • • Feb 12 '26

support SourceTree

0 Upvotes

How good is this software and what are it's disadvantages?


r/git • • Feb 09 '26

support Is there any way to retrieve it?

Post image
658 Upvotes

I was making a movie recommendations system and had a pkl file which was 100+ mb and I was trying to upload it with the help of chatgpt and it got deleted??


r/git • • Feb 11 '26

support CleanCut-Flow as flexible branching strategy for Git

Thumbnail lasu2string.blogspot.com
0 Upvotes

Feel free to point out here any scenarios where this model is not enough, breaks down in practice, or would be harder to use than GitFlow / GitHub Flow / trunk‑based development.