Showing posts with label Git. Show all posts
Showing posts with label Git. Show all posts

Tuesday, 21 May 2013

Git branching tutorial

Working with branches in git is easy. That's not saying there's some powerful, more advanced commands for complicated branching scenarios. This git branching tutorial demonstrates the basics and those advanced commands you may not even be aware of - worth a play if you've got 30 mins spare.

Tuesday, 16 October 2012

My standard .gitignore file for .Net projects

Thumbs.db
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*.vssscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.cache
*.ilk
*.log
[Dd]ebug*/
*.lib
*.sbr
obj/
[Rr]elease/
[Dd]eploy/
_ReSharper*/
[Tt]est[Rr]esult*/
[Tt]est-[Rr]esult*/
[Tt]emp/
[Pp]rerelease/
[Ll]ogs/
UpgradeLog*.XML
_UpgradeReport_Files/
bin
!SharedLibs/NUnit-*/bin/
!SharedLibs/NUnit-*/bin/net-*/*.exe

Thursday, 24 November 2011

One Git Clone to Rule Them All

git clone --recursive REPOSITORY_URL -o REPOSITORY_ALIAS
  • --recursive - Gets the submodules too
  • --o - Sets an alias for remote repo rather than defaulting to origin (useful when working in teams)

Monday, 16 May 2011

Getting to grips with Git

Git is a world apart from Team Foundaation Server and people seem to be frightened at a first attempts with it, as it can seem complex. Stick with it though and you'll soon see past that and how simple it can be. Git is a distributed source control system, so it allows you to work disconnected from the main repository and still commit. This 'commit' is to your local repository. You should commit often. Once happy that all your tests pass should you push to the remote repository.
  1. clone - get the source code from your remote git repository
  2. Make your changes
  3. commit - commits your changes LOCALLY (not the remote git repository)
  4. push - commits your changes to the REMOTE repository
For me, working disconnected is the number one advantage for Git over TFS. Number 2 is the ability to create branches. Essentially just a seperate work stream you can use for working on seperate features. Once happy, you then merge your branch into the master branch (which is the main repository).
  1. clone - get the source code from the remote git repository
  2. branch branch-name - create a branch branch-name
  3. Make your changes on your branch
  4. commit - commits your changes LOCALLY (not the remote git repository)
  5. push origin branch-name - commits your changes to the REMOTE repository
  6. checkout master - switch to the master branch
  7. merge branch-name - merge the feature branch into the master
  8. commit and push !!!
I'd strongly recommend that you use the git bash until you get to grips with the git comands, then you can make use of the helper tools.
At the moment I'm still working with the bash but I occasionally use TortoiseGit for windows explorer integration and Git Source Control Provider for Visual Studio GUI integration.

Wednesday, 23 February 2011

Git First Impressions

So far, so good :) Took me just under half a day to set up a git repository, import the existing project source and update our CI server. GitHub works well for creating your repositories and walks you through the process. It's very quick, especially when you comapare it to TFS - it's knocked 40% off our build time for a fairly hefty web app. It's not just the speed thats impressive though, having a complete history and full revision tracking capabilities, not dependent on network access or a central server is something as a TFS slave user, I've been longing for. I still think there's lots to get my head round, which will make things interesting next week when I have some real work to do on this project; so watch this space.

Here are some useful resources if you are just getting to grips with Git:

Git Bandwagon

I've being feeling the peer pressure of late to try out Git as source code repository for our the app team's projects. Today I'm going to give it a try with one of our bigger web apps. I'm hoping that it won't take me too long to get my head round the way Git works and that it results in the project build time dropping on our CI server. Well it had better - time is money!

Git is an extremely fast, efficient, distributed version control system ideal for the collaborative development of software.