Git_Basics II.pptx
- Количество слайдов: 12
GIT Basics Kostiantyn Vorflik Junior Software Engineer OCTOBER 21, 2016
PART I GIT BASICS II
Agenda 1 Rebasing 2 Stashing 3 Magic reset 4 Tortoise. Git 5 Perforce - Visual Merge and Diff Tool
Rebasing git checkout master git merge experiment git checkout experiment git rebase master Do not rebase commits that were pushed to public repository!
Interactive rebasing git rebase [branch] -i Allows you to do interactive rebasing. pick 652 e 6 db add description pick d 399 dbb fix bug # # # # Rebase 8 ab 9919. . d 399 dbb onto 8 ab 9919 (2 command(s)) Commands: p, pick = use commit r, reword = use commit, but edit the commit message e, edit = use commit, but stop for amending s, squash = use commit, but meld into previous commit f, fixup = like "squash", but discard this commit's log message x, exec = run command (the rest of the line) using shell d, drop = remove commit These lines can If you remove a However, if you Note that empty be re-ordered; they are executed from top to bottom. line here THAT COMMIT WILL BE LOST. remove everything, the rebase will be aborted. commits are commented out $ git rebase -i master Stopped at 652 e 6 db 2 d 64853 dafa 66 bbb 40 f 98 e 8 f 826 a 5 a 798. . . add description You can amend the commit now, with git commit --amend Once you are satisfied with your changes, run git rebase --continue
Stashing git stash the same as git stash save [message] The command saves your local modifications away and reverts the working directory to match the HEAD commit. git stash list List the stashes that you currently have. git stash pop List the stashes that you currently have. git stash clear Remove all the stashed states.
The reset magic: 3 steps Initial state
Tortoise. Git
Perforce - Visual Merge and Diff Tools
Resources 1 About Git rebase https: //help. github. com/articles/about-git-rebase/ 2 Tortoise. Git https: //tortoisegit. org/download/ 3 Perforce – visual merge and diff tools https: //www. perforce. com/product/components/perforce-visual-merge-and-diff-tools 4 Integrate with Tortoise. Git http: //hotkoehls. com/2015/04/use-perforce-p 4 merge-with-tortoisegit/
Q&A Do you have any questions?
Thank you!
Git_Basics II.pptx