Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

The Community Blog is a personal opinion of community members and by no means the official standpoint of DNN Corp or DNN Platform. This is a place to express personal thoughts about DNNPlatform, the community and its ecosystem. Do you have useful information that you would like to share with the DNN Community in a featured article or blog? If so, please contact .

The use of the Community Blog is covered by our Community Blog Guidelines - please read before commenting or posting.


How to join the cool Git Guys

Using Git is one of those things I’ve been postponing for ages. At 40Fingers (and pretty much all other projects I’m involved in) we’re using SVN as our versioning system. I know how it works, it does what I need it to do, so why bother? Well, because everybody around me seems to be leaving SVN for Git and they can’t ALL be wrong, right?

Anyway, there’s probably plenty of other content out there about why you should or shouldn't use either one. I decided I need to, so here goes…

Since I’m one of the developers for NB_Store, which is an open source e-commerce module for DotNetNuke, I fixed a bug in it. While I could of course commit the fix straight into the main development branch (or the master for that matter), for this blogpost, I’ll do it using a pull request.

Step 0: install TortoiseGit

Since I haven’t done much with Git at all, I don’t know much about what Git client would be the best. I’m pretty happy with TortoiseSVN, so I figured I’d give TortoiseGit a shot. Get it here: http://code.google.com/p/tortoisegit/

Step 1: Create a fork

So, what do we need a fork for? Well, It allows me to  have my own copy of the NB_Store sources on Codeplex. I can keep it in Sync with the official project, create my own branches for development and send pull requests to the main project when I’m happy with something.

So, off we go, to then NB_Store project on CodePlex, log in and navigate straight to the Source Code tab. Things might look a little difference at your end, because I happen to be a coordinator on the project:

https://nbstore.codeplex.com/SourceControl/latest

image

I’m going to fork the current master branch. So I have “master” selected and click the Fork link and click “Create new fork” in the popup panel:

image

Since this will be my own nb_store development fork, not for one specific feature, I’ll just name it “nbstore”

and click Save on the form that appears:

image

Now, you see there’s an extra fork on the NB_Store master branch:

image

Step 2: Clone the fork

The fork as “in the cloud” on CodePlex. I can’t work on that, I need to have the code locally on my machine, of course.

So, to create my clone, I’m going to open DNN’s DesktopModules folder in Windows Explorer, right click and choose “Git Clone…”:

image

I’m creating a clone right from my CodePlex fork into my working folder:

image

Clicking OK initiates the Download of all files to my pc.

At this point, there are 3 repositories of NB_Store I’m working with:

  1. the upstream repository: the main NB_Store repository on CodePlex
  2. the origin repository: my own fork of NB_Store, also on CodePlex
  3. the local repository in the DesktopModules folder on my own machine

Step 3: Branch

Now, while I could open the project now and start working, it’s advisable to create a so-called feature branch first. That will keep my fork nice and clean over time. It will also make it a lot easier to create single-feature pull requests.

I need to fix an issue related to all-lowercase-url’s for NB_Store’s back office module. If you’re not all that familiar with NB_Store: forget it. I just mean I need to make a feature-branch and name it something that makes sense. So, right-click my local repository folder, select TortoiseGit submenu and select Create Branch:

image

Notice that I’m switching to the new branch right away.

Step 4: Make that change

I’m not going to cover that here: I’m making the change I need to make in the code. In this case it’s only a few lines in a single file.

Step 5: Commit the change

Now that I’ve made my change, I’ll need to get it stored on CodePlex. To get that done, I use the TortoiseGit context menu again and choose the quick Git Commit option:

image

Next, I’ll enter a commit message and click OK. The next dialog allow me to push my changes to my origin right away:

image

I will need to enter the remote branch name here too, and click OK. You might be asked for your CodePlex credentials at this point:

image

Now, when I go back to NB_Store on CodePlex and select my fork, I will see my own feature branch in the dropdown, and when I select it, I’ll see my commit:

image

Step 6: Create a Pull Request

Finally, I want to send my changes to the development team to allow them to review it and merge the changes in some release if they choose to. This is all done on CodePlex itself. Click the link “Send pull request” in the above screenshot:

image

Make sure you’re sending a pull request from the right branch (I chose my new feature branch and the upstream master). Then fill out the little form with some handy information and click send:

