Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Version Control Systems for Researchers

1b1baf18fca6198b64ffba35b1289631?s=47 CodingClubUC3M
September 25, 2018

Version Control Systems for Researchers

1b1baf18fca6198b64ffba35b1289631?s=128

CodingClubUC3M

September 25, 2018
Tweet

Other Decks in Education

Transcript

  1. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Version Control Systems for Researchers Pedro Vicente Gómez Sánchez Senior Software Engineer at Karumi pedro@karumi.com @pedro_g_s github.com/pedrovgs
  2. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

  3. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Fran Fernández Senior Software Engineer Jorge Barroso GDE and Co-Founder Davide Mendolia CTO and Co-Founder Sergio Gutierrez Senior Software Engineer Antonio López Software Engineer
  4. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    What’s a version control system?
  5. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Software used to manage the different versions and the changes of our files over the time.
  6. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

  7. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

  8. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

  9. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    What are we going to do today?
  10. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    What are we going to do today? • Learn the basics of Git. • Learn how to use GitKraken and GitHub.
  11. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    At the end of the workshop I’ll be able to... • Manage the different versions of my papers or software based projects. • Create a private repository to store my repositories for free in the cloud. • Review the history of my project. • Compare different versions of my projects between different dates. • Collaborate with other researchers easily.
  12. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Vocabulary
  13. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Vocabulary • Repository: Project we want to version. • Commit: A point of the history we want to save. • History: Set of commits sorted by date I can use to move around. • Pull request: Collaboration request. • Branch: A different evolution of my project. • Merge: Combination of two commits or branches.
  14. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Any doubts?
  15. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Let’s write a paper in 5 seconds!
  16. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    http://thatsmathematics.com/mathgen
  17. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Create a GitHub account
  18. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    https://www.github.com
  19. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    You can get a free account later!
  20. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    https://education.github.com/pack
  21. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Download and Install GitKraken
  22. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    https://www.gitkraken.com
  23. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Create a GitHub repository
  24. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Open GitKraken and initialize a new GitHub repository
  25. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    The result is an empty repository
  26. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Let’s make our first change!
  27. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Using any text editor open the README file inside your repository and add the following content: # Paper 1: <The title of your paper> ### Author: <Your name and the name of your collaborators> ### Topic: <What’s the paper about> ### Start date: 1st of March, 2018.
  28. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    If the repository already exists we will have to clone the repository instead of creating it
  29. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Let’s create our first commit!
  30. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    GitKraken will show you the files you’ve changed since the initial commit
  31. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    GitKraken will show you the changes you’ve done since the initial commit for every modified file
  32. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    We can now commit these changes adding a message and a description related to the change
  33. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    The result is a new comit in the project history
  34. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Push our commits
  35. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Push our commits to the remote repository is the equivalent of syncing our project with the cloud
  36. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    After pushing your commits you can go to GitHub and review your repository
  37. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Exercise: • Move the content after the “:” chars to the next line. • Remove every “:” char. • Commit using the message: “Change readme format”. • Push. • Review the GitHub repository content.
  38. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    This should be the result
  39. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Exercise: • Add a new author to the README. • Commit. • Add another author to the README. • Commit. • Review the project history from GitKraken and GitHub
  40. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    If you don’t push the commits the content won’t be synchronized
  41. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Exercise: • Copy the .bib file from the paper we’ve generated before to the repository folder. • Be careful, don’t copy the rest of the files. • Commit. • Push.
  42. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Exercise: • Create a new file named <NAME_OF_YOUR_PAPER>.tex • Commit. • Push.
  43. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Exercise: • Using the generated paper copy the content of the paper related to the style (from the first line until “\begin(document)”. • Commit • Push
  44. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Exercise: • Copy the rest of the paper. • Commit • Push
  45. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Exercise: • Change something randomly in the abstract. • Commit • Push
  46. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Let’s review the history
  47. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

  48. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Revert a commit
  49. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

  50. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Remove a commit
  51. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

  52. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Back to the past
  53. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

  54. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Compare different versions
  55. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

  56. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

  57. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    At this point you can already create a repository, version your changes and push them. You can already use Git basic commands to manage your papers or projects!
  58. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Questions?
  59. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Let’s improve the way we evolve a project
  60. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Branches
  61. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    A branch, from the user point of view, is a different project evolution where we can commit and push without modifying the reference branch
  62. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Exercise: • Create a new branch. • Change part of the document style. • Change part of the abstract. • Commit. • Push. • Go back to master.
  63. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Merges
  64. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Merge is a synonym of joining two branches. You can merge a branch into another by just dragging the first one on top of the destination branch.
  65. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    If there are some conflicts, GitKraken will let you know and will show you a tool to fix them.
  66. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Exercise: • From the master branch. • Change the title of the document. • Create a new branch and change the title of the document again. • Merge the new branch into master. • Resolve the conflict and push the changes using GitKraken.
  67. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Collaboration between researchers?
  68. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    GitHub allows you to manage different project collaborators with different roles. Any collaborator could send a “pull request” to the repository asking for a contribution
  69. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

  70. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Exercise: • Find a team-mate. • Invite them to your repository. • From your mate laptop, clone the repository, create a branch, modify something and push your changes. • From your mate GitHub profile create a pull request. • Review it from your GitHub profile and merge it.
  71. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

  72. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

  73. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

  74. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    That’s it, thanks!
  75. Pedro V. Gómez Sánchez - pedro@karumi.com - @pedro_g_s - github.com/pedrovgs

    Questions?