Git(hub) for windows developers


Published on

Centralized Source Control Systems are so 90’s. Forget Team Foundation Server, Subversion,… Today it’s all about Distributed Source Control systems. Working with many developers on the same project, using lots of branches, managing versions and releases will no longer be a painful experience.
Let’s have a (first) look together at GIT and GITHub and how this will simplify your life as a .NET developer.

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Bart (stelt ons allebei voor)
  • BartBefore we start some questions:Who has experience with source control?Who has experience with distributed source control like Git or Mercurial?Who knows github?Who is using github today?Important remark: this is an introductionary session
  • Bart
  • Bart
  • Kristof
  • KristofJust describe the slide, straightforward.Important is not to fiddle with anything other than the Working Directory. All the rest are managed by Git.
  • KristofFree, open source, fast.Full local copyBranching is first of all local, THEN you sync it with the server, so for all that matters the server doesn’t need to know that you’re developing changes on 3 seperate feature branchesOfcourse for backup related stuff it might (is) wise to sync them with at least one other server (if anything can go wrong, it will)Last point: since on the server the size is the same as your local repository, requirements are smaller. No need for a database server...
  • BartThrough the console pain
  • Bart
  • BartTrue= handing voor cross platform teams(unix & windows & …)False= mag niet op WindowsInput= voorkeur indien iedereen op zelfde platformUpdate:True (only applies on Windows) crlf -> lf at checkin, lf -> crlf at checkout (NO!)False = leave as is ---- this is what we needInput: transform CRLF -> LF at checkin, don’t touch checkout.
  • Bart
  • BartIntroduce yourself to gitGitconfig and ~/.gitconfiggitconfig: global settings look at: C:\\Program Files (x86)/Git/etc/gitconfig notice the setting "autocrlf = true" ~/.gitconfig: user settings file tell git about yourself and your machine first and your preferences to create this file.Username : gitconfig --global <name>Email : gitconfig --global <email>Color UI  colors git output : gitconfig --global color.ui trueThese settingsget written to your ~/.gitconfig fileShow config file and content (~ = C:\\Users\\<username> folder)Better alternative then SSH key is the Windows Credential Store helper:Download it here SSH key(we need this to connect to GitHub later)$ cd ~/.ssh : Checks to see if there is a directory named ".ssh" in your user directory$ ssh-keygen -t rsa -C "“ Creates a new ssh key using the provided email$ ssh -T :Attempts to ssh to githubInitialize repositoryCreate a new folder)$ cd ~mkdir communityday2012cd communityday2012Git initA new git repository is createdShow the created foldersStart SeeGit
  • Open Visual StudioCreate new applicationCopy the application content to the previously created folderAdd a readme.txt file to the created folderCheck the git status$ git status Too many files are includedAlso show result in SeeGitWe can solve this by adding a .gitignore filetouch .gitignoreGo to Select the correct .ignore file content and copy itCan also be configured for all projects : git config --global core.excludesfile ~/.global_ignore Check the git status$ git status Only the required files remainAlso show result in SeeGit
  • To add one file, do:$ Git add Readme.txt (IMPORTANT: case sensitive!)To add all files, do:$ Git add . This will add all files to the staging environmentCheck the current status$ GitstatusAlso show result in SeeGit
  • Let’s now commit the files to the repository$ git commit –m “Initial commit”Check the status$ git statusLet’s have a look at the commit history of your repository$ git logYou can view statistics about which files have changed and how many lines were added and removed from each file by adding the $ git log –stat (press q to quit the editor)Also show result in SeeGit
  • KristofImportant remark: only one working folder(!)Git branch  view master branchGit checkout -b devGit branch  view dev branchesChange something in “dev” branch(readme)Commit in that branchGit checkout masterChange something in the same file(readme)  causes merge conflictCommit in the master branchAlso show result in SeeGit(If needed stash changes if you don’t want to commit them.)  similar to Shelvesets in TFS
  • KristofSWITCH BRANCH to MASTER!!!!!  uses the same folder(!)Pull changes from devGit merge “dev”A merge is (unlike TFS) final  No local pending changes and commit(!)Use SeeGit to show resultsGitk  show history
  • Kristof
  • KristofJust read description, straightforward.
  • KristofLogin as a userShow site functionalityAdd SSH keyClick “Account Settings” > Click “SSH Keys” > Click “Add SSH key”Create (new)repositoryPush local changes to githubgit remote add origin push –u origin masterShow some keyboard shortcuts(shift-?)Show reports(graphs)
  • KristofForkLogin with other account( Bart)Fork repository from previous accountMake change to readmeAdd comment to lineSend pull requestPull requestsLogin with original accountReview pull request
  • Bart
  • Bart
  • Adding repositoriesYou can add any repository already on your hard drive by dragging a folder in from Explorer. If that folder is a Git repository, GitHub for Windows will import all of the history and connect it to your GitHub accounts. Another great way to add repositories is to clone them from You can do that right in the application by browsing through your personal account and any organizations you belong to. You can also clone with one click from any repository page on Just look for the Clone in Windows button. Command lineYou can pull up a PowerShell console within the context of any repository. GitHub for Windows even includes the amazing posh-git utility for your command line pleasure. SSH key managementIn most cases you don’t even need SSH keys. All repositories are cloned over HTTPS by default, and GitHub for Windows caches your credentials so you don’t have to keep entering your password for every remote action, even on the command line. For cases where you have an existing repository using an SSH remote, GitHub for Windows will seamlessly set up SSH for you. You will get an email and see a new key added to your accountBranches: local & remoteCreate repositoryFrom file system through drag & dropFrom clone in windows button on GitHubChange repository settings- add gitignore- change gitattributesCreate branchChange branchCommit changeMerge branchShow diffPush to github button
  • Bart
  • Bart
  • Bart
  • Git(hub) for windows developers

    1. 1. #comdaybe Git(Hub) for Windows Developers Ordina Belgium Kristof Mattei & Bart Wullems
    2. 2. About us• Bart Wullems – .NET Application Architect @Ordina – –• Kristof Mattei – .NET developer @Ordina – –
    3. 3. About Ordina• IT Consultancy Firm• Offices in Mechelen & Hasselt• 600+ employees, 80+ MS developers• 5 focus sectors: – banking, public, pharma, industry, teleco m
    4. 4. Agenda• Distributed Source Control• What’s Git?• Git Basics• MsysGit• Github• Github for Windows• Q&A
    5. 5. Distributed source control
    6. 6. About Version Control Local Version Centralized Control Systems Version Control Systems
    7. 7. About Version Control• Distributed Version Control Systems – No central repository – Disconnected – Fast
    8. 8. --distributed-even-if-your-workflow-isn’tWhat’s Git?
    9. 9. Git• Global Information Tracking – Git is a free and open source distributed version control system used as software configuration Management tool. – Git is a distributed version control system – Git does not use a centralized server. – Git runs on Linux, BSD, Solaris, Darwin, Windows, and other operating systems.
    10. 10. Git basics
    11. 11. Git BasicsThe Three States
    12. 12. git and 3 conceptual spaces• Git deals with 3 spaces. Each space is a self contained area of concern to git and to you. – Working Directory (e.g. testgit folder) • this is where you keep your current files visible in directory or folder. – Index or Stage (e.g. "testgit/.git/index") • this is where git keeps snapshot to be committed permanently to Repository – Repository (e.g. "testgit/.git/objects/*") • This is the history of commits, trees, blobs etc..
    13. 13. Advantages• Free• Local• Fast• Distributed• Small
    14. 14. msysGit
    15. 15. msysGit• Git client for Windows –
    16. 16. LF and CRLF line endings• CRLF is for Windows and LF is for unix. – to keep cross platform development going smooth keep CRLF for windows and LF for unix – with autocrlf = true git converts your windows CRLF into LF internally• Our recommendation – autocrlf = false
    17. 17. Open “Git Bash”
    18. 18. First git commandsdemo
    19. 19. Codingdemo
    20. 20. Stagingdemo
    21. 21. Commitdemo
    22. 22. Branchdemo
    23. 23. Mergedemo
    24. 24. Github
    25. 25. What is Github?•
    26. 26. GitHubdemo
    27. 27. Social codingdemo
    28. 28. Github for Windows
    29. 29. Github for Windows New• “Better Git on Windows”
    30. 30. Github for Windowsdemo
    31. 31. Learn More The next step is to read guides and books online. start with the git community book marekj |
    32. 32. Learn More• Git For Windows Developers by Jason Meridth••
    33. 33. Q&A
    34. 34. Thank you!