tj / tj/git-extras

A "git mv" that preserves history

Open
#335 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
18.1k
Forks
1.2k
Avg merge
5d 17h
Merged PRs (30d)
1

Description

This "issue" is more of a request for comments from anyone working on this repo that knows what they're talking about when it comes to git internals. In exchange for comments, I will happily turn this into a PR.

I "discovered" a way to move a directory that also preserves history, including dealing well with merges from code branched before the move: https://gist.github.com/dannyroberts/857b9f7e52acd6b83c89. I say "discovered" because I couldn't find instructions for this anywhere on the internet, but this is what is recommend for doing a "subtree merge" from another repository, and when I tested it, it also worked quite nicely for directories within the same repo.

I think it'd be really great to add to git extras—can any of you who know more than me think of why this might specifically be a bad idea?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked gist and the issue's discussion of Git subtree merges and directory moves. No repository file or test is named, so first determine where this behavior could belong in git-extras and whether the proposed approach is safe. Done means resolving the request for expert comments and, if accepted, turning it into a PR.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, shell
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.