Boss says: I want the app to say hello in French!
- change hello.rb so that it says
puts 'bonjour!'
- type into command line:
git add .
git commit -m "changed greeting from English to French"
Boss says: I changed my mind! I want the app to say hello in Spanish!
- change hello.rb so that it says
puts 'hola!'
- type into command line:
git status (it shows that you’ve modified hello.rb)
git commit -am "changed greeting from French to Spanish" (using -a does git add . for you)
Boss says: I changed my mind! I want the app to say hello in Hebrew!
- change hello.rb so that it says
puts 'shalom!'
- type into command line:
git status (make sure the modifications make sense)
git add hello.rb
git commit -m "changed greeting from Spanish to Hebrew"
Boss says: I changed my mind! I want the app to say hello in Esperanto!
- change hello.rb so that it says
puts 'saluton!' save
Boss interrupts you: I changed my mind! I want the app to say hello in Hebrew!
- type into command line:
git reset --hard (takes your uncommited changes back to last commit. If the problematic commit is the most recent commit, and you have not yet made that commit public, you can just destroy it using git reset.)
git commit -am "decided not to change greeting from Hebrew to Esperanto"
Boss says: I changed my mind! I want the app to say hello in French!
git revert HEAD^ (this takes you back to the commit before the latest commit)
A little explanation: git reset, git revert and git checkout can all be used in different situations where you want to go back to previous commits. git reset rewrites history and should only be used when you are working locally and haven’t yet pushed your changes to the central repo. git revert records a new commit to reverse the effect of an earlier commit. You can use git checkout if you want to extract specific files as they were in another commit.
If your repo gets hosed by reverting, resetting & checking out, git reflog may help to rescue you. It keeps track of everything that has happened and you can use HEAD@{number} to get back any lost info through merging, cherry-picking or more reverting, resetting & checking out.
[...] Git Reset & Git Revert [...]
Great One…
I must say, its worth it! My link, http://anns11.insanejournal.com/,thanks haha…
Hi…
http://www.webcamgirls4.com/...