Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Undo what you just did in git

NotificationsYou must be signed in to change notification settings

mapmeld/gitjk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Greenkeeper badge

If you just ran a git command that you didn't mean to, this program will either undo it,tell you how to undo it, or tell you it's impossible to undo. Based on a joke I posted a while ago.

Examples

Asking for undo-ing advice.

git initgitjkThis created a .git folder in the current directory. You can remove it.rm -rf .git

Asking to fix it automatically

git add file.jsgitjk -fThis added file.js to the changes staged for commit. All changes to file.js will be removed fromstaging for this commit, but remain saved in your file.Running... git reset file.jsCompleted

Coverage

Included:

add,archive,branch,cat-file,checkout,clone,commit,diff,fetch,grep,init,log,ls-tree,merge,mv,pull,push,remote,revert,rm,show,stash,status

Basicaliases are also supported (e.g.git cm forgit commit).

Not included:

bisect,fsck,gc,prune,rebase,reset,tag

Compound aliases are not supported (e.g.git ac forgit add -A && git commit).

Install

You need to run npm install and alias to fully install.The module is named gitjk but you need to set up an alias to pipe the most recent commands into the program.

OSX or BSD

npm install -g gitjkalias gitjk="history 10 | tail -r | gitjk_cmd"

Ubuntu / other Linux

npm install -g gitjkalias gitjk="history 10 | tac | gitjk_cmd"

Different Terminals

If you are usingfish, place this is in~/.config/fish.config (fromlunixbochs on Hacker News):

alias jk="history | head -n+10 | tail -r | gitjk_cmd"

If you are usingiTerm

alias gitjk="history | tail -r -n 10 | gitjk_cmd"

License

Available under GPLv3 license

About

Undo what you just did in git

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp