17. Un-Staged Changes
patrick$ echo “I’m updating this again.” > README
patrick$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in
working directory)
#
# modified: README
#
no changes added to commit (use "git add" and/or "git commit -a")
23. Reset
patrick$ git reset
Unstaged changes after reset:
M README
patrick$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: README
#
no changes added to commit (use "git add" and/or "git commit -a")
33. How Do We Do It?
patrick$ git checkout -b new_feature
Switched to a new branch 'new_feature'
34. How Do We Do It?
patrick$ git checkout -b new_feature
Switched to a new branch 'new_feature'
patrick$ git branch
master
* new_feature
35. How Do We Do It?
patrick$ git checkout -b new_feature
Switched to a new branch 'new_feature'
patrick$ git branch
master
* new_feature
patrick$ git checkout master
Switched to branch 'master'
36. How Do We Do It?
patrick$ git checkout -b new_feature
Switched to a new branch 'new_feature'
patrick$ git branch
master
* new_feature
patrick$ git checkout master
Switched to branch 'master'
patrick$ git branch -d new_feature
Deleted branch new_feature (was
5008efe).
43. What Happened?
patrick$ git status
# On branch master
# Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark
resolution)
#
# both modified: README
#
no changes added to commit (use "git add" and/or "git commit -a")
54. Stashing
Cannot change branches with pending
changes
Save your work if not ready to commit
Apply pending changes to a different branch
Works like a stack
56. Example
patrick$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: README
57. Example
patrick$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: README
patrick$ git stash
Saved working directory and index state WIP on master: 92a5183
Updated README
HEAD is now at 92a5183 Updated README
60. Example
patrick$ git status
# On branch master
nothing to commit (working directory clean)
patrick$ git stash apply
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in
working directory)
#
# modified: README
#
61. Deployments
Code pulled from repository or build archive
Code not checked in will be overwritten
Soon all production servers will be IT access
only