A link to a very useful post on this topic http://www.rapaul.com/2010/06/10/avoiding-brittle-tests-with-mockitos-argument-captor/
Nuts
martedì 3 luglio 2012
venerdì 4 novembre 2011
git reset committed and pushed
Have you commit something by mistake and also pushed everything?
git log
for the list of your log.
The log output is something like:
commit d946591753539639548b94b6aa40a875ce09a872
Author: Andrea Boriero <dreborier@gmail.com>
Date: Fri Nov 4 12:00:38 2011 +0000
bla bla bla
commit d946591753539639548b94b6aa40a875ce09a872
Author: Andrea Boriero <dreborier@gmail.com>
Date: Fri Nov 4 12:00:38 2011 +0000
bla bla bla
choose the commit you want to revert back, for example d946591753539639548b94b6aa40a875ce09a872
than to remove all commits after that:
git reset -f --hard d946591753539639548b94b6aa40a875ce09a872
and than to remove from origin:
git push -f
Hope this can help someone.
git log
for the list of your log.
The log output is something like:
commit d946591753539639548b94b6aa40a875ce09a872
Author: Andrea Boriero <dreborier@gmail.com>
Date: Fri Nov 4 12:00:38 2011 +0000
bla bla bla
commit d946591753539639548b94b6aa40a875ce09a872
Author: Andrea Boriero <dreborier@gmail.com>
Date: Fri Nov 4 12:00:38 2011 +0000
bla bla bla
choose the commit you want to revert back, for example d946591753539639548b94b6aa40a875ce09a872
than to remove all commits after that:
git reset -f --hard d946591753539639548b94b6aa40a875ce09a872
and than to remove from origin:
git push -f
Hope this can help someone.
martedì 20 settembre 2011
Git - List all not pushed commits
git log --branches --not --remotes=origin
shows commits that is not present on remote origin branch
venerdì 26 agosto 2011
Git - restore deleted but not committed files
You have deleted the file HelloWorld.java but not yet committed, if you want to restore it :
git checkout HEAD HelloWorld.java
git checkout HEAD HelloWorld.java
giovedì 25 agosto 2011
Git, undoing uncommitted changes
You have the staged file HelloWorld.java, you have modified it and staged those changes but then you want to unstage those changes :
git reset HEAD -- HelloWorld.java
You have a new file HelloWorld.java, you have added it to staged files but then you do not want to commit the new file:
git rm --cached HelloWorld.java
if you want to undo all changes:
git checkout
Be careful, git checkout removes all untracked changes and you can't recover those changes anymore (files never tracked by Git will be deleted).
git reset HEAD -- HelloWorld.java
You have a new file HelloWorld.java, you have added it to staged files but then you do not want to commit the new file:
git rm --cached HelloWorld.java
if you want to undo all changes:
git checkout
Be careful, git checkout removes all untracked changes and you can't recover those changes anymore (files never tracked by Git will be deleted).
mercoledì 17 agosto 2011
My personal imaginary interview with The Clean Coder book :-P
Me : I must know my code works but how can I know my code works?
Uncle Bob's book : That's easy. Test it. Test it again. Test it up. Test it down. Test it seven ways to Sunday!... and don't forget to automate your test.
Me: But isn't code hard to test, my code really is?
Uncle Bob's book: yes but only because that code has been designed to be hard to test.
Me: how can my code be designed to be easy to test?
Uncle Bob's book: the best way is to write your tests first, before you write the code that passes them (TDD).
Uncle Bob's book : That's easy. Test it. Test it again. Test it up. Test it down. Test it seven ways to Sunday!... and don't forget to automate your test.
Me: But isn't code hard to test, my code really is?
Uncle Bob's book: yes but only because that code has been designed to be hard to test.
Me: how can my code be designed to be easy to test?
Uncle Bob's book: the best way is to write your tests first, before you write the code that passes them (TDD).
domenica 7 agosto 2011
A very minimal guide to the tar command
to extract from an archive
- for .tar use tar -xvf [archiveName]
- for .tar.gz, .tgz use tar -xvzf [archivefile]
- for .tar.bz2, .tbz2, .tbz use tar -xvjf [archivefile]
- for .tar.Z than use tar -xvZf [archivefile}
to compress a folder or a list of files
- for .tar use tar -cvf [archiveName] [pathname ...]
- for .tar.gz, .tgz use tar -cvzf [archiveName] [pathname ...]
- for .tar.bz2, .tbz2, .tbz use tar -cvjf [archivename] [pathname ...]
- for .tar.Z use tar -cvZf [archivename] [pathname ...]
[pathname ...] can be the path of a folder or the path of a list of files you want to compress.
to see the content of an archive, without extracting:
- for .tar use tar -tvf [archiveName]
- for .tar.gz, .tgz use tar -tvzf [archivefile]
- for .tar.bz2, .tbz2, .tbz use tar -tvjf [archivefile]
- for .tar.Z use tar -tvZf [archivefile}
Iscriviti a:
Commenti (Atom)