GIT POWER USER
Ilmari Kontulainen
@kontulai
@deveoteam
#gitpoweruser
Viimeksi muokattu: 9. Tammikuuta 2015Luottamuksellinen
• Git Aliases
• Rewriting history
• Fast context switching
• Different merging strategies
Topics
Git aliases
• git config --global alias.co checkout
• git config --global alias.br branch
• git config --global alias.ci commit
• git config --global alias.st status
• git config --global alias.dc diff --cached
• git config --global alias.hist ‘log --graph --oneline --decorate --all’
• git config --global alias.unstage 'reset HEAD --'
• git config --global alias.last 'log -1 HEAD'
Git Aliases
• git config --global alias.helloworld ‘!echo “Hello world”’
• git config --global alias.hello ‘!f() { echo Hello $1; }; f’
• git config --global alias.co-recurse '!sh -c “git checkout $1 && git
submodule update --recursive" -'
Execute any shell command with aliases
Rewriting history
• git commit --amend
• git rebase
• git rebase -i
Rewriting history
• Modify last commit
• Or simply edit the commit message
• Changes the commit commit
• Deveo prevents pushing changed history to master branch by default
git commit --amend
• Base the work on my branch to some other branch
• creates new commits
git rebase
https://git-scm.com/book/en/v2/book/03-git-branching/images/basic-rebase-1.png
git rebase
git rebase
git rebase -i
• Clean up the history of your feature branch
• pick
• squash, fixup
• drop
• edit or reword
Fast context switching
• git stash
• git stash --keep-index
• git stash --include-untracked
• git stash --all
• git stash --patch
Fast context switching
Different merge strategies
• regular merge
• -- no-ff / --ff-only (Deveo uses --no-ff)
• --squash
• merging multiple branches into one
Different merging strategies
https://git-scm.com/book
Next webinar 1st of Dec 2016

How to become a Git power user

  • 1.
    GIT POWER USER IlmariKontulainen @kontulai @deveoteam #gitpoweruser Viimeksi muokattu: 9. Tammikuuta 2015Luottamuksellinen
  • 2.
    • Git Aliases •Rewriting history • Fast context switching • Different merging strategies Topics
  • 3.
  • 4.
    • git config--global alias.co checkout • git config --global alias.br branch • git config --global alias.ci commit • git config --global alias.st status • git config --global alias.dc diff --cached • git config --global alias.hist ‘log --graph --oneline --decorate --all’ • git config --global alias.unstage 'reset HEAD --' • git config --global alias.last 'log -1 HEAD' Git Aliases
  • 5.
    • git config--global alias.helloworld ‘!echo “Hello world”’ • git config --global alias.hello ‘!f() { echo Hello $1; }; f’ • git config --global alias.co-recurse '!sh -c “git checkout $1 && git submodule update --recursive" -' Execute any shell command with aliases
  • 6.
  • 7.
    • git commit--amend • git rebase • git rebase -i Rewriting history
  • 8.
    • Modify lastcommit • Or simply edit the commit message • Changes the commit commit • Deveo prevents pushing changed history to master branch by default git commit --amend
  • 9.
    • Base thework on my branch to some other branch • creates new commits git rebase https://git-scm.com/book/en/v2/book/03-git-branching/images/basic-rebase-1.png
  • 10.
  • 11.
  • 12.
    git rebase -i •Clean up the history of your feature branch • pick • squash, fixup • drop • edit or reword
  • 13.
  • 14.
    • git stash •git stash --keep-index • git stash --include-untracked • git stash --all • git stash --patch Fast context switching
  • 15.
  • 16.
    • regular merge •-- no-ff / --ff-only (Deveo uses --no-ff) • --squash • merging multiple branches into one Different merging strategies
  • 17.