image

 

I know this helped me understand Git a bit better, so if you want to give it a shot yourself, just go ahead and give it try!

Comments

Robrecht Siera
Make sure to post an update on what happens/what to do once your pull request is accepted. I'll stuggling with that part ;-)
Robrecht Siera Thursday, April 24, 2014 11:18 PM (link)
Sergiy Velychko
Thank you for article, Stefan! have used TortoiseSVN a lot, but did not know about TortoiseGit. Looks like also great tool!
Sergiy Velychko Friday, April 25, 2014 4:08 AM (link)
Stefan Kamphuis
I'll be merging the accepted pull request into the master branch of NB_Store and blog about that too. That would be the next step for the developer of the upstream project.

I'm also planning a blog on the next step for the developer of the fork, who will want to update the master branch of his fork at some point and of course his local repository.

Which one of these did you mean, Robrecht?
Stefan Kamphuis Friday, April 25, 2014 11:31 AM (link)

Comment Form

Only registered users may post comments.

NewsArchives


Aderson Oliveira (22)
Alec Whittington (11)
Alessandra Daniels (3)
Alex Shirley (10)
Andrew Hoefling (3)
Andrew Nurse (30)
Andy Tryba (1)
Anthony Glenwright (5)
Antonio Chagoury (28)
Ash Prasad (37)
Ben Schmidt (1)
Benjamin Hermann (25)
Benoit Sarton (9)
Beth Firebaugh (12)
Bill Walker (36)
Bob Kruger (5)
Bogdan Litescu (1)
Brian Dukes (2)
Brice Snow (1)
Bruce Chapman (20)
Bryan Andrews (1)
cathal connolly (55)
Charles Nurse (163)
Chris Hammond (213)
Chris Paterra (55)
Clint Patterson (108)
Cuong Dang (21)
Daniel Bartholomew (2)
Daniel Mettler (181)
Daniel Valadas (48)
Dave Buckner (2)
David Poindexter (12)
David Rodriguez (3)
Dennis Shiao (1)
Doug Howell (11)
Erik van Ballegoij (30)
Ernst Peter Tamminga (80)
Francisco Perez Andres (17)
Geoff Barlow (12)
George Alatrash (12)
Gifford Watkins (3)
Gilles Le Pigocher (3)
Ian Robinson (7)
Israel Martinez (17)
Jan Blomquist (2)
Jan Jonas (3)
Jaspreet Bhatia (1)
Jenni Merrifield (6)
Joe Brinkman (274)
John Mitchell (1)
Jon Henning (14)
Jonathan Sheely (4)
Jordan Coopersmith (1)
Joseph Craig (2)
Kan Ma (1)
Keivan Beigi (3)
Kelly Ford (4)
Ken Grierson (10)
Kevin Schreiner (6)
Leigh Pointer (31)
Lorraine Young (60)
Malik Khan (1)
Matt Rutledge (2)
Matthias Schlomann (16)
Mauricio Márquez (5)
Michael Doxsey (7)
Michael Tobisch (3)
Michael Washington (202)
Miguel Gatmaytan (3)
Mike Horton (19)
Mitchel Sellers (40)
Nathan Rover (3)
Navin V Nagiah (14)
Néstor Sánchez (31)
Nik Kalyani (14)
Oliver Hine (1)
Patricio F. Salinas (1)
Patrick Ryan (1)
Peter Donker (54)
Philip Beadle (135)
Philipp Becker (4)
Richard Dumas (22)
Robert J Collins (5)
Roger Selwyn (8)
Ruben Lopez (1)
Ryan Martinez (1)
Sacha Trauwaen (1)
Salar Golestanian (4)
Sanjay Mehrotra (9)
Scott McCulloch (1)
Scott Schlesier (11)
Scott Wilkinson (3)
Scott Willhite (97)
Sebastian Leupold (80)
Shaun Walker (237)
Shawn Mehaffie (17)
Stefan Cullmann (12)
Stefan Kamphuis (12)
Steve Fabian (31)
Steven Fisher (1)
Tony Henrich (3)
Torsten Weggen (3)
Tycho de Waard (4)
Vicenç Masanas (27)
Vincent Nguyen (3)
Vitaly Kozadayev (6)
Will Morgenweck (40)
Will Strohl (180)
William Severance (5)
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out