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

StGIT discards local commits on "stg pull"

From
PRPavel Roskin <proski@gnu.org>
Date
Feb 12, 2007, 07:26 UTC
Message-ID
<20070212022625.rvyyo0kc0wowgogc@webmail.spamcop.net>
Hello!

I have been bitten by a strange bug/feature of StGIT, and it looks like it's not only counterintuitive, but also inconsistent with git.

I have a repository available over ssh and I push to it from several places. Sometimes I make a commit and forget to push it. Then I run "stg pull" to make sure my repository is up to date.

The result is that the repository is rebased back to the last remote commit. It's very easy to miss. There is no warning. Everything looks just like an update from the remote.

The example below shows that git-pull keeps my commit, but "stg pull" discards it by rebasing back to the remote ID.

My .gitconfig doesn't override "stg pull" behavior; it merely sets my name and mail aliases.

[proski@dl stgit-test]$ stg id
ebc429e7b7e596a12e8255fadc397123893cec73
[proski@dl stgit-test]$ echo "test change" >README
[proski@dl stgit-test]$ git-commit -m "test commit" README
Created commit 468861a2a1530f3bf98108e69632b3059e4ca0ce
 1 files changed, 1 insertions(+), 14 deletions(-)
[proski@dl stgit-test]$ git-pull
Fetching refs/heads/master from http://homepage.ntlworld.com/cmarinas/stgit.git
using http
Fetching refs/heads/stable from http://homepage.ntlworld.com/cmarinas/stgit.git
using http
Already up-to-date.
[proski@dl stgit-test]$ stg id
468861a2a1530f3bf98108e69632b3059e4ca0ce
[proski@dl stgit-test]$ stg pull
Checking for changes in the working directory... done
Pulling from "origin"...
Fetching refs/heads/master from http://homepage.ntlworld.com/cmarinas/stgit.git
using http
Fetching refs/heads/stable from http://homepage.ntlworld.com/cmarinas/stgit.git
using http
rebasing to "ebc429e7b7e596a12e8255fadc397123893cec73"...
done
No patches applied
[proski@dl stgit-test]$ stg id
ebc429e7b7e596a12e8255fadc397123893cec73
[proski@dl stgit-test]$

-- Regards, Pavel Roskin

Next: Catalin Marinas
Message 1 of 12 in “StGIT discards local commits on "stg pull"”
  1. Pavel RoskinFeb 12, 2007
  2. Catalin MarinasFeb 12, 2007
  3. Yann DirsonFeb 12, 2007
  4. Yann DirsonFeb 12, 2007
  5. Catalin MarinasFeb 19, 2007
  6. Pavel RoskinFeb 19, 2007
  7. Yann DirsonFeb 20, 2007
  8. Yann DirsonFeb 20, 2007
  9. Yann DirsonFeb 19, 2007
  10. Pavel RoskinFeb 13, 2007
  11. Catalin MarinasFeb 13, 2007
  12. Yann DirsonFeb 19, 2007

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.