8000 GitHub - Peaker/git-jump: A git-jump command that can safely replace reset --hard to jump to a new git hash
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Peaker/git-jump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-jump

Moving to a new position

When you decide that the current branch needs to use a different hash and content, currently you need to reset --hard to the new position.

However, reset --hard has the annoyin 5F78 g side-effect of deleting any outstanding work.

It would be nice to be able to jump the tip of the current branch to a new position and update the working tree, as long as there's no overlap between files changed in the working tree and in the diff to the remote location.

Just type:

git-jump <refspec>

To jump to the new location.

Updating a local tracking branch with no local commits

When you have a local branch that is tracking a remote branch (and has no local commits) that was rebased, you would have to reset --hard to the remote location. This requires typing out the name of the upstream branch (or "@{u}" at least), and as usual, loses any uncommitted changes.

Just type:

git-jump

With no parameters, and it will jump to the upstream location, taking any uncommitted changes on top.

About

A git-jump command that can safely replace reset --hard to jump to a new git hash

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0