Posts Tagged ‘SourceCodeControl’

IBM Podcast: Andy Glover interviews Matthew McCullough about Git

August 12th, 2010

Andy Glover recently interviewed me for his new series of IBM podcasts. I was able to share about 20 minutes of my experience with and passion for the Git version control system with his audience. It was an exciting opportunity. Thanks Andy!

Give it a listen and tell me what you think. But more importantly, give Git a try! I think you’ll be pleasantly surprised.

Git Cleanup Screencast

February 19th, 2009

Are you a new user of Git? Here’s some basic help with cleaning up your Git working directories & files. This quick screencast shows you the basics of how Git enables you to ignore files that you never want to track, purge files that are untracked while leaving your tracked files intact, and lastly, roll back all your changes to tracked files to the last-known-good state.

Clean your Git up to Pull successfully

February 14th, 2009

Here’s a quick Git pulling & merging tip for those of you learning this awesome Distributed Version Control System.

Git Pull’s Double Duty

As you may be aware, the git pull command actually does two things under the covers. It does a git fetch to freshen your tracked remote branch and it does a git merge to merge it into the linked local branch. Sometimes this can go awry if you’ve been experimenting with files locally and forgot to return them to a checked-in state. Git errors out nicely, saying “I don’t know what you want me to do, but I’m going to be cautious here and just let you tell me exactly how to handle this.”

Error Message

One of the possible error messages you’ll see is:

error: Entry 'myapp/src/main/resources/scripts/launchapp.bat' not uptodate

Solutions

If your local changes are unimportant to you and you just want to get back in alignment with the remote branch, you have two options to apply depending on the state of your local files. First, you can reset any tracked files to their last committed state via the following command. This discards any local changes to any tracked files.

git reset --hard

Second, you can discard any untracked local files via the git clean command, in the case that they are colliding with files that the remote branch has actually added and is now tracking. You can purge your repository’s current branch of untracked local files by typing:

git clean -f

And in case you are paranoid about what this will remove, you can get a safe preview of what it would do by typing:

git clean -n

Which outputs a preview list like so:

[~/Documents/Code/myproj.git]: git clean -n
Would remove morecruft.java
Would remove unwatedfile.txt