Presentation is loading. Please wait.

Presentation is loading. Please wait.

L – Modeling and Simulating Social Systems with MATLAB

Similar presentations


Presentation on theme: "L – Modeling and Simulating Social Systems with MATLAB"— Presentation transcript:

1 851-0585-04L – Modeling and Simulating Social Systems with MATLAB
L – Modeling and Simulating Social Systems with MATLAB Lecture 3 – Introducing GIT Karsten Donnay and Stefano Balietti Chair of Sociology, in particular of Modeling and Simulation © ETH Zürich | © ETH Zürich |

2 Revision Control: What?
Revision Control: What? Revision (or version) control systems are software aimed at managing changes to documents (text files). Famous version control software: TRADITIONAL: CVS, SVN; MODERN: Bazaar, Mercurial, GIT. Throughtout the whole course GIT will be: your preciuous ally in developing your project code. the default tool for the final submission of all the project files.

3 Revision Control: Why? Because human brain was not initially created for programming...

4 Revision Control: Why? Team Work Betty Karl Kornelius

5 How to efficiently integrate our code ???
Revision Control: Why? Team Work How to efficiently integrate our code ??? Betty Karl Kornelius

6 How to efficiently integrate our code ???
Revision Control: Why? Team Work How to efficiently integrate our code ??? GIT provides automatic tools to visualize diff., merging code, and track the history of the project!! Betty Karl Kornelius

7 Revision Control: Why? Time Machine 1 3 4 6 Deadline for submission
Revision Control: Why? Time Machine Deadline for submission Weeks 1 3 4 6 coding starts… Initial agent loop. Super-cool plot added. Simulation on network

8 Revision Control: Why? Time Machine 1 3 4 6 What to do now? breaks
Revision Control: Why? Time Machine Deadline for submission Weeks 1 3 4 6 coding starts… Initial agent loop. Super-cool plot added. Simulation on network What to do now? breaks

9 Revision Control: Why? Time Machine 1 3 4 6 What to do now? breaks
Revision Control: Why? Time Machine Deadline for submission Weeks 1 3 4 6 coding starts… Initial agent loop. Super-cool plot added. Simulation on network What to do now? breaks GIT can save periodic snapshots of your code (commits) All past commits are stored and can be easily reintegrated.

10 Revision Control: Why? Time Machine 1 3 4 6 What to do now? breaks
Revision Control: Why? Time Machine Recover changes Deadline for submission Weeks 1 3 4 6 Super-cool plot is back coding starts… Initial agent loop. Super-cool plot added. Super-cool plot added. Simulation on network What to do now? breaks GIT can save periodic snapshots of your code (commits) All past commits are stored and can be easily reintegrated.

11 Let’s Git Started GIT is free, open source software. Works from GUI and from terminal (command-line) On the Lab machines you can launch it with: GIT Bash (Windows) git (Linux – command line only)

12 Let’s Git Started GIT is free, open source software. Works from GUI and from terminal (command-line) On the Lab machines you can launch it with: GIT Bash (Windows) git (Linux – command line only) Change directory: cd List files in a directory: ls Create a new directory: mkdir Terminal commands to remember

13 Let’s Git Started Open a terminal or GIT Bash.
Let’s Git Started Open a terminal or GIT Bash. Set the language to English (if you like) Browse to the directory with the exercise files. Initialize your first GIT repository export LANG=en_us cd /path/to/your/files/ git init

14 Let’s Git Started Introduce yourself to GIT
Let’s Git Started Introduce yourself to GIT Tell GIT which files you would like to track for changes. git config --global user.name "Your Name" git config --global user. git add file1 file2 git add .

15 Let’s Git Started Do your first commit
Let’s Git Started Do your first commit Do any modification to the content of the files. Get the update of the status of the repository git commit –m “This is my first commit” git status

16 Let’s Git Started Visualize the differences in the terminal.
Let’s Git Started Visualize the differences in the terminal. Visualize the differences in a GUI client Tell GIT to accept the changes and commit. git diff gitk ; git gui ; gitx (for MAC) git add . ; git commit –m “Some changes”

17 Some hints how to use GIT for your code
Some hints how to use GIT for your code Commit often. Use appropriate commit messages. Do not rename the file names manually (use git mv) New files are not automatically indexed, must be added. Careful with git add . Rather choose the files: git add file1 Write a .gitignore file or use git ignore for files that you never want to commit (e.g. big datasets)

18 References Git Home Page: http://git-scm.com/
References Git Home Page: Git General Info: Github Home Page: GitX (a gui for OS X): Git in 5 minutes: Git Book


Download ppt "L – Modeling and Simulating Social Systems with MATLAB"

Similar presentations


Ads by Google