Git Notes

Reading time ~1 minute

The following notes assume that Git is installed. The blog uses GitHub Pages. Sometime there is a clash between the gems used by the blog software and those used by GitHub Pages therefore it is important to check the Dependency Versions.

Check the version of Git against the latest version

git --version

brew update && brew upgrade

The following Git commands are useful:

List the files that are bing tracked


git ls-tree -r master --name-only

Delete files that are being tracked ( and remove from the repo )

git rm my-file.txt

git rm -r my-folder

Update the website ( and upload to repo )

git add .

git commit -m "some text describing the change"

git push -u origin master

Check the information stored in the osxkeychain used by github ( security )

git config -l

After an update of git sometimes the system asks for verification of the key chain on each upload to the repos. To solve the problem:

  1. Open Keychain Access ( Applications/Utilities/Keychain Access)

  2. Select Keychains -> login and Category -> Passwords

  3. Type github.com in the search box and find Internet Password. Right click and Delete. If there are more than one then check them before deleting.

  4. Go back to the Terminal and type:

git config --global credential.helper osxkeychain

On the next upload the system will ask for the git username and the git password.