git-hacks

git-hacks Commit Details

Date:2014-02-20 11:22:07 (5 years 9 months ago)
Author:Nicola Fontana
Branch:master
Commit:5f16e89dd8f9d624563c374e9f7ab8ae129165d5
Parents: b4a1e64cc8b6ce7eb0ef912376be54138e4c360e
Message:post-receive.automerge: autocommit HEAD before merging

Consider the remote working tree as a possible entry point of new data.
This is the second end of the two-way synchronization process.
Changes:
Mpost-receive.automerge (3 diffs)

File differences

post-receive.automerge
1818
1919
2020
21
21
2222
2323
2424
......
2828
2929
3030
31
3231
3332
3433
3534
35
36
37
38
39
3640
3741
3842
......
5559
5660
5761
58
62
# git add --all
# git commit --allow-empty -m Autocommit
# git push origin master:`hostname`
# git pull origin HEAD
# git pull --no-edit origin HEAD
# -----8<------
#
# Copyright (c) 2014 Nicola Fontana <ntd at entidi.it>
# post-receive.automerge maintainer.
message='Commit from post-receive.automerge'
unset GIT_DIR
cd ..
# Autocommit the local modifications, if any
git add --all
git commit -m 'Commit from post-receive.automerge'
# Get the name of the recently updated ref
read dummy dummy refname
[ -z "$refname" ] && exit 0
# Commit the new HEAD
git commit -m "$message"
git commit --no-edit

Archive Download the corresponding diff file

Branches