Create local server
svnadmin --version
sudo svnadmin create /srv/svn/edifast
sudo chmod -R g+rws /srv/svn/
cd /srv/svn/
sudo find -type d -exec chmod g+s {} +
Make then use the same UUID. First look info at remote server
svn info https://svn.edifast.com.br/svn/edifast
Path: edifast
URL: https://svn.edifast.com.br/svn/edifast
Relative URL: ^/
Repository Root: https://svn.edifast.com.br/svn/edifast
Repository UUID: f7446eaa-ab0d-4029-b9f1-d1d914f79d88
Revision: 5035
Node Kind: directory
Last Changed Author: aarvati
Last Changed Rev: 5035
Last Changed Date: 2020-05-15 14:21:32 -0300 (Fri, 15 May 2020)
Set the same UUID locally
svnadmin setuuid /srv/svn/edifast f7446eaa-ab0d-4029-b9f1-d1d914f79d88
Disallow changes locally
sudo cp /srv/svn/edifast/hooks/pre-revprop-change.tmpl /srv/svn/edifast/hooks/pre-revprop-change
sudo chmod +x /srv/svn/edifast/hooks/pre-revprop-change
sudo nano /srv/svn/edifast/hooks/pre-revprop-change
#!/bin/sh
USER="$3"
if [ "$USER" = "manager" ]; then exit 0; fi
echo "Only the manager user may change revision properties" >&2
exit 1
sudo cp /srv/svn/edifast/hooks/start-commit.tmpl /srv/svn/edifast/hooks/start-commit
sudo chmod +x /srv/svn/edifast/hooks/start-commit
sudo nano /srv/svn/edifast/hooks/start-commit
#!/bin/sh
USER="$2"
if [ "$USER" = "manager" ]; then exit 0; fi
echo "Only the manager user may commit new revisions" >&2
exit 1
Create loccally user manager as the only one able to make changes...
And initialize syncronization
svnsync initialize file:///srv/svn/edifast https://svn.edifast.com.br/svn/edifast --sync-username manager --sync-password password --source-username manager --source-password password
Start syncronization
sudo svnsync --non-interactive synchronize file:///srv/svn/edifast --username manager --password password
After syncronization copy revision number from svn info https://svn.edifast.com.br/svn/edifast
sudo svnsync copy-revprops file:///srv/svn/edifast 5035 --username manager --password password
Now check info at destination:
sudo svnsync info file:///srv/svn/edifast --username manager --password password
Source URL: https://svn.edifast.com.br/svn/edifast
Source Repository UUID: f7446eaa-ab0d-4029-b9f1-d1d914f79d88
Last Merged Revision: 5035
To start using local copy first delete props
sudo svn propdel --revprop -r 0 svn:sync-lock file:///srv/svn/edifast
sudo svn propdel --revprop -r 0 svn:sync-from-uuid file:///srv/svn/edifast
sudo svn propdel --revprop -r 0 svn:sync-last-merged-rev file:///srv/svn/edifast
sudo svn propdel --revprop -r 0 svn:sync-from-url file:///srv/svn/edifast
sudo rm /srv/svn/edifast/hooks/pre-revprop-change
sudo rm /srv/svn/edifast/hooks/start-commit
Get info
svn info file:///srv/svn/edifast
Path: edifast
URL: file:///srv/svn/edifast
Relative URL: ^/
Repository Root: file:///srv/svn/edifast
Repository UUID: f7446eaa-ab0d-4029-b9f1-d1d914f79d88
Revision: 5035
Node Kind: directory
Last Changed Author: aarvati
Last Changed Rev: 5035
Last Changed Date: 2020-05-15 14:21:32 -0300 (Fri, 15 May 2020)
To undo and make sync again (attention before this if you made changes locally):
svn propset svn:sync-from-url --revprop -r 0 https://svn.edifast.com.br/svn/edifast file:///srv/svn/edifast
Ignore .git folders for mixed cvs use
export SVN_EDITOR=nano
svn propedit svn:ignore .
.git
.gitignore
.gitattributes
Server side ignores if version > 1.8
svn propset svn:global-ignores --revprop -r 0 ".git .gitignore .gitattributes" file:///srv/svn/edifast
Relocate to local server
cd ~/Edifast/
svn relocate svn://vcs.casa/edifast/ .
Get updates from server
svn update .
Add files and Commit locally
cd ~/Edifast/
svn add * --force
export SVN_EDITOR=nano
svn commit
Mixed commit with git
git pull upstream master -v
git add . && git commit -a -S -m 'ALL'
git push upstream master -v
git push origin master -v
cd /srv/git/edifast.git/ && git fetch -v