Re: I want "fast forward my workdir to upstream if it's safe"

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

 



El 7/5/2009, a las 23:40, Randal L. Schwartz escribió:

For the past few years, within any given 12 hour period, at least
one person on #git would come up with the use case with which I'm
really familiar (having needed it many times myself):

 I have a workdir tracking a remote.
 I may or may not have made local edits... I can't remember.
 I may or may not have made local commits... I can't remember.
 But the upstream might now have changed... please update me *safely*.

Seriously, this comes up, a lot.  Typically, from a cron job updater,
but often just "what can I do to make sure I'm up to date".

So, what I need is a command, likely an option to "git merge" that says "do everything that a git merge would do except abort if it would have been a merge commit". In other words, abort if the workdir is dirty or is not a
fast-forward update to the upstream.  Bonus if it exits non-zero if
something went wrong.

Please don't tell me "use these three commands in this script".
I want a *command* I can tell people in #git.

"git status"?

# On branch master
# Your branch is ahead of 'origin/master' by 46 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:   foo
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       bar

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]