Skip to content

Instantly share code, notes, and snippets.

@zamuro
Last active September 27, 2017 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zamuro/63a562f3cc49fc0b7980395fe6a13b2e to your computer and use it in GitHub Desktop.
Save zamuro/63a562f3cc49fc0b7980395fe6a13b2e to your computer and use it in GitHub Desktop.
Configuration for automated pull for consul
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@github.com:[user or organization of your fork]/consul.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "consul"]
url = https://github.com/consul/consul.git
fetch = +refs/heads/*:refs/remotes/consul/*
# m h dom mon dow command
15 9 * * 1-5 sh ~/.update_consul
#/bin/sh
consul_path="Here comes your consul path"
cd $consul_path
get_current_branch(){
current_branch='git rev-parse --abbrev-ref HEAD'
echo_current_branch=$current_branch
stored_branch=`echo $current_branch`
$stored_branch
}
this_branch=`get_current_branch`
old_branch=`echo $this_branch`
git checkout master
git pull
git pull consul master
git push origin master
git checkout $old_branch
@zamuro
Copy link
Author

zamuro commented Sep 13, 2017

update_consul is the bash file that synchronizes both consul/consul and your local fork. It is strongly recommended that you automate this via consul_cron either adding it to cron.daily or via crontab -e

.gitconfig actually .git/config in your local area path. Only needed change is url parameter in section origin. Everything else is there for context purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment