Read the full series on GIT for doctors here

Imagine that you have a patient’s case file in a folder on your computer. The file has many contents such as history sheets, lab reports and discharge summaries.

[Create a folder in your computer with few word files. This folder is your case file.]

Since the case file is precious, you want to take a photocopy before you change/add anything to the file. So you decide to buy a photocopy machine. In ‘GIT’ instead of the photocopy machine you ‘create a repository’

[Click on create repository and choose the folder.]

Now you have to decide what to photocopy. Let us say, you decide to photocopy everything. Deciding what to photocopy is called staging in GIT.

[Select All – and ‘Add to Index’]

Now go ahead and take the photocopy. In GIT it is called Commit

[Click commit]

Congrats.. You have photocopied the contents. Now you can safely add your comments.

[Add some text to any of the files.]

Now you want to photocopy again so that, what you have added is not lost when you make changes again.

[Go back to sourcetree. It will display the changed file. ‘Add to index’ & Commit. You will be asked to add a comment, though it is optional.]

Now you have 2 photocopies.

But wait.. You find out that what you added to the file during your last edit was wrong. How do you remove what you added or go back to a previous stage?

Wait for a week to find out!: Read the full series on GIT for doctors here

Bell Eapen
Follow Me