Slide 1

Slide 1 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Version Control Systems for Researchers Pedro Vicente Gómez Sánchez Senior Software Engineer at Karumi [email protected] @pedro_g_s github.com/pedrovgs

Slide 2

Slide 2 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

Slide 3

Slide 3 text

Pedro V. Gómez Sánchez - [email protected] - @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

Slide 4

Slide 4 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs What’s a version control system?

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

Slide 7

Slide 7 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

Slide 8

Slide 8 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

Slide 9

Slide 9 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs What are we going to do today?

Slide 10

Slide 10 text

Pedro V. Gómez Sánchez - [email protected] - @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.

Slide 11

Slide 11 text

Pedro V. Gómez Sánchez - [email protected] - @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.

Slide 12

Slide 12 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Vocabulary

Slide 13

Slide 13 text

Pedro V. Gómez Sánchez - [email protected] - @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.

Slide 14

Slide 14 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Any doubts?

Slide 15

Slide 15 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Let’s write a paper in 5 seconds!

Slide 16

Slide 16 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs http://thatsmathematics.com/mathgen

Slide 17

Slide 17 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Create a GitHub account

Slide 18

Slide 18 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs https://www.github.com

Slide 19

Slide 19 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs You can get a free account later!

Slide 20

Slide 20 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs https://education.github.com/pack

Slide 21

Slide 21 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Download and Install GitKraken

Slide 22

Slide 22 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs https://www.gitkraken.com

Slide 23

Slide 23 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Create a GitHub repository

Slide 24

Slide 24 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Open GitKraken and initialize a new GitHub repository

Slide 25

Slide 25 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs The result is an empty repository

Slide 26

Slide 26 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Let’s make our first change!

Slide 27

Slide 27 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Using any text editor open the README file inside your repository and add the following content: # Paper 1: ### Author: ### Topic: ### Start date: 1st of March, 2018.

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Let’s create our first commit!

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

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

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs The result is a new comit in the project history

Slide 34

Slide 34 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Push our commits

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

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

Slide 37

Slide 37 text

Pedro V. Gómez Sánchez - [email protected] - @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.

Slide 38

Slide 38 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs This should be the result

Slide 39

Slide 39 text

Pedro V. Gómez Sánchez - [email protected] - @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

Slide 40

Slide 40 text

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

Slide 41

Slide 41 text

Pedro V. Gómez Sánchez - [email protected] - @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.

Slide 42

Slide 42 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Exercise: ● Create a new file named .tex ● Commit. ● Push.

Slide 43

Slide 43 text

Pedro V. Gómez Sánchez - [email protected] - @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

Slide 44

Slide 44 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Exercise: ● Copy the rest of the paper. ● Commit ● Push

Slide 45

Slide 45 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Exercise: ● Change something randomly in the abstract. ● Commit ● Push

Slide 46

Slide 46 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Let’s review the history

Slide 47

Slide 47 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

Slide 48

Slide 48 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Revert a commit

Slide 49

Slide 49 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

Slide 50

Slide 50 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Remove a commit

Slide 51

Slide 51 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

Slide 52

Slide 52 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Back to the past

Slide 53

Slide 53 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

Slide 54

Slide 54 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Compare different versions

Slide 55

Slide 55 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

Slide 56

Slide 56 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

Slide 57

Slide 57 text

Pedro V. Gómez Sánchez - [email protected] - @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!

Slide 58

Slide 58 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Questions?

Slide 59

Slide 59 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Let’s improve the way we evolve a project

Slide 60

Slide 60 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Branches

Slide 61

Slide 61 text

Pedro V. Gómez Sánchez - [email protected] - @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

Slide 62

Slide 62 text

Pedro V. Gómez Sánchez - [email protected] - @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.

Slide 63

Slide 63 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Merges

Slide 64

Slide 64 text

Pedro V. Gómez Sánchez - [email protected] - @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.

Slide 65

Slide 65 text

Pedro V. Gómez Sánchez - [email protected] - @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.

Slide 66

Slide 66 text

Pedro V. Gómez Sánchez - [email protected] - @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.

Slide 67

Slide 67 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Collaboration between researchers?

Slide 68

Slide 68 text

Pedro V. Gómez Sánchez - [email protected] - @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

Slide 69

Slide 69 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

Slide 70

Slide 70 text

Pedro V. Gómez Sánchez - [email protected] - @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.

Slide 71

Slide 71 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

Slide 72

Slide 72 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

Slide 73

Slide 73 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

Slide 74

Slide 74 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs That’s it, thanks!

Slide 75

Slide 75 text

Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs Questions?