Re: git default behavior seems odd from a Unix command line point of view
From: Daniel Barkalow <hidden>
Date: 2016-06-15 22:46:45
On Tue, 12 May 2009, Andrew Schein wrote:
Hi Junio - Thanks for your reply giving historical context. The command line examples I gave were intended to give examples of the output rather than my own usage pattern. Here is my actual usage pattern... from a file called "sync.sh" (would love feedback on whether this is the gitly? way to solve my use case):
What *is* your use case? What you're doing seems nuts to me (like, you're going to send out files with this script that someone is in the middle of editting), but I don't know what you're trying to do.
# environment set up occurs before loop, I pull before "pushing" in an
attempt to prevent
# conflicts from being left on the shared repository.
for dir in ./* ; do
if [ ! -d $dir ] ; then continue ; fi #not a directory
if [ ! -e $dir/.git ] ; then continue ; fi #not a git repo
dir=`basename $dir`
echo "syncing: $dir"
set +e # commit returns an error if there is nothing to commit.
(cd ./$dir ; git commit -a)
set -e
(cd ./$dir ; git pull $UP "$REPO/$dir" master) #pull
ssh $HOST "mkdir -p $DEST_CACHE/$LOC/$dir" # these three lines
handle "push"
rsync -rl --delete ./$dir/.git -e ssh "$DEST:$DEST_CACHE/$LOC/$dir/.git"
ssh $DEST "(cd $LOC/$dir ; /tools/bin/git pull
$DEST_CACHE/$LOC/$dir/.git master)"
doneWhat are you trying to avoid by not using "git push"? Why are you committing whatever changes happen to be in working directories? Are you intending to be able to handle non-trivial merges? -Daniel *This .sig left intentionally blank*