git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Supporting untracked files with `git pull --autostash`

From
mqudsi@neosmart.net <mqudsi@neosmart.net>
Date
Apr 14, 2019, 18:20 UTC
Message-ID
<0101016a1d14099f-4ac42e38-256a-42a2-94d3-430417d74a25-000000@us-west-2.amazonses.com>
Hello,

Just a quick request for an enhancement to the behavior of the following command:

    git pull --autostash --rebase

When executed with local, untracked files that would conflict with newly-added files upstream, e.g.

An untracked local file `master:/foo` would be overwritten by a recently tracked file `origin/master:/foo`.

Currently, the following occurs:
```
mqudsi@devpc > git pull --autostash --rebase
First, rewinding head to replay your work on top of it...
error: The following untracked working tree files would be overwritten by
checkout:
        tests/eval.err
		tests/eval.in
		tests/eval.out
```
where

``` mqudsi@devpc > git status --porcelain=v2 | grep eval ? tests/eval.err ? tests/eval.in ? tests/eval.out ```

As currently `--autostash` only applies to files that are tracked by git, and files not in the index are ignored.

(Additionally, with this change it makes sense to enable `--autostash` to be used with a plain `git pull` without necessary also including `--rebase`, but I can live without it!)

Thank you,

Mahmoud Al-Qudsi NeoSmart Technologies

Message 1 of 1 in “Supporting untracked files with `git pull --autostash`”
  1. mqudsi@neosmart.netApr 14, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.