+
Skip to content

trentrand/git-yank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git Yank

Setup

Clone this repo and run:

$ npm i && npm run build

Add the repo directory to your $PATH. Git will recognize this as a custom command. You can now use git yank 🎉

Usage

  • typical use-case
git add -p; // add unrelated changes line-by-line into their own commit
git commit -m "[] Fix an unrelated bug or typo";
git yank <commit-sha> --branch name-of-new-or-existing-branch --push

Options

Option Description Type Default Value
--branch, -b The name of the destination branch to create or use when moving
commits. If not specified, a unique branch name will be generated.
string
--start-point, -s The name of a commit or branch at which to start the new branch. string "master"
--push, -p Whether the destination branch should be automatically pushed. boolean false
--safe, -S Whether commits should be preserved on the source branch. boolean false
--debug Show debug output boolean false
-h, --help Show help boolean
-v, --version Show version number boolean

Examples

  1. git-yank <sha1> <sha2> <sha3>
    Moves the three specified commits to a new destination branch.

  2. git-yank <sha> --branch hotfix --push
    Moves the specified commit to the destination branch "hotfix" ,creating it if it doesn't exist, and push changes to remote repository.

  3. git-yank <sha> --branch feature/patch --start-point feature
    Moves the specified commit to the destination branch "feature/patch", creating
    it if it doesn't exist using the "feature" branch as the branch start point.

About

📤 Custom git command to move a commit or series of commits to a new branch

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载