 So, next topic is version control, you think of some versions like, it means like Windows XP, Windows Vista, Ubuntu 2, Ubuntu 7, Ubuntu 9, so controlling this version is a version control, so smart, really, so what is a version control? Coming to again the first question, it is also known as revision control, it is like checking the different versions of a document, what is a different version of a document? Sometimes you have created a source file, hello.c and you have modified that source file in due course of time and at the end of week, you have six version of it and you have saved them six different files, ok. You named it, see, Wednesday, see, hello.thursday.c, hello.friday.c, you created six files which contains snapshot of each day because you know that suppose, ok, take a scenario, suppose in the same C file, if you write six consecutive days and you save it and exit it, would you be able to revert to any particular day? You did not get my question, suppose I open a file, I write some content, I close it, next day I open the file, I write some content, append some content, close it, third day I open, fourth, fifth, sixth, at the end of seventh day, can I go back to my first day version? No. No. Absolutely not. If I make seven copies of each day, so can I go to my first day version? So, this is a very big answer of version control. So, you made a versions which you can control, getting the point. But is it a smart way, again I will come back to the thousand scalability, you have thousand files, how you will do, thousand files you open in one day, thousand files you open in next day, fine. So, what is not a version control, first see that, so generally people confuse with version numbers with version control, they are not version control, they are the human readable, they are what you say end user friendly names, like open to 14.4, does it 14.4 is a software version? No. It is an entire version, 14.4 itself does not make any sense, because 14 means 2014 and 0.04 means fourth month that is after, so again they will release 14.10 in which month? October. So, does it make any software versioning? No, it is just a alias of a broad operating system, to give a better name. So, those are not version controls, those are different version names, would never confuse with that. So, suppose this labor office 3.6.2 is not a version control, it is a version name. So, what is version control? If you can revert to 3.6.0, that is a feature of version control. Now, why we need a version control? Of course, I can save multiple copies and we have Google Docs now, you know how many of you use Google Docs? In Google Docs, there is a in the top, you can see version history, so if you click that on the right side pane, it will open a window and it will show all the previous histories, means when you started editing the file. So, whenever you add something important and save it or close the file, it create a version for you. It does not tell end user that it created a version, but it creates a version for you. And with that tool, you can easily browse to and fro from this version to future version to backward version very easily. Future means suppose you are in today's back version, you can come to one day old version, you can come to present day version like that. Why version control? First of all, reversibility, you can reverse to a previous version of a file. Why does matter to you, means why you want a reverse version of a file? Take a best example, okay, almost all software projects under the sun, they are under some version control, some version control. It need not to be get, it need not to be mercurial, it need not to be subversion, some version control has been done, why we need that? Suppose you write a code today, tomorrow you found that there is a mistake in that code, you can't go back and remember what mistake you did and you just edit that back, it's not possible in a huge code base. What you do, you in a command line or in a graphical tool, you tell that okay, go to that version. That is the one use, that is reversibility. Second I think is more useful is collaborative effort. Suppose in a project like Linux kernel, some 3000 people are continuously correlating that project which is such a wonderful end product. So if what would happen if each person is making changes and he is sending the changes using an email to Linux Torvalds who maintains the kernel and then he personally add that code into that file and then compile the kernel to test whether that code actually works. Is it worth, is it a job which you want a person like Linux Torvalds to do to add email patches and copy them to Linux kernel, no. So Linux kernel uses Git version control, so Git is very smart version control. So who developed Git, the same person, Linux Torvalds, why he developed, he developed to maintain Linux kernel source code. So how many lines we have in Linux kernel, more than 5 million lines and it's a huge, huge project, some 10,000 folks and folks means 10,000 versions of Linux kernels are available. Many companies they just copy the Linux kernel, make their own changes, put in their own version. Suppose the Android operating system, they took from original Linux kernel tree, they forked it, they compiled it, they made changes, they optimized it and they released it, their own version of Linux kernel. They again send back the changes to Linux to patch to the main Linux version, Linux kernel tree. So those things happen with the Git version control. So suppose many people can collaboratively work on the same version control, how? Suppose there is a branch for USB devices in Linux kernel and there is a branch, branch means directory, there is a directory for hard disk. Suppose I maintain hard disk and he maintains USB drives and we both are maintaining the same project, Linux kernel, we are both contributing the same project, but not to the same file. So he can also put the changes to the Git repository. I can also put the changes in the Git repository and those two changes can collectively come into some server or cloud based system where Linux can, Linux torbles can pull those changes and it can automatically compile them. That makes the job very, very easy. Those things we will see in today's discussion. So this is the usability of Linux, sorry, version control. There are many version controls, the most modern and most advanced one is Git version control. We will straight away start with the project. So I am using WIM as a text editor. You can use G edit if you want. So I am used to WIM, that is why I am using. I will try to open G edit if you want. So what is the aim of this small project? I want to create a hello world project and I want to put that project into Git version control. So that if I want to change my previous version, I can change. If I want to collaborate people to my hello world project, I can add people and I can make it a collaborative project. So those things we will see now. So before creating any project, of course you will create a directory. I am just copy pasting to save time to make directory hello world where I am creating in my home directory enter. You can see there is a hello world directory here, cd to hello world, now you are in hello world directory. Next session which we are going to dedicate is the documentation and that is as important as Git and we will see small portion of documentation in this step now. So it is always advised to write document before you write code. It is crazy right? Means I have not written a single line of code and you asked me to write documentation for that. Yes, it is important why you are maintaining the code, it is not that everyone else around you know about what you are doing and you are not supposed to do and answer everyone's question that ok we are doing this, this, this so it is better to write a document and share with the world to tell them ok what this project will do in future. It is like a declaration ok I am doing this, this, this so it is need not to be perfect documentation see the document become perfect at the end of the project means when you finish the project of course you will add to that readme file or that documentation file but at the beginning you should at least mention the goals of the project what you are going to do, what technology you are going to do, what all you thought about it something meaningful. So before creating any project what we will do we will create a documentation. So I am using WIM as my text editor so I will create a readme.txt file or readme.rst file rst is a restructured text which we will see in the next session. So I am just simply I am going to copy paste this content this ifor insert mode insert mode means I can edit now. So it says what is this project for this project will create a binary executable file which when invoke print hello world on the terminal ok the formatting is bad because I resize the window what prerequisites are needed GCC GNU compile a collection that is required how to use GCC hello world dot c iPhone o hello hello is the binary and dot slash hello will execute the file. So do you think this is good to start with do you agree yes of course yes means this simple hello world that is why you know that oh this fellow is doing this simple thing but if you start a big project and your mentor your your faculty your boss does not know what you are doing what you should do is create a hello world dot c hello world dot sorry readme.txt file and you should mention what I am doing what I will do I will exit ls readme.rst ok to give you the sense what I will do I accidentally made readme go away ok something like this I saved and exit now I forgot in which line I modified the readme file ok without version control what I will do I will open again this file I will search for the content where I have written go away not in one file remember may be ten files or hundred files then manually I will change it to correct one save and exit now I will I am in the my desired version but this is very very crucial thing means if you are working on a company on a code base your boss does not expect you to do this with manual recall of your action so you need a version control for this to add this to a version control what we will do we will use git version control and to start git we will use git init this is the first command to start a repository and this command you run only once git init means git initialize so this command will initialize a empty git repository in which directory hello world directory so only your hello world directory is under git supervision now so git will supervise your directory for any changes fine it says created an empty repository in hello world dot git and if you see there is no dot git directory because dot any dot file name is a hidden file name so ls dot ls or hyphen l dot git it shows many files and directories and you should not remove this because this is all repository files you should not remove this control to clear the screen now you have created read me dot file but git doesn't know which files it should monitor by default is another command git status this tells that what all there in this directory it says on master branch there is no initial commit there are untracked files in red red color it is written read me dot rst so git finds that there are files in this directory but they are untracked they are not under git version control they are not being tracked so how to track them git add read me dot rst see I am using tab completion now you run git status what it says now changes to be committed it doesn't say untracked files anymore because it says there is a new file read me dot rst but do you want to commit whatever changes it has and now the question comes what is coming why I should bother about commit commit means see it it doesn't make sense that if you make a small comma or if you make a small typo fix fixing in your read me dot rst and you just say that okay this is my version one of the version suppose this read me dot txt read me dot rst is version 1.0 you just fixed a semicolon in this would you want to make it version 1.1 is it smart of course not see there is a universally accepted nomenclature for versioning it's undocumented rather what it says it there must be some significant change in the version then you should be give a point version suppose 1.1 1.1 means there is a significant change in one that leads to 1.1 if the changes are even more significant you can even jump from 1 to 2 directly if the changes are too small you can say 1.0.1 if you think that's why the changes are even smaller 1.0.0.1 okay and to quantify that what changes comes in which category that's again depends on the programmer the programmer thinks okay whatever if function I change whatever functions I added they change everything in the code he will say no this is a major version I will name it as 1.1 you're getting but with the comma or semicolon never make it a version 1.0.0.1 also means it's not a good practice and don't do 1.0.0.1 just give a point releases like 1.1 1.2 like that this is the first time we are committing so the first file we know that whatever we have copy pasted in the read me dot txt they contain relevant information we read through that and we know that it's correct I want to save that version for future reference I want to come back that version if something goes wrong in the future I will do git commit it's a nano text editor it gives me a prompt you can open you can just change it in your git config file and you can open any edit editor the graphical tools for git also but it's always advised to use command line you can add a git version control tool in your eclipse you can add in code code blocks any ID which you work so this is the first commit and with every commit there should be a commit message why commit message is important very good in future you're human right you mean forget what was version 1.0 what was the first commit you won't remember then you should write in some text form that okay if you read that text or keywords you will easily understand okay over this means this version fine I want to revert to this version so I will say initial commit with what was there compile instruction and execute okay execute instruction or whatever control o to write control x to exit done you can get commit hyphen m hyphen m flag means instead of opening this nano text editor you can simply type your message on command line itself so whatever I have written in the text editor I could have done using a command line that will save my time and resources because I won't be opening a text editor by them so I can write something here but I already did a commit so I won't do it so now again I will run git status so git status is the command which you run time and again to know the status of the repository on master branch nothing to commit because whatever file you had you have already committed and working the actor is clean now if I open readme.txt and I add I add this text okay save and exit now I do git status now it doesn't say that nothing to commit or nothing modified everything is clean it says something modification have been done to your readme file do you want to commit see changes not staged for commit these things so how do you change means how do you add this to repository now you can again do git add readme.txt so it will again add this readme.txt but you can argue that I already added git readme.txt by to again add by to again use read add command so what you can do is you can simply directly do commit git commit-am so am a means include the files which you have modified and m means m means command line option for commit message now I will give a commit message added test project details done so how many commits I made two commits though they are very small just for demo purpose I am making I made two commits suppose you have ten files and you have modified five files and you don't want to use you don't want to include all the modified files and commit my impossible case right you have modified five files but you want to make commit to only two files what you will do then you can in that case you will do git add those file names 1.txt or 2.txt then you commit then you make a separate commit for other three files see why we are committing we are committing because we are creating snapshots we are creating a virtual file snaps of entire directory so that in from future when we come to that snapshot we we get the usable form usable directory correct so if you think I modified five files and two files modification they are of separate domain the other three files they are of separate domain if I make two commits for these five files it makes sense I can revert back to some version I can revert back to some other version are you getting my point hard to visualize we will see in git only so how to view what commits you have git log will tell you what all commits you made so it shows what commits you made this is your first commit if you remember initial commit with compile instruction and execute and this is your second commit added text project details ok I can I am in the latest version now I can move back to previous version without losing the information of present version that means I can again come back to this version how to do that git check out and this commit version them so only seven characters minimum seven characters are required I just copy the surface seven pasted here it spits out some information no problem it says your head is now at this actually I moved too fast because this concept you should learn little bit later so what I did is I just moved to my previous commit so now if I view my readme.txt that text line is not there anymore you see no now I realize that ok I think my the previous version the latest version is the best version I can move back to my latest version as well how to do that git check out and you can do git log now because ok git log hyphen hyphen all will show you all the logs this is my latest commit so I mean the head is now at this added test project details verify let's verify using head command head readme.rst only four commands git init to initialize the repository git add to add files git status to know the status of the repository status is not mandatory though and git commit to commit your changes make your snapshots you can simply browse among these files suppose you remove readme.rst is it possible to get back your file we will see this later already finished these things so these three are the only keywords which are required for entire git so entire git can be summarized for this basic thing which is git init git add files and git commit that's all and whatever extra features are there they are just what you say feathers means you may use them you may not but these three are poor things if you know how to manage with these three you are good to go that's it and we expect that you make git repository for whatever project you are assigned to and you should maintain decent commits you should commit regularly you should commit wisely you can add you should add good commit message as well now more practical use of git now whatever changes I made are they on some server no they are in my local directory they are in my hello world directory who else knows about it outside this room no one right now I think that okay I am doing something good and I have a friend in my US and I want to add him as a collaborator and we both will work on this project we have a startup and let's let's do it means I will do changes in hello world dot see he will do changes in some other file and we will make a program we make a software in someone we call like that we have we exchanged email we chat we made chats and we decided to come up with this project so what I will do I will copy paste the entire directory and I will email him how many times you will do that if the project grows it's not wise right means you have to again he wait for his changes means it's whole it's completely different scenario with email exchange and doing a git repository maintaining a git repository and what would be a smarter way smarter way would be put your git repository in some server on some cloud based server or any server okay on which you both have access you can you can start your own server suppose you bought some domain from maybe some service provider you purchase over you install git server edition there and you told your friend your collaborator in US okay see this is the IP address and I will push to that server you also push to that server and we will see the changes in the server but again on a server you have to SSH SSH means one has to log into that server and physically has to LS and see the files your friend also collaborator also as well me also again it's not wise so we want some web application which should manage all of this what do you mean my web application there should be some program running on a web server which should manage my git repositories very efficiently so it should show me the commit messages it should show me who has committed recently it should it should show me the difference also what is the difference between this commit and that come that you can do locally as well but you can see there who else can see that your collaborator can see that and rest of the world can see that suppose I am a sponsor I do sponsor projects I will see okay this project has a lot of potential let me finance it I will contract the collaborators I will make a deal and may this thing becomes the next Google this hello world program so those are the benefits with having it on a server easy to share people can report bugs okay suppose your program have bugs people can download check and verify and send you the bug reports easy to add remove contributor suppose a contributor has resigned or he decided not to contribute anymore you can just remove him from your dashboard okay that easy so there are many websites which provide that web interface so GitHub is the very popular website so how many of you heard of GitHub so any other website which does the same GitHub kind of Bitbucket very good any anything else and there are many such thing okay there are many websites nowadays but Git is most widely used your Linux kernel is maintained on Git and Git provides a very decent interface for a graphical interface for all operating systems and very good command line interface for all operating systems so this is a small visual diagram so these are remote repository which is your server cloud means a cloud server for example these are local repository means which file .git file this is your local repository means your .git file because your .git sorry .git directly the .git directly contains all the snapshot information it stores them okay what do you think that .git directly contained does it contain two versions of readme.file it it stores only the changes it doesn't stores two versions separate versions of you committed twice right it doesn't store two commit two readme.txt file it just stores one readme.txt file and the changes in the second one and it put it here third readme.txt version some changes with respect to one with respect to two it will put it here so it will be it will have changes but they are not completely how what you say overwritten means it complete it will only store the unique elements and does it store in human readable form plain text files no it compress the plain text file it it makes a hash of it it makes a compressed what I say hash version of your entire repository and then stores so that no one can read other than you so local repository means your .git directly these files are your local repository cache cache means what get status this is your cache means suppose I do again some changes in readme.txt something went correct so this is a cache so there is a modification which has not been in the repository yet this is cache okay working directory you understand working directory this is your present working directory so what is head if you do git log hyphen hyphen all it shows all the commits and the latest commit is your head by default the latest commit by default is the head of the repository head means you can understand means the top most thing okay if you have 10 commits the top most commit will be your head of the commit head and suppose you have multiple branches so in git you can create multiple branches why you need multiple branches suppose I am working on a feature in hello hello world dot repository which I don't want to merge with the master branch so the default branch is master branch so whatever you are seeing here we have not created any branch yet right we have just done get in it get add and get commit we haven't created anything else you can create git branch and a new branch and in that new branch what you can do you can do some temporary modification you can test it you don't want to mess up your master branch you want to just make some small small changes and you can want to see that okay this is good then you will merge it with master branch in that case your head could be in your master branch as well suppose you are doing something you committed in the temporary branch so your head now points to temporary branch not to the master branch okay as I said those are advanced things which you may or may not be needed for this session and similarly what else check out head okay head you just understood pull so git before that we should understand what is git pull and git push we will see that what I will do is I will create a repository now on github.com and I will push my changes to github.com so this is my github account okay what I will do is I will just create a new branch here sorry new repository here how to create a new repository just go to create new and click on new repository and you can name your repository here so what is the name of our repository hello world you remember right hello world description may or may not be used because this is used for just SEO purpose so that git will help you index your web page in google easily create repository slow usually github is most fastest and reliable meanwhile we can see similarly I have created here a new page with two option will be displayed see why the two options I hope the page has loaded 0.02 percent of time which they claim that the server might go down and this is it you will be provided two options so git github.com will tell you if you have a repository already created you just use these instructions if you want to create a fresh repository in your local directory use these instructions it will give you two options okay so we will use the second option because we have already chosen the repository because we have already created a repository we just want to push it to github that's it so create a new repository on command line is the first option so this github website doesn't know know whether I have created a already created a website repository or not so if I not created then it says created touch means create a readme.file git init git add readme.file git commit hyphen m first commit see these things we have done already git remote add origin git at the rate github.com this is this and git push hyphen u origin master these two commands we have entered and these two commands are related to github what these commands are it says git remote add remote add means these are remote website right so if I add this url so whenever I do git push so git push will know where to push the changes so where it will push it will push to git at there at github.com so you can't put naik slash hello world dot git so it will push to this repository so suppose pushing an exact existing repository from command line so I will use this now and within iit you may face issues with git repository sorry means git protocol so what you can do is you can do http okay so what I have done instead of ssh I just made http now the command has changed here so git remote add I just copy it I will paste it here done next what it asks you to say git push hyphen u origin master and this you have to do only once it's this entire thing from next time onwards if you do git push it would understand where to push the first time you have to tell git hub that you want to push to origin origin means the first starting point and master is a master branch git push origin master think git hyphen v is git verbose with man git I want to search the option which will print the screen print the info on screen because it is trying to do something in the background which I can't see if it is trying to connect to some https secure server something I can't see so I want a verbose output okay now it is telling me the different push default is unset okay so let me git push hyphen hyphen verbose where hyphen u origin master maybe this is a positional argument okay fine I think some issue with SSL certificate now anyway if you upload to server you can view the files here and what next I will do is I will add a collaborator so if you push it it will show something like this git push hyphen u origin master it will ask for your username password it will compress the file it will push it and it will say it created a new branch I told you the new branch is by default is master to create a master branch and push it there now if I want to add collaborators so I will go to my hello world repositories and go to my settings and in my settings pane I will have a collaborators option that I can show you as this repository has not been pushed yet okay there is some proxy issue now I know what issues I have what I will do is export http underscore proxy is equal to null and http is also null how to verify whether dollar http underscore proxy so these are shell variables so it does not show anything that means there is no proxy set now http is also empty if I do w get google.com it is working fine and if I try to send now git push hyphen u origin master verbose so you can add a collaborator for this workshop I created a dummy account with aakash mh rd and you can just add him here aakash mh rd so he will become collaborator to this project what he can do is get cloned from the collaborator side so let us assume this is your collaborator window I have already set it up so I created an account in my I created a user aakash in my machine so user aakash will have all different things he does not know what git repository I have where I have pushed etc so who am I I am aakash fine now aakash mh rd or aakash guy is my collaborator what he will do he will run this command git clone http github.com so if my push have been successful this fellow could have downloaded my entire repository so how he will download he will just do copy because I have already told him that I will do this it won't work now because the changes have not been pushed to the server because of some error so when he clones the repository he gets the exact copy of the entire repository so whatever I made the changes all those two commits he will get everything and as I added him collaborator as collaborator on this github.com what privileges he will have he can push the changes also you can limit the privileges so by default the default privileges are he can push the changes means to that readme.file he can make some changes he can push those changes to server and do I get notified when he push the changes you can enable email notification that okay whenever someone push to the server send me an email one way the other and best way is don't rely on emails so whenever someone push the changes you you don't assume that none of them have made changes to your repository so at your end whenever you make changes or you start making changes what you do your end means on your terminal so when you do git pull what it will do it will go to github.com it will fetch the changes if any to your local repository suppose akash has made some changes to readme.txt or he or she might have added some new file when you do git pull those new files will update in your home repository your own repository okay then you make changes then you again push it okay where to github.com now what this akash mhrd will if modifying something he will initially do git pull pull the changes what you send then he will again make the changes in that he will push so it's a intermediate step where both the collaborators are working so is it limited to only two collaborators not at all n number of collaborators can work but is it advised to work all the collaborators on a single file not at all because when you try to do git pull on the same file the automatic merging of the file will fail because git doesn't know which file means git knows which file this akash fellow has removed but it doesn't suppose that file you have also modified in your local repository so git don't want to remove your changes your local changes so what it will do it will prompt your window and it will tell see whatever I downloaded is the changes in the same file do you want me to continue if you continue you will lose your local changes you understand then it will give you an option no you now merge it manually so it will give you a file it will show some arrows that okay this is added by akash this is added by you this is added by akash it's lot of manual job then so it is not advisable in your project as well to add collaborators to work on same file what you should do you should it's always a good practice to have different files for different projects suppose in my project one file does a socket creation in my http other file creates a visual window a third file creates a user login so don't add all these files in a single file then you will lose the usefulness of the git what you do create three separate files add three people to work on each file all of them will send to github.com you will pull push whatever you do that won't affect your auto merging you are getting my point so this can be shown in a visual way also so the same thing if you can visualize here so what I am doing is I created the project I created I created a first file readme.rst so these are the steps step one okay I push to github then step two git clone who did the git clone akash added did the git clone so we both now have the same copies well now he added hello world underscore dot c to it done he didn't make any change in readme.rst or he might be he added a new file he pushed it to github I don't know I didn't subscribe to emails etc what I will what I would have been done I should have been done is git pull but I but I didn't do do that I also modified unknowingly that someone has modified my friend has modified and he pushed also the server I tried to I modified readme.rst I tried to push github so this red mark shows that my push will fail and how it will look it will look like this what it says it says rejected okay fail to push some reference to github.com so you can't hello world this why updates were rejected because the tip of your current branch is behind its remote counterpart tip of the current branch technically tip of the current branch is your latest commit your latest commit is behind what is there in the server because server there is one more commit added by akash mhd who has added this this file see if someone is adding a file and pushing it to server he can't push it without committing it correct one has to commit it he has committed readme.rst plus hello world dot c he pushed it so this is commit number three so unless this commit number three I have in my local repository I can't push it to the server both heads my local repository head and his head his local repository head should be same all the time and the github should also have the same copy then you can say all are same but now github contains the modified version he contains the modified version I doesn't contain the modified version how many commits I have I have two commits how many commits this fellow has three how many commits in github three because he has already pushed see the step three so step four will fail because I don't have the latest version of the repository what I have to do I have to do git pull then I will get the latest version now all three of us will have three commits all are latest version then I modify readme.rst changes I will commit then I will push is this diagram clear any questions here yeah we have seen this git pull mean pull from the see git clone and git pull are different git clone will what we will do git clone git clone will clone the entire repository you need to do git clone only once collaborator what he has done is he has done git clone my repository only once to get my entire repository present working repository from github does he every time need to do git clone no git pull will sufficient to do the changes what git pull do git pull will fetch the changes only I will also do git pull my contributor will also do git pull so what we are doing here I am doing git pull so git pull is a bigger picture git pull has two internal commands one is git fetch means fetch the changes from internet and git merge you can run these commands individually as well git merge git merge means it will automatically merge the files that's all about how to manage git with multiple collaborators and git checkout we have already seen how to check out to a you can do git reset hyphen hyphen hard to this is is also equivalent command so if in some cases if you git checkout give some error or you messed up something if you want if you are in urgency you want to just forget about everything and just want to move to some version of your file just do git reset hyphen hyphen hard to that commit number what is this commit number this is this git these are the commit numbers of course we are not human readable form your commit messages are human readable but you don't remember these things what you do you just copy them and you paste in the command like git checkout and this this thing or git hyphen hyphen sorry git reset hyphen hyphen hard and that version number both are equivalent but git reset hard will ignore any local changes and it will forcibly move to that particular version which is not advised to do correct yes you are talking in the sense of suppose you have two collaborators in that case right single only okay okay okay you created a new branch very nice question so what he meant is suppose I have these two logs I went to this one okay I went to this one from this one I made some changes here okay I it's like going back in time and changing something back in time and then I save the changes I make a commit then I want to come here is it possible that's what you are asking yes it's possible when you make changes to this version it will again of course you have to make a commit and that commit will appear somewhere here that's the latest commit new commit and that commit is is taken from this commit you are getting the point in between commits they will be intact no it's not a new part unless you create unless you explicitly create a new branch there won't be any new branch suppose you you went back to suppose these are let me let me go to a directory which contains lot of branch I will give you example from here itself cd documents sorry cd hello world git log between branches will not be launched because you have come to this branch you made changes here whatever commit you do it will come to the latest head means whatever version you are working that will be the top most version this that will be the latest version so the head will point to the top of the repository top of the commit so all those intermediate in between commits they are in between and you are working here now but you have come from here not from in between you have come from bottom of the commit so you made some changes here now your commit becomes this one the latest one if you make some changes here again then you commit now you if you want to come back to these intermediate commits you can come to this work also here you made some changes you committed back and that whatever you commit it will come to top only how it will two parts and the all are in the single branch the forget about the branch the branch you have not created any branch the only one thing is you have different commits let us talk about commits whatever commit you create it just come up to the top branches if you have multiple branches then this concept might be a bit confusing but still whatever you work that is the latest one that is the top most head so let us move to our third topic which is documentation so whatever documentation you have seen so far since morning they all have been created by myself and they are all been very easy to create I have not written a single HTML line I have not written any I have not used any integrated development environment I have not used any special languages for this what I used I have used markup language rst rst is restructured text which helps you to create a simple HTML pages and PDF pages I have created PDF version also so what you can do is let me go to documents go no docs cd version control evince or I will do make lactic pdf it is already there evince is a command line tool actually evince is a pdf here it is not a command line tool and I have a pdf file here somewhere can you see if not what I will do make lactic pdf we will see what all it does do not worry I will explain this I just want to show the power of rst which you can evince lactic so it created a pdf version for the document so whatever you have seen here it is a complete html page right you have a sidebar also you can simply move between the topics they are our hashtag you can just share this version with your friend etc etc so they are website ready means once you write the simple rst file compile them for html compile them for pdf just share them that is it it is done and as I already mentioned that how documentation is important so your rest of the period in your iit and after iit also assume you will keep a good amount of time separately for documentation because documentation is key for success you you won't find a single project in internet which has bad documentation but it is successful any good project you take any open source project anything they have very good manuals they have very good videos tutorials they have animations to tell user that this is this has some support this has some potential we help you we are here to help they have forums they have chat rooms they have everything why they want to engage people to use their own software if you write no documentation at all and your software is and is next to anything else means it's a best search engine you made no use no one knows if someone knows also he can't he can't share with anyone else because he has to explain what it does he can't share your documentation so if you want your project to be successful first thing you should do is start writing a good document so i wrote only single rht file and it automatically created this documentation for me i hope you like this document and it's very simple to create it's very these are the themes so you can easily download many themes from internet so these are the themes which we will see now so i created pdf also the same one so this gives you the freedom you write in a single page and you can create everything else so let's come back to documentation how to write a documentation you can use your microsoft word or open office or liver office google docs whatever you want you can use but if you use microsoft word can you share can you make an html page with that can you readily create pdf with that i think i don't know i don't use microsoft word so i don't know okay but that feature has been added in liver office way back of course the office tool using office as your documentation tool is not a smart choice using latik have you heard of latik it's a type setting markup language not language markup and it gives you a lot of flexibility in terms of creating document but it requires some patience because if you get stuck in some place if you're novice and you might be in trouble some point wiki text how many of you contributed to wiki pedia one very good very nice so wiki has its own markup language so if you try to edit some page in wiki or try to create your own page you have to follow their own markup language which is also a bit annoying means i don't feel it very user friendly there comes the restructured text which we followed in this session and there is similar one markdown markdown is also very good markup language is github by default supports github supports markdown and rst and both of them are equally good but rst you can do lot more things than markdown so what is rxt reached it's a open source markup tool very efficient well documented used by many can be used in any platform windows mac linux anywhere why to use to make manuals documents how many of you have used python programming language i'm surprised very good so python you have you can actually in python you can comment the blocks and those comment blocks can be exported to your documentation you understand that so if you write some comment block and there are some utilities which you run on the your python script it will extract those common block and it will make a beautiful documentation with that you can use such kind of documentation as well but what i feel is most more important is how well you write the document it's not what which platform you are using you can use microsoft word you can use google docs whatever but the content should be very relevant and of high quality that that's all matter at the end of the day our read me dot rst file we can view so this is a rst text so by pasting to this thing i messed up the formatting formatting is very important see how the color is changing if the formatting comes live when i do read me and equal to equal to underline this converts it into header text head of wind means h1 tag for html this means this is the title of the document how do you know if i do there is a command rst to pdf there is a command you can install it from your ubuntu by apt-get install rst to pdf read me dot rst done ls read me dot pdf is created evince is a command line tool yes but you see there is something loss in the formatting here i wanted gcc hello world dot c in this box type of structure but it didn't came here properly that means there is something wrong in my formatting i just told you this formatting is very sensitive i again open it let's let's go through the document first so if you write something in a plain text it will appear in plain text if you leave a line the final product will also leave a line suppose i write here that means in my pdf there will be a line spacing and there will be a new line if i write a topic with hyphens underline hyphens what it will do it is a subtopic what do you mean by subtopic if you see this pdf our version control pdf if i go to my content so this is my header so this is equivalent to this not a version control this is equivalent to this and if you see there are there are things in which we have third tag also means there are menu under the menu so if you go and make instead of dash you make caps like this so this will become a menu entry under what what is the project for so if i compile now i open a new tab i will do rht to pdf why i am open a new tab i don't want to lose my changes there done the prerequisites because it's a pdf file i think if i convert it to html you will get a better result i can't show you here that it is under the same tree anyway let's come to our document this star will become a bullet should have become a bullet yes this will become a bullet in html this will also become a bullet here so these are bullet points when you give a star it will become a bullet and when you give a sentence followed with double colon clear these lines and four spaces here so this will become a block what kind of block see i have to do two commands back to back so it's not convenient for me to again do up arrow and perform rht to pdf what i will do i will say do rht to pdf then do evince read me dot pdf and that means if the first command get executed successfully then only do the second command this will compile and spit now you see there is a square box with hello world this thing so what is this square box come from with this two colon colon so the end of the text if you write this colon colon and give a line space and leave four spaces so this text will automatically convert to your highlighted box and in your html how it will look something like this html interface the sphinx interface it has a nice option also to show source so whatever document you are viewing you can just simply open a fuse click source so whatever i have written for this basic linux command which we have seen earlier this was my main header introduction to linux double star means make it bold let me open this in a new tab so that we can view both of them side by side so this basic linux command line application is this one see there is nothing to learn with this just do practice just have a manual open the side of your alt tab see the syntax copy paste that is it introduction to guno is my first topic yes this guno is in bold how to make it bold star star make it bold and there is a link there is a note here when i click it here it will go to somewhere else where at this point footer it says go to wikipedia and read gnu so how to add these nodes after existence so after existence just write this within bracket hash and underscore so this is the first occurrence of hash underscore so this will map to first occurrence of whatever you write here is it clear so the second occurrence of hash underscore is mapped to this link third occurrence is mapped to this link so we have mentioned three times within that page so first one is here okay this where is the second one second one is somewhere here kernel okay and the third one is here so that simple hash dot name hash dot line what is what does it do is hash automatically enumerates your number enumerates your text so hash means one it automatically adds so you do not have to number or you do not have to remember so this tilde tilde means it is a subtopic of this so this linux kernel is the subtopic of introduction to guno you can see figure dot dot space figure is a directive which is known by rst so if you add this command given by colon colon so where my figures are where is my images it is in data directory see I have not I have not given an entire path of the directory it is a relative path so from present working directory go to data directory logos hyphen distros dot jpeg with this hundred percent use entire width of the document and logos of some GNU distribution this is your name of the image how does it look it look like this linux logo come down this is another image linux min dot jpg width hundred linux min desktop fine that is all I think that is all about it means it it is that simple so what effort I made I wrote it in a plain text with some markups whatever markups I needed and what I did I just compiled it for pdf if I want rst to pdf for html I have a separate tool which is more efficient there is a tool rst to html as well but I did not use that tool I used a tool known as Sphinx sphinx we will see how to use Sphinx to make this beautiful html pages so let us come to Sphinx directory okay let me create a Sphinx directory here we will follow our documentation so these things we have already covered converting rst to sphinx let me close the sidebar so how to install Sphinx would I have to install python Sphinx so Sphinx is written in python how to start just type quick sphinx quick start why we are using Sphinx Sphinx is another way to create pdf and html and epub and man pages you can create many type of things with Sphinx okay by writing one single file in rst you just have learned how easy to write in rst with that single file what you can do you can create around six to seven type of documents that is it so Sphinx quick start is a wizard to tell you what to do with this root path of the document if you hit enter it will take the dot dot means present working directory dot dot means previous directory so hit enter to take the default one separate source at build directories yes or no this n means the default option is no if I hit enter no prefix template start with underscore project name so this I have to give so let me give Srikant enter author name Srikant project version okay let me give 1.0 release this point release I will say beta source file suffix dot rst are you working with rst or md files you have to mention here so default is rst so I will say rst name your master document default is index let it be index do you want to use epub builder you understand what is epub right epub is a ebook reader so the document which I made that can be without any effort converted to epub also so on your mobile phones you can easily read this document default is no let it be no automatically insert doc strings from modules doc strings are the things which I talked about the python in in between codings means python commands okay in any source code not in python in any source file if you write a command block and you want those command blocks to be included in your documentation you can use doc strings automatically text code snippets in doc string world no so what I am doing is I am just using the default configuration file what I did I just invoked which command swings quick start all you need to do is swings quick start I entered price project name my name project version and project release four entries I made other things are default only done now what is there in my present working directory these many things so how to start that is a make file you understand make file so make files are the scripts which which which when invoked will do set of commands automatically so if you open a make file you see there are some scripts already written to do a particular job this has been automatically created by your pythons things so what what I want to show is make is a command utility you install by app get install make and this make utility can read this make files understand this make files so make tab tab will show me what all options are available with this present working directories make file this make tab tab read the entries in the make file and it showed me on the terminal so it says that you can make changes you can make clean make clean means it will remove all the build directories make html make development help dev help is making a help pages the graphical help pages so your sphinx python sphinx can do lot more things so all the things they are listed here docs test epub create a help text create an html page create an html help create a json file create a latek file so this rst file can be converted into latek also from there you can do latek pdf latek and so on it can create a qt help qt is a development environment qt libraries are available for various platforms xml file you can create a plain text file so we are interested in html what i created in the morning and where is the other one latek pdf so i have created these two only how to create pdf file other than using sphinx using rst to pdf there are some other utilities as well in open source you have limitless projects which does the same work but these are the top projects which i which i am mentioning here and the best one is python sphinx so it does everything which is possible with rst file so just imagine you just wrote a simple text file in your text writer microsoft word wherever copy paste it in your present working directory run the make html it will create a beautiful html page make latek pdf it will create a beautiful pdf file with all formatting css everything preloaded if you want epub it will create epub if you want plain text whatever you want it will create so i will create make html will it work straight away no it didn't ls underscore build the build is a directory which is created now what it contains it contains html it contains index dot html it created something let me open it with firefox actually it didn't create anything from my content because i had readme.rst file in my home directory right but i didn't include it at readme.rst file in that project it's not like git add project but you have to tell sphinx that what all files you want to include i didn't tell anything i just started sphinx quick start and said some uh uh wizard questions that's it but this is the uh what i said default html page which sphinx creates for you for the documentation so welcome to srekan documentation there is nothing here so what i will do is i will add something to this what i can add i will add index.rst there is the index.rst is created by sphinx here contents you can change this title also what i want to say here is readme because we are we have added readme here and what is the name of my readme file dot rst is not required just readme is enough okay save and exit now run make html i hope this time it took yes done see the plain text file now is converted to this and my this thing appeared in a box nicely formatted with css default css etc but these are default with sphinx create and what we have seen in the morning is one of the theme there are many such themes for sphinx documentation so i like this theme so i included this theme you can include anything you can create your own theme getting the point that's all about this session thank you