Code Monkey home page Code Monkey logo

Comments (7)

sindresorhus avatar sindresorhus commented on May 17, 2024

What's the point? git pull --rebase only works on a clean working directory.

from np.

LinusU avatar LinusU commented on May 17, 2024

The point would be to error out with Local/Remote history differs. Please push/pull changes. instead of automatically rebasing. I personally feel that rebasing it not always what I want to do.

This would give the user a chance to see what the remote changes was before going thru and publishing it to npm.

A problem that I see currently is that this script will publish anything commited to the remote at the time I run this command. I think it would be better to tell me that there has been new commits at the remote, and let med deal with what I want to do with that.

Let me know if I'm not making sense :)

from np.

sindresorhus avatar sindresorhus commented on May 17, 2024

Oh yeah. That does make sense. Thanks for elaborating. PR welcome ;)

from np.

sindresorhus avatar sindresorhus commented on May 17, 2024

@LinusU Interested in doing a PR? 🍰

from np.

LinusU avatar LinusU commented on May 17, 2024

Yes, but I'm a bit behind on my pr queue :)

I'm going to take a stab at the queue now so hopefully, you'll see some pull request for me, if not for this repo...

from np.

kevva avatar kevva commented on May 17, 2024

Instead of grep '^# Your branch', maybe use:

# check if behind
$ git rev-list --right-only --count HEAD...@'{u}'

# check if ahead
$ git rev-list --left-only --count HEAD...@'{u}'

from np.

natecavanaugh avatar natecavanaugh commented on May 17, 2024

I would tend to agree with @kevva.
My git status doesn't start with #, and instead just starts with Your branch.
So going off of his suggestion, you could probably do:

# history differs
test "00" -ne `git fetch; git rev-list --count --left-right "@{upstream}"...HEAD | awk '{ print $1$2 }'`

from np.

Related Issues (20)

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.