Giter VIP home page Giter VIP logo

gitjk's Introduction

gitjk

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 init
gitjk

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

Asking to fix it automatically

git add file.js
gitjk -f

This added file.js to the changes staged for commit. All changes to file.js will be removed from
staging for this commit, but remain saved in your file.
Running... git reset file.js
Completed

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

Basic aliases are also supported (e.g. git cm for git commit).

Not included:

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

Compound aliases are not supported (e.g. git ac for git 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 gitjk
alias gitjk="history 10 | tail -r | gitjk_cmd"

Ubuntu / other Linux

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

Different Terminals

If you are using fish, place this is in ~/.config/fish.config (from lunixbochs on Hacker News):

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

If you are using iTerm

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

License

Available under GPLv3 license

gitjk's People

Contributors

dnicolson avatar greenkeeper[bot] avatar lucthev avatar mapmeld avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gitjk's Issues

Getting some errors

This is what I get on my bash now:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

tail: invalid option -- 'r'

tail 8.13 does not support "-r" option.

~> alias gitjk="history 10 | tail -r | gitjk_cmd"
~> gitjk
tail: invalid option -- 'r'
Try `tail --help' for more information.

doesn't work with git aliases

muszek@dziobak:/tmp$ git ci -m 'test'
[master (root-commit) bf8c011] test
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a
 create mode 100644 b
muszek@dziobak:/tmp$ gitjk 
I didn't recognize that command

Invalid tail option -r

gberger:~$ gitjk
tail: invalid option -- 'r'
Try 'tail --help' for more information.
I didn't find a git command

Ubuntu 14.04

gitjk gives invalid advice for undoing `git checkout <tree-ish> <paths>…`

I was wondering if there was any way to undo this command I ran:

git checkout HEAD src/someFile.js src/anotherFile.js

I piped it into gitjk_cmd, but this was the output:

git checkout moved you into a different branch of the repo. You can checkout any branch by name, or checkout the last one using -
git checkout -

This explanation is incorrect. With these arguments, git checkout overwrote the two files in my working directory I specified with their versions at the given commit, in this case HEAD. The command didn’t make me switch branches.

With this input, gitjk should tell me how to undo my checkout of those files if possible, or at least recognize the situation and tell me “there is no way to recover the overwritten files”.

Rename the project to 'git undo'

It's just a suggestion.

  1. It's self explanatory. 'gitjk' is not (not sure if I get it right, but it's taken from "I was joking, undo it", right?).
  2. Lots of people search for "git undo". I compared it in Google Trends with a search phrase I know gets over 10k searches per day and "git undo" has approx 8% of that (and rises quickly - http://www.google.com/trends/explore#q=git%20undo ). 1000 users per day sounds nice, doesn't it?

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.