Preparing and Adding a new Project to git

I always struggle when I am ready to push my first commit to a new repository and always end up with errors, so I thought I would document the process here as an aide memoir for me and, hopefully, others will find it useful too.

Prerequisites

These instructions are for when you have already got a folder of code that you want to commit for the first time to git. The first thing to do is to create and setup your .gitignore file. This tells git which files to exclude when uploading. Things to include here are config files with … Read the rest

/usr/bin/git-receive-pack: stale NFS file handle Error

What do you do when you want to commit some work, you go to do a git push and what you get back is the following?

fatal: protocol error: unexpected 'Error running git: fork/exec /usr/bin/git-receive-pack: stale NFS file handle'

At first I spent ages doing a search and checking various Stack Overflow questions to see whether I could find a fix. All sorts of things were suggested and I looked into before I remembered that a push in my case was to a remote origin. The third party service BitBucket. When I had a look at their status page the … Read the rest

Applying .gitignore Change to a Repository

A great feature of git is the ability to mark certain file and folders as being excluded from the repository which is done via entries in the .gitignore file.

One issue I regularly have is when things change and I need to update the .gitignore file and I always forget how to apply that change. That’s because it is something that isn’t obvious or something that I do regularly. Fortunately it is incredibly easy to achieve and here’s how…

How to apply .gitignore changes

Assuming that you have already edited and made your changes to .gitignore the next this to … Read the rest