emacs-devel
[Top][All Lists]
Advanced

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

Re: Stupid git!


From: Eli Zaretskii
Subject: Re: Stupid git!
Date: Sun, 13 Sep 2015 09:42:55 +0300

> Date: Sat, 12 Sep 2015 20:36:58 +0000
> Cc: address@hidden, address@hidden
> From: Alan Mackenzie <address@hidden>
> 
> > So instead of rebasing we recommend just "git pull", which will merge
> > the upstream changes with yours.
> 
> I just did `git pull'.  This didn't merge the upstream changes into
> my repository.  Instead it put the upstream file change into my working
> directory, discarding the other contributer's change log.  If I
> understand correctly, that is.

You must be misunderstanding, then, because "git pull" never does that
kind of atrocities.

> I think the best thing for me to do now is `git checkout <file>' to
> revert that changed file, then `git pull --rebase' to get the change
> again (and likely, quite a few others which have been done since), then
> `git push' to get my change into savannah.

Not sure this is the best way.  But if you want to start from a clean
slate, then this is the sequence of commands:

  git checkout <file>
  git status

If the last command says that only that your branch is ahead of
origin/master, then continue:

  git pull

If this causes merge conflicts, resolve them by editing and issuing
"git add" for each file whose conflicts you resolved (Emacs should do
this automatically when you save the file).  Finally:

  git commit
  git pull
  git push

The final "git pull" is for the slim chance that someone pushed to
savannah while you were resolving the conflicts.  If that pull
produces conflicts (highly unlikely), repeat the whole process, and
only then push.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]