Pages - Menu

Showing posts with label github. Show all posts
Showing posts with label github. Show all posts

Monday, March 4, 2013

Removing untracked files from Git working copy

Today I had to remove some untracked files from my git working copy and it turns out to be really simple.

Days ago I was deleting those files by hand, what is really stupid unless you want to keep some of them (not my case).

The solution is: clean

git clean -d -f

The -f option will force git to clean the untracked files.
The -d option will remove the directories too.

Sunday, February 24, 2013

Forgot to add files and made a commit?

It happens to me frequently, I make a commit and just after that I remember that there are some files that I left behind.

The solution is pretty simple: amend

git commit --amend -C HEAD

The detail is that you can use it with -C or -c (I hope you noticed the capital).

The -C uses the last commit message and author stuff and commit again but with your forgotten files.

The -c will let you set a new message.

Easy breezy.

Be happy.

Thursday, January 31, 2013

Github: I've created a small bash script to help with git projects

Hello world!

I have create a small bash script to open the git project page from terminal with some options.

https://github.com/gerep/opengit

And if someday you think "it would be great if...", just tell me and I'll be glad to try that =)