2009-06-30_mbuf_git.log

mbuf--------- git session begins ----------15:30
--> vivek (n=vivek@117.201.98.228) has joined #dgplug15:30
mbufroll call! please tell your name15:30
kishanKishan Goyal15:30
vivekvivek15:30
rtnproRatnadeep Debnath15:30
--> sunny_slls (n=sunny@125.20.11.34) has joined #dgplug15:30
kopeckskoyel banerjee15:31
parthachowdhury partha chowdhury15:31
hermesAbhishek Sharma15:31
MeejanMeejanur Rahaman15:31
sunny_sllsSunny Sharma15:31
abhishekgAbhishek Gupta15:31
mbufok, thanks! here after if you need to talk you need to type '!';15:32
hermescd ..15:32
mageshcsemagesh15:32
spechardStéphane Péchard15:32
mbufIf you haven't downloaded the .pdf yet, please download the presentation from http://shakthimaan.com/downloads/glv/presentations/di-git-ally-managing-love-letters.pdf15:32
sunny_sllshi spechard15:33
mbufsunny_slls: don't interpret!15:33
sunny_sllsmbuf, sorry15:33
mbuftoday session is an introduction on using git -- a decentralized source control management tool;15:33
--> zer0c00l_ (n=zer0c00l@117.199.137.176) has joined #dgplug15:34
mbufthis tool is very important for all, because, it helps in your workflows, or the way you are going to work;15:34
mbufI am going to address some basics concepts of the tool, so understanding these are important; once you understand the flow, it becomes really useful15:34
mbufthis is not just for source code, but, can be used for your HOWTOs, documentation, assignments, research papers, thesis, and anything text-based that you need to keep track of the history of changes;15:35
<-- debayan (n=debayan@61.95.198.26) has quit (Read error: 110 (Connection timed out))15:35
no_mindroll call time15:35
mbuffor your projects or documentation you can use http://git.fedoraproject.org/git/ or gitorious.org15:36
mbufno_mind: its been done!15:36
mbufto host your git repos; but, git is very useful to work without Internet connection;15:36
mbufyou work with a local copy of the repo in your system itself!15:37
mbufthe source of this presentation has also been put in a git repo, which you can get from: http://gitorious.org/di-git-ally-managing-love-letters/mainline/blobs/master/di-git-ally-managing-love-letters.tex ; it has been done in LaTeX and LaTeX-Beamer15:37
mbuf--> #n, means slide number 'n'15:37
abhishekgmbuf: is it a local repository at  localhost15:38
--> kushal (n=kdas@fedora/kushal) has joined #dgplug15:38
mbufabhishekg: if you want to talk, type '!'15:38
mbufabhishekg: don't type your message straight away!15:38
abhishekgmbuf:!15:38
mbufabhishekg: yes, it is a local repository at localhost15:38
mbufabhishekg: when you are done talking use 'eof'; these were addressed in the previous chat IRC logs;15:39
mbuf--> #115:39
mbufThis is version 1.3 of the presentation; you are welcome to freely re-distribute the presentation or present it to your friends;15:39
<-- sumitc (n=chatzill@unaffiliated/sumitc) has quit (Read error: 110 (Connection timed out))15:40
mbuf--> #215:40
mbufPlease read the 'Warning'15:40
mbuf--> #315:40
mbufYou have to initially define your user.name and e-mail address which will be used in git commits;15:40
mbuf--> #415:40
mbufthese commands update your /home/<your-username>/.gitconfig file15:41
mbuf--> #515:41
mbuf--> #615:41
mbuf--> #715:41
mbuf--> #815:41
mbufor you can manually update your .gitconfig file;15:41
mbufI have setup a gl alias that I can invoke with git, "git gl" to show the commit logs in the slides;15:42
mbufwe will use it in this presentation;15:42
mbuf--> #915:42
mbufI am only going to show how to manage love-letters, not write love letters :)15:42
mbufworking tree defines our local directory structure, /15:43
mbufI am simply creating a directory love-letters15:43
mbuf--> #1015:43
mbuf--> #1115:43
mbufin this top-level love-letters directory, I am initializing a git repo;15:44
mbufit basically creates a .git directory in this top-level love-letters directory15:44
mbuf--> #1215:45
mbufThe command and the outputs are shown in different font style formats;15:45
mbuf--> #1315:45
--> karthick (n=karthick@59.96.30.64) has joined #dgplug15:45
mbufI am creating a new file called "to-my-dearest.txt"15:45
mbufso the working tree represents what you see in your directory15:45
mbuf--> #1415:45
mbufI am making some changes to to-my-dearest.txt file, by editing it with any editor of my choice;15:46
mbuf--> #1515:46
mbufThe index is also known as the staging area; before you commit your love letter you want to stage it (for rehearsal, perhaps) before you commit to your local repo;15:46
hermes!15:47
mbufso any change you make in the files are pushed to index, before committing to the repo;15:47
mbufhermes: shoot!15:47
mbufhermes: yes, what is your question?15:47
hermesplease elaborate the above 2 lines that u just typed ,15:47
hermesI dint quite understand15:48
hermeseof15:48
mbufhermes: let me finish one iteration, and if you still don't understand, type '!' again;15:48
hermesmbuf : alright15:48
mbufso, I have made some changes to to-my-dearest.txt since I created it touch15:49
<-- zer0c00l (n=zer0c00l@117.199.137.176) has quit (Read error: 113 (No route to host))15:49
mbufand before I commit it to my local repo, I am staging it with 'git add'15:49
<-- no_mind (i=7aa38309@gateway/web/freenode/x-2cf763c7f1d80887) has quit ("Page closed")15:49
mbufgit basically creates object references for the change; everything is stored in .git/ directory15:49
mbuf--> #1615:49
--> sa111 (i=3b601e40@gateway/web/freenode/x-872bd38ae2dc4a09) has joined #dgplug15:50
--> no_mind (i=7aa38309@gateway/web/freenode/x-6f36f204128fe3fa) has joined #dgplug15:50
mbufthat is how you commit the message; as you can see the change is in the repository15:50
mbuf--> #1715:50
mbuf--> #1815:50
mbuf--> #1915:50
parthachowdhury!15:50
mbufYou can always check the status of the git repo using 'git status'15:50
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug15:50
mbufif it doesn't mention any warning, or error messages, your repo status is clean;15:51
mbufso, the basic idea is that one needs to make changes to your local files, add it to the index and then commit it to the repository;15:51
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))15:51
mbufthe use of index, is that if you don't want to commit things to the repo, you can backtrack;15:51
mbufone of the biggest mistakes that newbies do, that I have observed, is that they hack on the same code, again and again and again15:52
mbufso after two days, you ask them to revert their changes to what was two days back, they will not be able to do it;15:52
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug15:52
mbufbut, committing code locally, often and repeatedly, will help one to revert  back the commit, or see what changes have been made, and what can be undone;15:52
mbufwhat are the commands that are used for this workflow between working tree, index and repo is what we will see here today; you may or may not use everything in real-life, but, it is good to know;15:53
mbufparthachowdhury: shoot!15:53
parthachowdhurywhat is 958d5ac ?15:53
mbufparthachowdhury: that is a SHA1 commit number;15:53
parthachowdhury!15:53
mbufparthachowdhury: for every commit you make a unique number is generated15:54
mbufparthachowdhury: wait, let me finish;15:54
parthachowdhuryok15:54
mbufparthachowdhury: this is used to identify your unique commit;15:54
parthachowdhuryis it the object reference ?15:54
mbufparthachowdhury: I said wait!15:54
mbufparthachowdhury: so if someone else copies your repository, which includes the .git repo, and your history of changes, they will see your commit messages;15:55
mbufparthachowdhury: we will not go into git internals, as that is left as an exercise, and not in the scope of this session;15:55
mbufparthachowdhury: git doesn't track files, unlike what cvs and svn do; it tracks content changes15:55
--> vivek_ (n=vivek@117.201.101.73) has joined #dgplug15:55
mbufparthachowdhury: so each commit is only info on the change that you have done;15:55
mbuf--> #2015:56
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))15:56
mbuf--> #2115:56
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug15:56
mbufso git gl shows use the first commit that we made, with the commit message "FIrst commit"15:56
hermes!15:56
mbufjust a brief message to fit in the slide;15:56
mbufhermes: shoot!15:56
hermesmbuf : you said that it is a SHA1 commit number which is unique15:57
hermesmbuf :what is SHA1 ?15:57
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))15:57
hermesmbuf :eof15:57
<-- karthick (n=karthick@59.96.30.64) has quit ("Leaving")15:57
mbufhermes: you can google that?15:57
sunny_slls!15:57
hermesmbuf : alright15:57
mbufsunny_slls: shoot!15:57
<-- vivek (n=vivek@117.201.98.228) has quit (Read error: 104 (Connection reset by peer))15:57
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug15:57
mbufhermes: http://en.wikipedia.org/wiki/SHA_hash_functions read later!15:58
sunny_sllsmbuf, suppose i wan't to make some changes in the .txt file15:58
sunny_sllsbut the changes are not done properly so will it backtrack15:58
sunny_sllsor in other words revert15:58
mbufsunny_slls: we will see those use cases next;15:58
mbufsunny_slls: there is a lot of workflows of what you mean by 'revert' -- everything will be addressed next;15:59
abhishekg!15:59
mbufabhishekg: shoot!15:59
sunny_sllsalso you said about the errors that newbies make15:59
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))15:59
sunny_sllsabout editing15:59
abhishekgI   have installed git on opeensuse 1115:59
abhishekgbut it doees15:59
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug15:59
abhishekgnot have gl15:59
abhishekgeof15:59
zer0c00l_!16:00
mbufabhishekg: this is not the time to answer installation and configuration problems;16:00
mbufabhishekg: you should have put your gl alias in .gitconfig in your home directory16:01
mbufabhishekg: or you could have sent an e-mail to the mailing list group16:01
sunny_slls!16:01
mbufzer0c00l_: shoot!16:01
mbufabhishekg: before coming to the session;16:01
zer0c00l_mbuf, same as abhishekg will correct it <eof>16:01
mbufsunny_slls: shoot!16:01
sunny_sllsalso you said about the errors that newbies make in editing files16:02
mbufsunny_slls: yes; they cannot revert back after changing code; for larger code bases;16:02
sunny_sllsif suppose we have got make several changes in a file then how can we do it16:02
mbufsunny_slls: all these will be addressed next;16:02
sunny_sllsok16:02
sunny_sllseof16:03
mbufsunny_slls: first understand the workflow, you can try to use git practically, at the end of the session;16:03
mbufplease understand how things work, you can play with git after the session16:03
mbufask only questions pertaining to the workflow; I shall not take any other questions;16:03
mbuf--> #2216:04
mbuf--> #2316:04
mbufgit show gives a more detailed log output, where you can see your username, e-mail given as Author, Date, commit message, SHA-1 number and diff change16:04
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 54 (Connection reset by peer))16:04
mbuf--> #2416:04
mbuf--> #2516:04
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug16:04
mbufalways good to check status16:04
mbuf--> #2616:05
mbufNow we try to write a love letter to raaani-mukerji.txt, so I create a new file16:05
mbuf--> #2716:05
mbuf'git diff' shows the difference between working tree and index;16:05
mbuf--> #2816:05
mbuf'git diff --cached' shows the difference between index and HEAD; in other words, it tells whatever will be committed, on the changes that you added to index using 'git add'16:06
mbuf--> #2916:06
mbuf'git diff HEAD' shows the difference between working tree and HEAD;16:07
mbuf--> #3016:07
mbuf--> #3116:07
mbufSince we add a file to working tree, git status is showing that there is an untracked file; tracked files are in the index;16:07
mbuf--> #3216:07
mbufso we add the raaani-mukerji.txt love letter to the index;16:08
mbuf--> #3316:08
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))16:08
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug16:08
mbufbecause nothing was there in index with respect to raaani-mukerji.txt, there s no diff output16:08
mbuf--> #3416:08
mbuf--> #3516:09
mbufbecause 'git diff --cached' shows what will be committed next, if you commit, it shows the change;16:09
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))16:09
mbuf--> #3616:09
mbuf--> #3716:09
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug16:09
mbufsince we have already added the file to index, 'git diff HEAD' will show the difference because, it also shows what will be committed if you did 'git commit -a -m 'message'16:10
mbuf--> #3816:10
mbufagain check git status, to see what git says16:10
mbufnow our file is in index, so we can commit as we did with our first commit or we can revert;16:10
mbuf--> #3916:11
mbuf--> #4016:11
mbufraani-mukerji doesn't want to date me;16:11
mbuf--> #4116:11
mbufso we simply try to remove the love letter16:11
mbuf--> #4216:11
mbufbecause we have staged it to the index, git gives us the error16:12
mbuf--> #4316:12
mbufso we force remove it;16:12
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))16:12
mbuf--> #4416:12
mbuf--> #4516:12
mbuf--> #4616:12
--> djthequest (i=daf85072@gateway/web/freenode/x-1c9fc357ba035987) has joined #dgplug16:12
--> sumitc (n=chatzill@unaffiliated/sumitc) has joined #dgplug16:12
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug16:12
mbufso we see the file has been removed from index and the working tree;16:12
mbuf--> #4716:12
mbuf--> #4816:12
mbufour working tree is clean;16:13
mbufthis was a workflow to show a file that you staged and then removed, because you didn't want to keep the file;16:13
mbuf--> #4916:13
mbufNow we try our luck with nayantaara16:13
mbuf--> #5016:13
hermes!16:13
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))16:13
mbufhermes: shoot!16:13
hermesforce deleting essentially deletes the entry from index for 'rani'16:14
hermes?16:14
hermeseof16:14
mbufhermes: yes16:14
mbufhermes: and also the file from your folder16:14
hermesya sure16:15
mbufindex is only a collection of object references on the changes;16:15
mbuf--> #5116:15
mbufIf we just want to remove from the caching staged (index) area, but, still want to retain it in the folder, we can use 'git rm --cached filename'16:16
mbuf--> #5216:16
mbuf--> #5316:16
mbuf--> #5416:16
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug16:16
mbufso we now don't have the object references in the index for nayantaaara.txt, but the file exists in the directory;16:16
mbuf--> #5516:16
mbuf--> #5616:17
mbufno difference, and hence no output16:17
mbuf--> #5716:17
mbufsame as above;16:17
mbuf--> #5816:17
mbuf--> #5916:17
<-- mavu_ (n=mavu@59.178.189.159) has quit (Read error: 110 (Connection timed out))16:17
--> mavu_ (n=mavu@59.178.161.154) has joined #dgplug16:17
mbufsince we have added the file to the directory, but is not tracked (to index), git says you need to add it to the index;16:18
mbuf--> #6016:18
mbufmake love doesn't work with Nayantaaara16:18
mbuf--> #6116:18
mbufsince the object reference has already been removed from the index, we can simply remove the file;16:18
mbuf--> #6216:18
mbuf--> #6316:19
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))16:19
mbuf--> #6416:19
mbufchecking git status, just to check if our repo is clean;16:19
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug16:19
mbufso this was a case where we added a file to the index, but, temporarily removed it from the index, because, we could make more changes; but, since we didn't want to make any change, we simply removed it;16:19
mbuf--> #6516:19
mbufwe try a new letter for raaani-mukerji16:20
mbuf--> #6616:20
mbufwe add it to the index;16:20
mbuf--> #6716:20
mbufBut, she already rejected me. I forgot! So, we just rename the love letter so we can write a love letter to aishvarya-ray16:20
mbufyou use 'git mv' for it;16:20
mbufyes, it works when you have added the file already to the index!16:21
mbuf--> #6816:21
mbufinstead of git rm, you can use 'git reset HEAD file', in case, you feel that you might mistakenly use rm to remove a file16:21
mbufin this case, 'git reset HEAD file' does the same as 'git rm --cached file'16:21
mbuf--> #6916:22
mbuf--> #7016:22
mbuf--> #7116:22
mbufno differences, so no output;16:22
mbuf--> #7216:22
mbuf--> #7316:22
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 54 (Connection reset by peer))16:22
mbufsince we add a file aishvarya-ray.txt, but, it has not been staged to the index and is thus untracked, git is saying there is an untracked file;16:23
mbuf--> #7416:23
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug16:23
mbufAishvarya Ray is married! I didn't know that until now :(16:23
mbuf--> #7516:23
mbuf--> #7616:23
mbufso I just remove the file;16:23
mbuf--> #7716:23
mbuf--> #7816:24
mbuf--> #7916:24
mbufour local repo is clean;16:24
mbuf--> #8016:24
mbufnow, let us try to write a letter to pretty-zinta;16:24
mbuf--> #8116:24
sunny_slls!16:24
mbufI feel the letter is satisfactory, and I want to add it to the index;16:24
mbuf--> #8216:25
mbufI feel I can give this letter a shot at, and so I commit it to the local repo;16:25
mbuf--> #8316:25
mbufsunny_slls: shoot!16:25
sunny_sllsplease explain the git reset head file   since the file raani mukerjee was removed from the folder which it is rejected when created later?16:26
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))16:26
sunny_slls<eof>16:26
mbufsunny_slls: rejected is just a joke that I made;16:26
mbufsunny_slls: that is a use case scenario, where you have added a file to the index, and realized you mistakenly named it something else16:26
mbufsunny_slls: so if you want to rename it, you use 'git mv'16:27
mbufsunny_slls: git reset HEAD file, is like resetting the HEAD (part of git)16:27
mbufsunny_slls: which is the same pattern as 'git rm --cached'16:27
mbufsunny_slls: git has two pointers, HEAD and master;16:27
mbufsunny_slls: HEAD and master always point to the latest commit;16:28
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug16:28
mbufsunny_slls: there are scenarios where they can point to different things;16:28
mbufsunny_slls: we'll come to that;16:28
mbufsunny_slls: <eof>16:28
<-- samar (n=samar-ad@115.108.6.29) has quit ("Ex-Chat")16:28
mbuf--> #8416:28
mbuf--> #8516:28
mbufso, now you see that we have made a second commit, and that is shown first (on the top)16:29
mbufso every time you feel you are satisfied with your work, you make a commit;16:29
mbuf--> #8616:29
mbufHEAD is the current pointer or reference; HEAD^ points to the previous HEAD16:30
mbufso what 'reset --soft' does is rever the changes such that it keeps the changes in the index;16:30
mbufand because we used HEAD^, HEAD is shifted to the previous value that it had;16:31
mbuf--> #8716:31
mbuf--> #8816:31
mbufas you can see HEAD is now in the first commit;16:31
mbuf--> #8916:32
mbuf--> 9016:32
mbuf'reset --soft' keeps the changes in the index, and the files are retained in the working directory;16:32
mbuf--> #9116:32
hermes!16:32
mbufnow, it is interesting to see the diff outputs;16:32
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))16:32
<-- kishan (n=kishan@117.99.63.16) has quit (Remote closed the connection)16:32
mbufhermes: shoot!16:32
hermeswhy did we shift the head back to the first commit16:32
--> SkyRocknRoll (n=chatzill@122.164.52.232) has joined #dgplug16:33
hermesI mean what are we trying to achieve by doing that16:33
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug16:33
hermeseof16:33
mbufhermes: because we are undoing our last commit or the most recent one!16:33
mbufhermes: let's say you made a commit in a hurry, and you want to undo or redo it!16:33
hermesalright, i get it16:33
hermeseof16:33
mbufhermes: you rever the repository HEAD to the previous one, while the last changes you made are still in the working tree;16:33
mbufhermes: :)16:33
mbuf*revert16:33
mbuf--> #9216:34
mbuf--> #9316:34
--> kishan (n=kishan@117.99.59.7) has joined #dgplug16:34
mbuf'diff --cached' shows the difference clearly;16:34
mbuf--> #9416:34
mbuf--> #9516:34
mbufshows what will be committed if you did 'git commit -a -m message'16:34
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))16:34
mbuf--> #9616:34
mbuf--> #9716:35
mbufgood to check status, if you are not sure what the git repo state is in;16:35
mbufit says you have some changes in the index, to undo you can reset HEAD -- which will remove from index, but, still keep the files in the working directory;16:35
mbuf--> #9816:36
mbuf--> #9916:36
mbuf--> #10016:36
mbufor make some changes to satisfy pretty zinta16:36
mbuf--> #10116:36
mbuf--> #10216:36
mbufand we commit the message;16:36
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug16:36
mbufnote now the commit SHA1 message will be a new number;16:36
mbufearlier it was 661bc09...16:37
mbuf--> #10316:37
mbuf--> #10416:37
mbufnow it is c66e7f1...16:37
--> Samsung (i=Samsung@115.108.6.29) has joined #dgplug16:37
mbuf--> #10516:37
mbufnow let's say I made a mistake in the commit message; I want to fix it16:38
mbuf--> #10616:38
mbuf--> #10716:38
mbufyou use 'git commit --amend'16:38
mbuf--> #10816:38
mbuf--> #10916:38
mbufagain note the new SHA-1 value;16:38
mbuf--> #11016:38
mbuf--> #11116:38
mbufjust checking for status;16:38
mbuf--> #11216:39
mbufnow I am making some more changes in pretty-zinta.txt16:39
mbuf--> #11316:39
mbufbecause, there were some changes in pretty-zinta.txt in the index before and now in the working directory, git diff shows the changes;16:39
mbuf--> #11416:40
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))16:40
mbufnothing is added to index, so no change in the output;16:40
mbuf--> #11516:40
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug16:40
mbuf--> #11616:40
mbufbecause, we have added some changes to the working directory, and pretty-zinta.txt is already tracked in the repo, 'diff HEAD' shows the changes;16:40
mbuf--> #11716:40
mbufBut, I couldn't find Pretty Zinta to give the love letter; how sad!16:41
mbuf--> #11816:41
mbuf--> #11916:41
mbufnow we totally remove the committed entry in the repo _and_ in the working tree using 'reset --hard'16:41
mbuf--> #12016:41
mbuf--> #12116:41
mbuf--> #12216:41
mbuf--> #12316:42
mbuf--> #12416:42
mbufso, this was a use case, where you completely undo a previous commit from the local repo, and also the changes from your working directory;16:42
mbufthis is something that you will probably use often, if you don't want to keep whatever changes you have made;16:42
mbuf--> #12516:42
mbuf--> #12616:43
mbuf--> #12716:43
mbuf--> #12816:43
mbuf--> #12916:43
mbuf--> #13016:43
mbufthese are examples of using 'grep' command with git;16:43
mbufthese will search source files as well as git objects (called as blobs)16:43
mbuffor any search pattern that you specify;16:43
mbuf--> #13116:43
mbuf--> #13216:44
mbuf--> #13316:44
mbuf--> #13416:44
mbuf--> #13516:44
mbuf--> #13616:44
mbuf--> #13716:44
mbufthere are different ways to see previous commit and log messages;16:44
mbufthese are few examples;16:44
mbuf--> #13816:45
mbuf--> #13916:45
mbuf--> #14016:45
mbuf--> #14116:45
mbuf--> #14216:45
mbufgit show also produces nice output; I can't show everything on a slide though;16:45
mbufwhen you practice after the session, you can play with these :)16:45
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))16:45
mbuf--> #14316:45
mbufsometimes you are working on a change, and you suddenly have something more important to try; but, you don't want to discard the changes you have made;16:46
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug16:46
mbufso you simply 'stash' it, or leave it aside;16:46
mbufto do that you use 'git stash'16:46
<-- Shrink (n=sgupta@redhat/shrink) has quit (Read error: 113 (No route to host))16:46
mbuf--> #14416:46
mbufeven this has an identifier;16:46
mbuf--> #14516:46
mbuf--> #14616:46
mbuf--> 14716:47
mbufwhatever changes you make are local and not affected by your stashed changes;16:47
mbufonce you are done and you want to reapply the work that you left aside, you can just apply it back using 'git stash apply'16:47
mbuf--> #14816:47
mbuf--> #14916:47
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))16:47
mbuf--> #15016:47
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug16:48
mbufIt says I have modified the file, to-my-dearest.txt, so I need to add it before committing; I just use 'commit -a -m' to do it in one shot;16:48
mbuf--> #15116:48
mbuftagging is important if you want a label for a particular commit;16:48
mbuf--> #15216:48
mbuf--> #15316:49
mbuf--> #15416:49
mbufjust 'git tag' will list the tags16:49
mbuf--> #15516:49
mbuf--> #15616:49
mbuf--> #15716:49
mbufRemove the tag using 'tag -d'16:49
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))16:49
mbuf--> #15816:50
mbuf--> #15916:50
--> yevlempy (n=yevlempy@124.124.157.94) has joined #dgplug16:50
mbufif you want your friend to use a particular tag release of your code, you can refer the same16:50
mbufand hence, one can use it for references;16:50
mbuf--> #16016:50
hermes!\16:50
mbufsometimes, when you are working with huge projects, and you are new developer16:50
mbufthey might only accept patches, so you can use the git-format-patch command to get the change you made and send it via e-mail16:51
mbufhermes: shoot!16:51
mbuf--> #16116:51
mbuf--> #16216:51
mbuf--> #16316:51
mbuf--> #16416:51
mbufthese show how a git patch looks like;16:51
hermeswhat if i want to add a tag to some other identifier16:51
--> akuscifi007 (n=akuscifi@122.162.82.58) has joined #dgplug16:52
hermesnot to what head is currently pointing16:52
hermeseof16:52
mbufhermes: git has lot of command options; and each command has lot of options which are described in detail with examples in their manual page;16:53
mbufhermes: sure you can; check this (later) http://www.kernel.org/pub/software/scm/git/docs/git-tag.html16:53
mbufhermes: eof16:53
mbuf--> #16516:53
hermesmbuf :ok, thankful16:53
hermeseof16:53
mbufreflog contains list of all your previous commits;16:54
mbuf--> #16616:54
mbufso you can actually go back to some commit that you made;16:54
mbuf*made directly;16:54
mbuf--> #16716:54
mbufhere we resetting it to 1, i.e., where HEAD was at {1]16:55
mbufremember again, that reset --hard, will revert and also remove the changes in the working directory;16:55
mbuf--> #16816:55
mbuf--> #16916:55
mbuf--> #17016:55
mbufso we have undone all our previous changes, except our first commit;16:56
mbuf--> #17116:56
mbufgit basically doesn't track files, it only tracks content;16:56
mbufso ideally, we shouldn't be creating a separate love letter for each of our dear ones;16:57
mbufwhat if we had one love-letter, and the change control tracker, keeps track of the changes w.r.t. each dear one;16:57
mbufso in index, and repo, only objects, or the changes are stored, and not another copy of the file;16:58
mbufso far we have been working in the default branch, called the 'master' branch16:58
mbuf--> #17216:58
sunny_slls?16:58
mbufI only have to-my-dearest.txt file in the working directory;16:58
mbufsunny_slls: shoot!16:58
sunny_sllssorry typing mistake16:58
mbufsunny_slls: no problem;16:59
mbuf--> #17316:59
mbufso, I am going to try my luck with Priyaaanka-chopra16:59
mbufI create a new branch for it;16:59
mbuf--> #17416:59
mbuf--> #17516:59
mbufso you now see two branches; the asterisk (*) shows which branch I am currently working in;16:59
mbuf--> #17616:59
mbuf--> #17717:00
mbuf'branch -d' is what I use to delete a branch;17:00
mbufbranching is completely handled by git, you will only see one file in the working directory;17:00
mbufbut, as you switch branch, the respective changes in the file for that particular branch will prevail, when you open the file;17:01
mbufwe'll see this next;17:01
mbuf--> #17817:01
mbuf'checkout -b' is used to create a new branch and to enter into it;17:01
mbuf--> #17917:01
mbuf--> #18017:01
mbuf--> #18117:01
mbufit now shows we are in the priyaaanka-chopra branch;17:02
mbuf--> #18217:02
mbuf--> #18317:02
mbufto go back, we again use 'checkout'17:02
mbuf--> #18417:02
mbuf--> #18517:02
mbufso, 'git branch' shows us we are now in the 'master' branch;17:02
mbuf--> #18617:02
<-- akuscifi007 (n=akuscifi@122.162.82.58) has quit (Read error: 104 (Connection reset by peer))17:02
mbufI am now in the priyaaanka-chopra branch;17:03
mbuf--> #18717:03
mbuf--> #18817:03
mbufI am making some changes to to-my-dearest.txt and I am committing it;17:03
mbuf--> #18917:03
mbuf--> #19017:03
mbuf--> #19117:03
mbufso, now you see that we have HEAD and priyaaanka-chopra ;17:04
mbufour commit (latest) is a63ae26...17:04
mbufthere is only one file in the working directory;17:04
mbufif I switch to the master branch, there will be HEAD and master for the master branch with only 958d5ac...17:04
mbuf--> #19217:04
mbuf--> #19317:04
mbuf--> #19417:04
mbufNow, I feel that priyaaanka-chopra changes are very good, and I can use it in 'master' copy17:05
mbufso I simply merge the changes from the priyaaanka-chopra branch to the master copy;17:05
mbuf--> #19517:05
mbuf--> #19617:05
mbuf--> #19717:05
mbufso now we have the latest commit message on the master branch;17:06
mbufthis use case is to show that if you decide to work on a bug or a new feature in your code, you always make a copy of it in the branch17:06
mbufyou work in the branch, test it, and if satisfactory you merge it back to the master copy17:06
hermes!17:06
mbufif you are not satisfied with the branch, you can always delete it!17:06
mbufthis is very important, unlike, newbies hacking on the same code, again, and again, and again, without being able to revert changes quickly and correctly;17:07
mbufhermes: shoot!17:07
hermesmbuf : Added very sweet is the name given to the commit operation right? It had nothing to do with the changes that we actually make to out txt file17:07
hermesright17:07
hermes?17:08
hermeseof17:08
hermesSorry our text file17:08
hermesef17:08
mbufhermes: that is correct! it is the commit message like, 'git commit -a -m 'Added very sweet''17:08
hermeseof17:08
--> kopecks89 (n=koyel@117.201.96.138) has joined #dgplug17:09
mbufhermes: as I told earlier, this is not about what you write in the love letter; it is only about managing love letters :)17:09
mbufhermes: eof17:09
sunny_slls!17:09
mbufsunny_slls: shoot!17:09
sunny_sllssuppose there are many other branches and we wan't to merge some of them then how can we do that17:10
mbufthere has been no conflict here; but, git tries to do its best to merge things; if there is a conflict, you need to resolve it manually, add the file again to index and commit it to the repo;17:10
sunny_sllsin the master?17:10
mbufsunny_slls: merge one by one;17:10
mbufsunny_slls: git merge foo; git merge bar; git merge alpha; git merge beta;17:10
sunny_sllsthanks17:11
sunny_sllseof17:11
mbufsunny_slls: I am only describing the basic work mechanism of git; it doesn't define how your project workflow should be; that is something that your team must decide;17:11
mbuf--> #19817:11
mbufusually, you will get the source code from upstream (like from sourceforge.net, or freshmeat.net) and you will work on your local copy;17:11
mbufso, here, I am simply simulating an upstream update, by manually doing a commit in the master branch -- as if it came from the upstream project;17:12
mbuf--> #19917:12
mbuf--> #20017:12
mbufnote the commits in the master, the latest one being 19e0205...17:12
mbuf--> #20117:12
mbuf--> #20217:12
mbuf--> #20317:13
mbuf--> #20417:13
mbuf--> #20517:13
mbufNow, I am checking out priyaaanka-chopra branch;17:13
mbuf--> #20617:13
mbuf--> #20717:13
mbuf--> #20817:13
mbuf--> #20917:13
mbuf--> #21017:13
mbufyou see the different commit history between the master and the priyaaanka-chopra branch;17:13
mbufthe master branch has had one commit more than the priyaaanka-chopra branch;17:14
mbuf--> #21117:14
mbufNow I am making some changes to priyaaanka-chopra branch;17:14
mbuf--> #21217:14
mbuf--> #21317:14
mbufNote the new commit is 1d1fd9f... which is different from the master (19e0205...)17:15
mbuf--> #21417:15
mbufNow I could merge the changes (upstream) on the master with the priyaaanka-chopra branch changes;17:15
mbufbut, we have what is called as 'rebase' which basically overwrites our previous changes and merges the changes in the priyaaanka-chopra branch, as we do it next;17:16
mbuf--> #21517:16
mbufbecause of conflict, 'rebase' failed;17:16
mbuf--> #21617:16
mbufso that is the conflict in the to-my-dearest.txt between the master and the priyaaanka-chopra branch; we edit it to choose either one above or below the ======17:17
mbufRemove the <<<<, >>>> lines;17:17
mbuf--> #21717:17
mbuf--> #21817:17
mbuf--> #21917:18
mbuf--> #22017:18
mbufJust checking git gl and since the file has been modified, we need to add it to index before committing;17:18
mbuf--> #22117:18
mbufsince we have fixed the conflict, we can ask 'git rebase' to skip the conflict and proceed to merge;17:18
mbuf--> #22217:18
mbuf--> #22317:19
mbuf--> #22417:19
mbufmaster changes have been merged to priyaaanka-chopra branch17:19
mbuf--> #22517:19
mbufBut, most importantly note that it has overwritten our previous commit log;17:19
mbufSometimes when we are working in our branch copy, we will make many commits;17:19
mbufWhen we want to synchronize our code base with an upstream project, we fetch the code from the upstream project repository;17:20
mbufand we need to merge it with our local copy;17:20
mbufso, we may not want to keep a history of our local changes; simply merge it with our changes, as long as our changes are there in code;17:20
mbufso rebase basically rewrites history!17:20
mbuf--> #22617:21
mbuf--> #22717:21
mbufso we have covered most use cases; to get a copy of a project repository in a server, you basically 'clone' a copy of the repository;17:21
mbufso you get the complete history;17:21
mbuf--> #22817:21
mbuf--> #22917:21
mbufIf you already have cloned a repo, and you only want to get the upstream changes, just use fetch17:22
mbuf--> #23017:22
mbuffetch will only download the upstream changes to the local system; it will not merge it with the master code;17:22
mbufpull will fetch+merge17:22
mbuf--> #23117:22
mbufgit provides different ways to download code from remote repos;17:23
mbuf--> #23217:23
mbuf--> #23317:23
mbuf--> #23417:23
mbuf--> #23517:23
mbufgit remote shows that the remote repo also has a 'origin'17:23
mbufis a reference link17:23
mbuf--> #23617:23
mbuf--> #23717:23
mbuf--> #23817:23
<-- kopecks (n=koyel@117.201.100.101) has quit (Read error: 110 (Connection timed out))17:23
mbufbranch only shows local branches; git branch -r shows remote branches17:24
mbuf--> #23917:24
mbufso in the remote repo also, we have a origin/HEAD and origin/master17:24
mbuf--> #24017:24
mbufyou can add remote repository instance to your local .git/ to get updates;17:24
mbufyou will learn these as you work between local and remote repos;17:25
mbufthis ends the presentation;17:25
mbufI know I haven't covered many use cases, but, I feel these are basic ones that should help you get started with using git;17:25
mbufgitorious.org provides nice git commands on doing fetches, updates, and merges, which I like;17:25

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!