forked from dotwaffle/rancid-git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.git
47 lines (29 loc) · 1.48 KB
/
README.git
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
This file contains additional information regarding the use of Git with RANCID
along with some suggested use cases.
git v git-remote for RCSSYS
---------------------------
git commits all changes to a local repository in $BASEDIR/.git
git-remote will push the master branch to all remotes. You can have as many
remotes as you like. Rancid will loop through and push to them all. There are
a few things that need to be setup in order for this to work seamlessly.
Perform these steps before running bin/rancid-run:
1) Add remotes to $BASEDIR
git remote add [name] [url]
Example: git remote add origin git@gitlab.acme.com:user/rancit.git
2) Generate SSH keys for the rancid user and place the public key on the
remote for silent pushing via ssh.
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub | \
ssh git@gitlab.acme.com "cat - >> ~/.ssh/authorized_keys"
Or simply copy and paste the contents of ~/.ssh/id_rsa.pub to the
authorized_keys file or the web interface on the remote (if you are
using GitLab or the like).
3) Perform inital push to each remote
git push -u [remote name] master
There is no harm in setting $RCSSYS to git-remote if there are no remotes
defined. Rancid will behave as if there are no remotes and only commit to
the local repo in $BASEDIR/.git.
git-remote Use Cases
--------------------
---- Distributed Collectors ----
---- Distributed "Central" Repositories ----