Skip to content

adding commits to earlier branches? #315

Answered by arxanas
alan-nf asked this question in Q&A
Discussion options

You must be logged in to vote

EDIT: for the time being, I've added a workflow documentation item titled "Adding a commit to an earlier branch" which points to this answer.

As a general resource, you might want to read this article, as it may answer some workflow questions: https://github.com/arxanas/git-branchless/wiki/Workflow:-Editing-an-old-commit's-contents. I've added a to-do to #115 for your specific use-case, and hopefully I'll get around to it someday 😅 .

For this case, here's what I would do:

1. git co feature-2
2. git commit -am 'more feature2 work'.

  • EDIT: @sebastianst points out that in recent versions of git-branchless, rather than run git commit, you can instead run git record -Im 'more feature2 work' to…

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
9 replies
@sebastianst
Comment options

@alan-nf
Comment options

@arxanas
Comment options

@pokey
Comment options

pokey Apr 6, 2023
Collaborator Sponsor

@arxanas
Comment options

Answer selected by alan-nf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants