Uncommited files in git repo: how to reject local changes

It has happened to me a few times: I do local changes and test stuff locally. Then I come back a while later (weeks) and I have forgotten what were the changes for. In order to play it safe, I want to reset my local files to what is there on the github repo, so here is the solution


git fetch --all
git reset --hard origin/master

 Thanks RNA!


I am keeping all my code in a DropBox synchronized folder.

Besides, I keep the code in GitHub.









GIT and GitHub: how to avoid entering credentials every time




git remote set-url origin git@github.com:username/repo.git

about git error messages

the first time you push your local repo to a remote repo (f.e. github) if you get this message:

error: src refspec master does not match any.
error: failed to push some refs to 'git@github.com:xxx/yyy.git'

it’s because you forgot to make your first commit!

Pretty simple, yeah, but the literal of the error message it’s a bit difficult to “decipher” so I decided to write a quick note in case this helps you…

How to work with the console and github ruby projects

How to work on the console when you have a ruby project you want to try? If you are tweaking the code I believe that gem install … is not the solution.

So, I found a solution here: http://stackoverflow.com/questions/5424905/automatically-load-projects-environment-to-irb

What you can do is 

irb -Iname_of_libfolder -rname_of_rb_file

for example for me that was irb -Ilib -rwp_rpc