From: Josef Wolf <jw@raven.inka.de>
To: git@vger.kernel.org
Subject: Re: Need help migrating workflow from svn to git.
Date: Fri, 15 Dec 2017 11:27:59 +0100 [thread overview]
Message-ID: <20171215102759.GB18542@raven.inka.de> (raw)
In-Reply-To: <005801d3751f$859f6c50$90de44f0$@nexbridge.com>
Thanks for your answer, Randall,
On Thu, Dec 14, 2017 at 04:07:15PM -0500, Randall S. Becker wrote:
>
> You might want to consider a slight modification to your approach as
> follows.
> Instead of using git pull, use git fetch.
> Have each system on its own branch (sys1 = my-sys1-branch, for example) so
> you can track who has what.
> In your scripts, consider:
> git fetch
> if nothing changed, done
> git status
> if no changes, git merge --ff master && git push origin my-sys1-branch &&
> done
> if changes, send an email whining about the changes
> your script could then (depending on your environment) git commit -a && git
> merge && git push origin my-sys1-branch && done
The scripts never commit. In fact, they only have read access to the remote
repository. Commits are only ever done by humans manually.
So it's going to be something like this:
git fetch origin
if [ git diff -s master origin/master ]
git stash
git merge -ff master
git stash pop
fi
Unfortunately, the return code of git-diff don't seem to indicate whether they
have diverged. And git-status don't seem to have an option to specify "remote
is ahead of me". How would I properly check whether a merge is actually needed?
--
Josef Wolf
jw@raven.inka.de
next prev parent reply other threads:[~2017-12-15 10:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-14 13:09 Need help migrating workflow from svn to git Josef Wolf
2017-12-14 21:07 ` Randall S. Becker
2017-12-15 10:27 ` Josef Wolf [this message]
2017-12-14 22:27 ` Igor Djordjevic
2017-12-15 1:17 ` Igor Djordjevic
2017-12-15 13:06 ` Josef Wolf
2017-12-15 12:47 ` Josef Wolf
2017-12-15 18:24 ` Igor Djordjevic
2017-12-15 16:33 ` Junio C Hamano
2017-12-15 18:58 ` Igor Djordjevic
2017-12-15 19:09 ` Junio C Hamano
2017-12-15 19:20 ` Igor Djordjevic
2017-12-20 11:52 ` Josef Wolf
2017-12-20 11:43 ` Josef Wolf
2017-12-20 12:19 ` Josef Wolf
2017-12-21 22:04 ` Igor Djordjevic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171215102759.GB18542@raven.inka.de \
--to=jw@raven.inka.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).