introducing git to your ftp workflow

15
Introducing o your ftp workflo

Upload: roman-rus

Post on 21-Jan-2017

241 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Introducing Git to your FTP workflow

Introducing

to your ftp workflow

Page 2: Introducing Git to your FTP workflow

Introducing myself

Roman Rus@RomSocial

using WordPress since 2008

Page 3: Introducing Git to your FTP workflow

git initgit add .git commit –m “First commit”git commit -am “First update“

git clone https://github.com/WordPress/WordPress.gitgit remote add origin https://github.com/user/repo.git

git push origingit pull origin

Page 4: Introducing Git to your FTP workflow
Page 5: Introducing Git to your FTP workflow
Page 6: Introducing Git to your FTP workflow
Page 7: Introducing Git to your FTP workflow

+ History+ Undo+ Sharing Code+ Backup

– Collaboration– Not great sync– FTP is still used

cd /your/code/dir/git initgit commit -am "First commit"

Page 8: Introducing Git to your FTP workflow
Page 9: Introducing Git to your FTP workflow
Page 10: Introducing Git to your FTP workflow

+ History+ Undo+ Collaboration+ Test / Stage / Prod

– Installation of python plugin– Setting it up is a bit complicated– What if someone changes web files– FTP credentials in git config files

https://github.com/ezyang/git-ftp

git clone --bare https://github.com/name/repo.git

Page 11: Introducing Git to your FTP workflow
Page 12: Introducing Git to your FTP workflow

+ History+ Undo+ Collaboration

– What if someone changes web files

git clone --bare https://github.com/name/repo.git

# post-receivedeploy_to_dir = File.expand_path('../work')`GIT_WORK_TREE="#{deploy_to_dir}" git checkout -f master`

http://krisjordan.com/essays/setting-up-push-to-deploy-with-git

Page 13: Introducing Git to your FTP workflow
Page 14: Introducing Git to your FTP workflow

+ History+ Undo+ Collaboration+ Test / Stage / Prod+ Remote Tracker

git init git add . git commit –m “initial”git remote add https://bitbucker.com/user/repo.git

git clone --bare https://bitbucker.com/user/repo.git remote.git

git --git-dir tracker.git remote add remote.git

# post-receiveexec git --git-dir /path/to/tracker.git pull