GIT

less than 1 minute read

GIT WALKTHROUGH (ubuntu 18.04)

cf : tuto Digital Ocean / GIT

INSTALL GIT

sudo apt-get update
sudo apt-get install git
git --version
  • FROM /var/wwww

for each :

cd /var/www/solidata-api.com
cd /var/www/preprod.solidata-api.com

… < do >

git init . 

git remote add origin https://github.com/entrepreneur-interet-general/solidata_backend.git

if need for reset remote’s url :

git remote set-url origin https://github.com/entrepreneur-interet-general/solidata_backend.git

pull repo

git pull origin master

OR

git fetch --all
git reset --hard origin/master

IF NEEDED : REMOVE FILE FROM GIT HISTORY

remove file from repo previously not in gitignore

git rm -r --cached .
git add .
git commit -m "Removing all files specified in .gitignore"

set up config

git config --global user.name “sammy”
git config --global user.email “sammy@email.com”