Translations
Info
All page names need to be in English.
en da  de  fr  it  ja  km  nl  ru  zh

Workflow Tools

From TYPO3Wiki
Jump to: navigation, search

During the T3UXW15 - TYPO3 User Experience Week 2015 Kay Strobach has been so kind to explain how to set up the most important workflow tools like an IDE, Version Control System, virtual machines for development etc. This is a summary of his talk on the 24.03.2015.

Workflow Tools and their functionality

Git - Decentralized version control

  • Available for all OS
  • Git works without internet connection
  • Git doesn`t save changed files completely but instead only saves chunks of the changed data
  • config: configuration of your git repo
  • head: points to current branch
  • branches: different versions of your software project. Can be merged.
  • hooks: automated operations before definable actions e.g. pre-commit code check
  • .gitignore -> like robots.txt for SE spiders. Here you can define / list files and folders that should not be commited
    • file.ext
    • .dir
    • .subdir/*

You can`t commit empty subdirs. To commit empty subdirs just create an empty .gitignore file in the subdir. .gitignore files will be commited but won`t be shown in git status

git init  -> creates new git folder / repository on your local system
touch index.html -> Neue Datei unter Linux anlegen
git status -> index.html is red / not yet added to git or contains uncommited changes
git add index.html -> prepare file for commit
git status -> index.html is green / all changes have been commited
git commit - a -> prompts commiting user for a comment that describes that changes made
git commit -am "your comment" -> quickly add a commit comment
git log -> show the changes / commits that have been made
git add -f .gitignore -> force add of special files like .gitignore
git add * works recursively


GitHub

https://help.github.com/articles/generating-ssh-keys/ -> create SSH key to protect your commits
You`ll need a shell/bash for this
Windows: GitBash is included in windows.github.com package
id_rsa -> Private key. Keep this private and secure
id_rsa.pub -> Public key to share with the people / servers you`d like to communitcate with

Add your public key to github.com

  • Open https://github.com/settings/ssh
  • Click "Add SSH key".
  • Enter on your local bash:
  • cat ~/.ssh/id_rsa.pub -> display public key to copy it
  • Copy key and save settings

Working with GitHub.com - Basics

Git Cheat-Sheet: http://www.git-tower.com/blog/git-cheat-sheet/

  1. create new repository (public is free, private requires a paid account on GitHub)
  2. Copy the SSH clone URL in the right column (click on the SSH link beneath the URL-field)
  3. enter the following bash-command: git remote add origin "YOUR_SSH_clone_URL" -> this adds the remote repo URL to your local config file
  4. check config file of your local repo to make sure that the remote repo has been added
  5. git pull origin master -> Download changes from remote repo. This will start a merge if the states of the repositories differ.
  6. git push - u origin master > Upload changes made in your local repo to remote repo

Working with GitHub.com - Branches

Common branches: master, developer, features

  • git branch "BRANCH_NAME" -> creates new branch
  • git checkout "BRANCH_NAME" -> switch to branch
  • git status -> shows status of branch
  • git commit -am "[FEATURE] "BRANCH_NAME" -> commits changes to branch
  • git checkout master -> leave branch and go back to master
  • git merge "BRANCH_NAME" -> merge the changes made to the branch with the master

Working with GitHub.com - Merging conflicts

If remote repo has changed a file that you didn`t pull and you do:

git push 

You`ll get a warning and git refuses to push So you`ll have to do a git pull first Remove the conflicts by editing the files containing the conflicts

git add the cleaned up files to prepare them for rebase
git rebase -- continue -> Führt nach der Bereinigung den pull Prozess weiter
git commit -a --amend -> changes last commit. 

You can also edit your comment. NEVER use amend after a push!!!

VI - Editor

basic commands:

   press i, a or e to enter edit mode
   press ESC to leave edit mode and enter command mode
   press : to open command prompt
   in command prompt enter w to save file, q to quit or q! to quit without saving
   

PHPStorm / your IDE

Unit-Tests are integrated in the IDE. Lines of code will be marked green or red dependent on the Unit-Test results. Integrated Git client Projects will be indexed. Code completion ToDo handling Jenkins Integration xDebug Support. Define breakpoints and check your projects. Integrated database admin (like PHPMyAdmin) Integration of ticket / task systems like Jeera PHP Stacktrace: Copy error messages into a search field and finde the responsible code Deployment Assistant: Upload files to servers via different ways Xdebug Profiler Analyze debug output. Generate statistics and graphics out of debug info REST Client: Test HTTP request results Vagrant and Composer support Refactor: move methods to Abstract class. Detects inherited methods in other classes and moves them as well SHIFT - SHIFT opens search dialogue Rearrange and reformat code. Beautify, restructure and optimize code. Also good for minified code Mark syntax errors Mark deprecated code Full screen and presentation mode Edit multiple places in the code at once with ALT+left mouse TypoScript and fluid Syntax Highlighting and code completion CSV date view: view CSV files like in excel

Vagrant / VirtualBox

Use one base image and configure it in different ways. Themes package contains a Vagrantfile configuration Docker Not the best tool for Mac