Skip to content

Create remote under sub ref and keep it in sync

Dmytro Grinenko edited this page Jan 9, 2018 · 1 revision

Relay repo is required to update specific part of git repo branches which originates from another git repository.

  1. Add new remote ambari-asf
  2. call git config -e and fix remote as on last line below
[core]
        repositoryformatversion = 0
        filemode = true
        bare = true
[http]
        receivepack = true
[remote "ambari-asf"]
        url = https://git-wip-us.apache.org/repos/asf/ambari.git
        fetch = +refs/heads/*:refs/heads/ambari-asf/*
  1. Create repo on GitHub, clone your repo to GitHub
  2. add new remote with name github
  3. call git config -e and fix remote as on last line below
[core]
        repositoryformatversion = 0
        filemode = true
        bare = true
[http]
        receivepack = true
[remote "ambari-asf"]
        url = https://gitbox.apache.org/repos/asf/ambari.git
        fetch = +refs/heads/*:refs/heads/ambari-asf/*
[remote "github"]
        url = https://github.com/hapylestat/ambari-custom.git
        fetch = +refs/heads/ambari-asf/*:refs/remotes/github/ambari-asf/*
  1. Add crone task to execute:
/usr/bin/git fetch ambari-asf
/usr/bin/git push github refs/heads/ambari-asf/*

Clone this wiki locally