Re: git and rebasing



At 10.04.2009 15:05, Owen Taylor wrote:
[...]
Since git pull --rebase fixes any previous git pull without the
--rebase, if we can catch problem commits (by looking for bad commit
messages, perhaps), then maybe it's better to just say:

 Merge commit with repository detected. This means you had local changes
 and typed 'git pull' instead of 'git pull --rebase'. You can type 'git
 pull --rebase' now to fix the problem. Then please try 'git push'
 again.

Unfortunately 'git pull --rebase' does not fix "any previous git pull
without the --rebase" (or maybe I'm just scheduled for SCM darwinism;))

[hb HB-T1XP glib (master)]$ git pull --rebase
.gitignore: needs update
build/win32/make.msc: needs update
gio/makefile.msc: needs update
glib/makefile.msc.in: needs update
glib/pcre/makefile.msc: needs update
tests/makefile.msc.in: needs update
refusing to pull with rebase: your working tree is not up-to-date

Even following the hint from
http://wiki.openembedded.net/index.php/GitPhraseBook
does not help:

[hb HB-T1XP glib (master)]$ git stash
warning: LF will be replaced by CRLF in glib/makefile.msc.in
warning: LF will be replaced by CRLF in glib/pcre/makefile.msc
Saved working directory and index state "WIP on master: a859720 Merge
branch 'master' of ssh://hans git gnome org/git/glib"
HEAD is now at a859720 Merge branch 'master' of
ssh://hans git gnome org/git/glib
(To restore them type "git stash apply")

[hb HB-T1XP glib (master)]$ git pull --rebase
tests/makefile.msc.in: needs update
refusing to pull with rebase: your working tree is not up-to-date

[hb HB-T1XP glib (master)]$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 3 commits.
#
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   .gitignore
#       modified:   build/win32/make.msc
#       modified:   gio/makefile.msc
#       modified:   glib/makefile.msc.in
#       modified:   glib/pcre/makefile.msc
#       modified:   tests/makefile.msc.in
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       gio/gio.def
[...]
#       tests/makefile.msc
no changes added to commit (use "git add" and/or "git commit -a")

I don't get it, wasn't 'git stash' supposed to move it away?

(And maybe a link to a wiki page that explains things and detail tells
how to configure a 'git up' shortcut to save typing. I think this would
be better as a short specific page under
http://live.gnome.org/Git/Help/ )

Yes, please. Maybe with a dedicated chapter to explain the use of git to people just interested in the central repository features? (Apparently my head is too small or too old to wrap around all those things "the cool kids do anyway" [1]

[...]
git reset master^ is going to leave uncommitted changes. It's normally
used for undoing a commit prior to redoing it.
Tried this one as well. Now I think there maybe a problem with 'something'
modifying files automatically on win32, there are a lot of files marked as
needs update that I did not touch:

[hb HB-T1XP glib (master)]$ git reset HEAD^
po/am.po: locally modified
[...]
po/zh_TW.po: locally modified
tests/makefile.msc.in: locally modified


[hb HB-T1XP glib (master)]$ git pull --rebase
po/am.po: needs update
[...]
po/zh_TW.po: needs update
tests/makefile.msc.in: needs update
refusing to pull with rebase: your working tree is not up-to-date

[...]
The simple recipe for "oops, I've screwed up", just make my local copy
of the current branch exactly the same as the upstream 'master' branch
is:

 git reset --hard origin/master

(assumes that the branch you've screwed up is the master branch)

Yeah, but that one apparently throws away the changes already commited
locally. Done it anyway as last resort, but it does not really increase my
trust in git being the right choice (for me).

Thanks,
	Hans

[1] http://live.gnome.org/GitForGnomeDevelopers

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]