Friday, November 8, 2019

svn export in git

To obtain a "clean" source at some revision, do:

git archive | tar -x -C

Source: https://stackoverflow.com/questions/160608/do-a-git-export-like-svn-export

Setting Up "Local" Git Server

Inspired by https://dev.to/erhankilic/setting-up-your-own-git-server--26h6

sudo mkdir /git/example.git
cd /git/example.git 
sudo git init --bare
cd /home/
sudo git clone /git/example.git # (bcoz the repo has root permission in this example)

To use:
git add ... whatever
git commit -a
sudo git push # (bcoz the repo has root permission in this example)