Tag Archives: Git

Git Ignore Template for .NET

Hi everyone,

A sample .gitignore file for if you’re working with .net:

*.cache
*.dll
*.exe
*.pdb
/build/
*.suo
*.user
_ReSharper.*/
*.sdf
*.opensdf
*.tlog
*.log
TestResult.xml
*.VisualState.xml
Version.cs
Version.h
Version.cpp

Also, if you happen to have added some files you didn’t mean to:

git rm –cached file_you_dont_want.pdb
git commit -m “Remove pdb file”

Thanks to these stackoverflow posts for the info:
https://stackoverflow.com/a/8675415/522859
https://stackoverflow.com/a/11629271/522859

Import an Existing Project to BitBucket

Hi everyone,

Today I needed to import an existing project to Bitbucket. The documentation is really good, but just in case you have trouble finding it:

  1. Navigate to the root directory of your project.
  2. Run the following commands in terminal/command prompt:
    git init
    git add –all
    git commit -m “Initial Commit”
  3. Login to Bitbucket and create repository.
  4. Locate the clone URL (left menu) e.g. https://email_address.bitbucket.domain:7999/project_name/repo.git
  5. Upload your files:
    git remote add origin https://email_address.bitbucket.domain:7999/project_name/repo.git
    git push -u origin master

    Check out the following link for more info: https://confluence.atlassian.com/bitbucketserver/importing-code-from-an-existing-project-776640909.html

Assets:Precompile (Rake Aborted) – Heroku

Hey everyone,

I ran into the following error over the weekend while trying to push to heroku:

Running: rake assets:precompile
rake aborted!
could not connect to server: Connection refused
Is the server running on host “127.0.0.1” and accepting
TCP/IP connections on port 5432?

This stackoverflow post helped to solve the issue. All you need to do is add the following line to your application.rb file:

  1. #Applicication.rb
  2. config.assets.initialize_on_precompile = false

Let me know if you have any problems.

Git with KDiff3 – Windows

Hey all,

Just a quick post showing the config I needed to use in order to get KDiff3 working with git. It took a while to get this working so hopefully it’ll be able to help someone else out.

  1. #Config file
  2. [user]
  3. 	email = test@test.com.au
  4. 	name = test
  5. [core]
  6. 	editor = \"C:\\Program Files\\Sublime Text 2\\sublime_text.exe\"
  7.  
  8. [apply]
  9.     whitespace = fix
  10.  
  11. [color]
  12.     branch = auto
  13.     diff = auto
  14.     interactive = auto
  15.     status = auto
  16.  
  17.  
  18. [core]
  19.         pager = less -FRSX
  20.         whitespace = cr-at-eol
  21.         autocrlf = input
  22.         excludesfile = /Users/test/.gitignore_global
  23.         editor = mate -w
  24.  
  25. [alias]
  26.         co = checkout
  27.         lg = log --graph --pretty=oneline --abbrev-commit
  28.  
  29. [gui]
  30. 	recentrepo = Y:/Projects/Junk
  31. 	recentrepo = C:/xampp/htdocs/onlinemedia
  32. [merge]
  33. 	tool = kdiff3

Screenshot of git config from GUI:

Git Config KDiff

Git Config KDiff

Running KDiff3:

Executing KDiff3

Executing KDiff3

KDiff3 display:

KDiff3 Display

KDiff3 Display