Skip to content

n-update fails #10

@brbsix

Description

@brbsix

The last few times that I've run n-update, I've received errors similar to the following:

$ n-update
Check for updates to n (version 2.1.3, installed in '/home/user/.n/n')? (y/N) y
-- Checking for updates...
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 1), reused 3 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), done.
From https://github.com/tj/n
 + 55a021b...560670e master     -> origin/master  (forced update)
 * [new tag]         v2.1.4     -> v2.1.4
fatal: refusing to merge unrelated histories
n-update: ERROR: ABORTING due to unexpected error.

I would guess that this is caused by the --depth 1 flag (discussed in #6 and introduced in 9e9347d). Because there is no history, instead of just pulling in the changes, git thinks you are trying to merge two different entirely unrelated projects together. You can use --allow-unrelated-histories to ignore the warning, but then you end up with a bunch of merge conflicts. Assuming that's the problem, maybe replace git pull --depth 1 with something like git fetch --depth 1 && git reset --hard origin/master?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions