14:17:12 <FranciscoD> #startmeeting Fedora Classroom (2017-10-05)
14:17:13 <zodbot> Meeting started Thu Oct  5 14:17:12 2017 UTC.  The chair is FranciscoD. Information about MeetBot at http://wiki.debian.org/MeetBot.
14:17:13 <zodbot> Useful Commands: #action #agreed #halp #info #idea #link #topic.
14:17:13 <zodbot> The meeting name has been set to 'fedora_classroom_(2017-10-05)'
14:17:32 <FranciscoD> #meetingname fedora-classroom
14:17:32 <zodbot> The meeting name has been set to 'fedora-classroom'
14:17:44 <FranciscoD> #meetingtopic Git 101
14:17:49 <krilen> \help
14:17:56 <krilen> sorry :)
14:18:00 <FranciscoD> no worries :)
14:18:18 <FranciscoD> OK, before we begin, please check that you have git installed
14:18:24 <FranciscoD> on Fedora, that's `dnf install git-all`
14:18:38 <FranciscoD> We'll stick to the command line, and you can explore other UI frontends later
14:18:53 <FranciscoD> Please also log in to Pagure at pagure.io - when we work with remotes, we'll use Pagure
14:19:19 <FranciscoD> Let's take 5 minutes to do all of this, and in the meantime, you can introduce yourselves if you'd like :)
14:19:23 <FranciscoD> #topic roll call
14:19:26 <FranciscoD> .hello ankursinha
14:19:27 <zodbot> FranciscoD: ankursinha 'Ankur Sinha' <sanjay.ankur@gmail.com>
14:19:39 <FranciscoD> That's me - if you have a Fedora account, you can use that command :)
14:21:03 <prime_> .hello venkateshkareti
14:21:04 <zodbot> prime_: venkateshkareti 'None' <kareti.venkatesh9@gmail.com>
14:21:26 <skamath> .hello2 skamath
14:21:28 <zodbot> skamath: skamath 'Sachin S Kamath ' <sskamath96@gmail.com>
14:22:08 * skamath had gone for dinner but is back now
14:23:25 <FranciscoD> OK, let's proceed then
14:23:33 <FranciscoD> #topic Version control 101
14:23:42 <FranciscoD> #chair skamath
14:23:42 <zodbot> Current chairs: FranciscoD skamath
14:23:52 <FranciscoD> I take it everyone here codes a bit?
14:24:03 <jadupl2> Yes we do
14:24:06 <skamath> print("Yes")
14:24:14 <FranciscoD> Now, when you work with lots of files, and you make lots of changes, tracking all these changes becomes quite hard
14:24:24 <FranciscoD> I know people that make new folders each time they make a change
14:24:33 <FranciscoD> but well, that doesn't scale very well..
14:24:54 <FranciscoD> So, brainy that programmers are, they made tools to handle source code
14:25:09 <skamath> Here is a bonus image before we start : https://i.redd.it/05b6u19pseoz.png
14:25:17 <FranciscoD> There are many of these - from the older CVS to the new ones - svn, git, hg
14:25:34 <FranciscoD> and perforce and others that aren't open source (weren't the last time I checked)
14:26:05 <FranciscoD> These tools are designed for various "software development strategies" - that you can learn via Google
14:26:09 <FranciscoD> (or a coursebook)
14:26:18 <FranciscoD> Agile is one that's very popular nowadays
14:26:23 * skamath learns that in $univ
14:26:37 <FranciscoD> "Waterfall" is another classic one that skamath must have been taught ;)
14:26:46 <skamath> lol yes
14:26:56 <FranciscoD> In short, use version control - whatever tool you prefer, but learn it, and use it
14:27:28 <FranciscoD> Oh, by the way - if you have a question at any point, please use "!" or "?" to grab my attention
14:27:36 <FranciscoD> Any questions till now?
14:27:53 <dtate_> nope, all good
14:28:00 <FranciscoD> For late comers - please install git, and log in to pagure.io
14:28:03 <jadupl2> !no
14:28:07 <FranciscoD> #info For late comers - please install git, and log in to pagure.io
14:28:19 <FranciscoD> #info use version control - whatever you prefer, but use it
14:28:28 <FranciscoD> On to Git then
14:28:33 <FranciscoD> #topic Git!
14:28:57 <FranciscoD> First - even before I begin - where do you get help?
14:29:07 <FranciscoD> #info Help on git: 1. https://git-scm.com/
14:29:15 <FranciscoD> #info Help on git: 2. the man pages
14:29:35 <FranciscoD> everyone open a terminal - and run `apropos git`
14:29:42 <FranciscoD> tell me what you see!
14:29:57 <ha33> git: nothing appropriate.
14:30:02 <Tim__> a lot of text
14:30:19 <skamath> ha33, have you installed git?
14:30:25 <prime_> matrix text ;)
14:30:27 <ha33> yeah
14:30:31 <krilen> man pages
14:30:31 <dtate_> "nothing appropriate"
14:30:40 <ha33> should have a problem here xD
14:30:49 <rm_> list of commands
14:31:02 <FranciscoD> ha33: try `man -u` - maybe your mandb isn't built yet
14:31:09 <FranciscoD> dtate_: try the same thing ^
14:31:30 <FranciscoD> wait, that command is incomplete
14:31:32 * FranciscoD goes to check
14:32:00 <FranciscoD> `sudo mandb`
14:32:07 <FranciscoD> that'll update your man page database
14:32:12 <dtate_> I have the man page for git...
14:32:31 <dtate_> Though git version is 2.9.5
14:33:04 <FranciscoD> dtate_: that shouldn't matter as long as you have the docs installed
14:33:04 <skamath> For people who just joined : please install git, and log in to pagure.io
14:33:28 <dtate_> k
14:33:29 <FranciscoD> probably the `git-core-doc` package
14:33:33 <rm_> ha33: Do you have all of git installed?   I've been using git for a while but 'sudo dnf install git-all' installed several more packages that were not previously on my system..
14:33:42 <ha33> now it's showin a list of comments
14:33:56 <ha33> commands*
14:33:56 <skamath> Newcomers : Sign up for a FAS account if you have not already : https://admin.fedoraproject.org/accounts/user/new
14:34:02 <FranciscoD> rm_: ++ -> git-all pulls in a majority of the available git modules
14:34:12 <FranciscoD> skamath: although an FAS is not compulsory
14:34:28 <skamath> FranciscoD, it is required for logging into Pagure
14:34:29 <skamath> no?
14:34:37 <FranciscoD> skamath: I thought anything openid, not sure
14:34:48 <FranciscoD> Anyway, we'll see to that later
14:34:54 <dtate_> k. git-all installed 20 more packages.
14:35:03 <mido> Hello : )
14:35:09 <FranciscoD> #info `apropos` goes through all your man pages and finds ones that match the search term
14:35:17 <dtate_> And now I have a wall of text from `apropos git`
14:35:18 <FranciscoD> so you'll see there are a *lot* of man pages for git related tools
14:35:22 <skamath> FranciscoD, afaik a fas account is required.
14:35:27 <FranciscoD> dtate_: ah, yeh, that's what you should get
14:35:45 <FranciscoD> if you try `apropos git-` (add the dash), that may shorten the list a bit
14:35:46 <mido> sounds like I missed a lot!
14:36:03 <skamath> mido, No you've not :)
14:36:24 <skamath> Install git if you have not already and login to pagure.io
14:36:29 <mido> could you just give me a breif then?.
14:36:32 <skamath> We are just warming up.
14:36:34 <mido> I already did
14:36:35 <mido> great
14:36:39 <FranciscoD> In summary, there is extensive documentation on your machine - you don't even need to go online
14:36:51 <skamath> FranciscoD wanted you to run apropos git and report what you see here.
14:37:12 <FranciscoD> try: `man git`, see what it says
14:37:24 <FranciscoD> use the arrow keys to scroll, and q to quit the man page
14:37:33 <skamath> We are learning about a *stupid* content tracker? :(
14:38:04 <FranciscoD> skamath: computers are inherently stupid
14:38:14 <FranciscoD> they do exactly what you ask, even if what you're asking is illogical
14:38:19 <FranciscoD> ;)
14:38:53 <mah0x00> apropos git and man git what is the deference?
14:39:03 <skamath> the rogue AI will not forgive you for this (someday) ;)
14:39:04 <mido> logged in to pagure and opened man git
14:39:15 <mido> but I've no idea about pagure
14:39:20 <FranciscoD> mah0x00: apropos give a list of all available man pages that match your search query, in this case "git"
14:39:26 <ha33> it worked for me though, thanks FrancicsoD and rm_
14:39:28 <skamath> mido, awesome. You're on track now. We'll get to it.
14:39:32 <FranciscoD> mah0x00: `man git` opens up the man page
14:39:54 <FranciscoD> of course, if you're new to man pages, at some point, you should read `man man`
14:39:57 <FranciscoD> ;)
14:40:21 <dtate_> the ultimate recursion ...
14:40:31 <mido> skamath, how do you color the message btw :D
14:40:36 <FranciscoD> ha, yeh, but thankfully, it ends there :)
14:40:47 <skamath> mido, did I?
14:40:49 <prime_> pagure is similar to GitHub! right
14:40:58 <FranciscoD> Let's close the man pages, and do some version control then?
14:41:06 <FranciscoD> oh, yea
14:41:10 <mido> yea! I'm so excited
14:41:24 <FranciscoD> #info Help with Git 3. Google (of course)
14:41:25 <mido> ah yeah :D
14:41:41 <mido> its in green when you type my name
14:41:42 <FranciscoD> if you ask others, they'll point you to LMGTFY
14:42:04 <skamath> mido, That's highlight when someone mentions your nick.
14:42:04 <FranciscoD> http://bfy.tw/QI
14:42:11 <FranciscoD> try that ^
14:42:16 <skamath> FranciscoD, that's what I do. Always.
14:42:18 <skamath> :P
14:42:31 <mido> skamath, great!
14:42:34 <mido> LD
14:42:35 <mido> :D
14:42:42 <skamath> That came up as green for me ;)
14:42:58 <skamath> (or DuckDuckGo)
14:43:12 <FranciscoD> #topic Getting our hands dirty!
14:43:14 <mido> skamath sounds cool ;)...my first time actually haha
14:43:25 <FranciscoD> OK, open a terminal
14:43:29 <rakya77> Hello, just created a FAS account and logged in at pagure.io
14:43:34 <FranciscoD> `cd` to a convenient directory
14:43:37 <FranciscoD> rakya77++
14:43:41 <skamath> rakya77, Awesome! You're on track :)
14:44:00 <FranciscoD> and create a new directory: `mkdir somethingsomething`
14:44:00 <mido> FranciscoD, done!
14:44:04 <dtate_> Done
14:44:08 <FranciscoD> replace somethingsomething with a suitable name, of course
14:44:21 <prime_> Done
14:44:22 <aditya_r> +1
14:44:22 <FranciscoD> enter this directory
14:44:31 <FranciscoD> this is where, we'll keep our source files
14:44:48 <mido> great
14:45:00 <FranciscoD> Now, we must tell Git that we want it to manage this directory, so we "initialise" a "git repository"
14:45:03 <FranciscoD> `git init`
14:45:18 <FranciscoD> then try: `ls -lash`
14:45:27 <prime_> done.
14:45:30 <FranciscoD> and also try: `tree .git`
14:45:37 <dtate_> I see it created a .git folder
14:45:44 <FranciscoD> dtate_: lovely!
14:45:46 <skamath> \o/
14:46:07 <FranciscoD> Remember, if you run into trouble, let us know using "!" or "?"
14:46:11 <Tim__> Good stuff!
14:46:32 <FranciscoD> This .git directory is where git stores metadata about your files
14:46:51 <skamath> It's the secret saviour of your folder.
14:46:57 <FranciscoD> you rarely need to edit it by hand - usually you'll use a git command to do it for you
14:47:15 <FranciscoD> #info Try not to modify the contents of `.git` by hand
14:47:23 <FranciscoD> Unless you really know what you're doing, of course :)
14:47:31 <prime_> Ok... no touching..;)
14:47:40 <FranciscoD> Should we add a file then?
14:47:45 <FranciscoD> How about a shell script?
14:48:08 <skamath> The hello world echo? :)
14:48:10 <FranciscoD> Use your favourite text editor to create a new file in this directory
14:48:13 <FranciscoD> skamath: you know it ;)
14:49:02 <Tim__> ?What kind of file, .txt, .sh?
14:49:07 <FranciscoD> Tim__: .sh
14:49:19 <FranciscoD> I called mine `Git101.sh`
14:49:27 <FranciscoD> Add these lines to it: https://paste.fedoraproject.org/paste/9t3qRA0vW~sm2LtADqY9sw
14:49:34 <rakya77> done, mine is file1.sh
14:50:01 <prime_> helloworld.sh
14:50:17 <FranciscoD> save it, close it
14:50:25 <aditya_r> +1
14:50:29 <dtate_> mine is also git101.sh
14:50:33 <FranciscoD> To run a shell script, you need to make it executable: `chmod +x <file>`
14:50:42 <FranciscoD> replace <file> with whatever filename you used
14:51:16 <aditya_r> it's looking green now :)
14:51:19 <FranciscoD> then, run `ls -lash`, and you should see that it is now executable
14:51:45 <FranciscoD> aditya_r: yeah, different terminals use different colours to show them :)
14:52:02 <skamath> Newcomers : Install git, log on to pagure.io, open terminal and `mkdir <something>`, `cd <the_folder_you_created>`, `git init` to initialize a git repo and `ls -lash` to see what changed.
14:52:06 <FranciscoD> These will be the permissions: `-rwxrwxr-x`
14:52:21 <FranciscoD> You can read up on them later - Google, man ls, and so on :)
14:52:40 <aditya_r> +1
14:52:44 <FranciscoD> now run the file: `./<file>`
14:52:58 <FranciscoD> It'll simply "echo" the message you asked it to
14:53:09 <FranciscoD> Let me know with a +1 when you've done this
14:53:15 <rm_> +1
14:53:16 <skamath> +1
14:53:16 <rakya77> +!
14:53:21 <dtate_> +1
14:53:22 <rakya77> +1
14:53:23 <Tim__> +1
14:53:27 <prime_> +1
14:53:28 <FranciscoD> Please stop me if I'm going too fast for you too :)
14:53:29 <pj_> +1
14:53:31 <aditya_r> +1
14:53:31 <pringips> +1
14:53:32 <LL62> +1
14:53:34 <skamath> Wow.
14:53:35 <jadupl2> +1
14:53:54 <ha33> +1
14:54:06 <mah0x00> +2
14:54:08 <mah0x00> +1
14:54:14 <FranciscoD> Anyone in trouble?
14:54:15 <krilen> +1
14:54:16 <black3dynamite> +1
14:54:21 <FranciscoD> Remember, there are *no* stupid questions
14:54:42 <FranciscoD> In the worst case scenario, I'll ask you to Google it ;)
14:54:57 <Tim__> Why not Bing?
14:55:00 <mah0x00> :)
14:55:11 <FranciscoD> Tim__: ah, yes, $search_it
14:55:23 <skamath> Google has become a placeholder for searching, hasn't it :P
14:55:36 <presiden> -e^i\pi
14:55:47 <FranciscoD> woah
14:55:51 <dtate_> *shivers* bing...
14:56:03 <FranciscoD> OK, now that we have a file, we want to tell Git that it should monitor it
14:56:15 <FranciscoD> Try: `git status`
14:56:30 <FranciscoD> It'll give you information on the current state
14:56:44 <black3dynamite> git status
14:56:52 <FranciscoD> It even suggests what you can do
14:56:56 <mah0x00> Untracked files ......
14:56:58 <FranciscoD> black3dynamite: in your terminal ;)
14:57:08 <capitanocrunch_> nothing added to commit but untracked files present (use "git add" to track)
14:57:25 <FranciscoD> Exactly, so git has seen that there's a file that it isn't yet tracking
14:57:27 <ckurucz> exit
14:57:32 <FranciscoD> Let's tell git that we do want it to track it
14:57:36 <FranciscoD> `git add <file>`
14:57:39 <black3dynamite> Yeah, I just notice that. :)
14:57:56 <FranciscoD> black3dynamite: happens to me all the time :D
14:58:07 <FranciscoD> after you've added it, check status again
14:58:14 <FranciscoD> something should've changed
14:58:19 <krilen> green :)
14:58:21 <dtate_> it is green now
14:58:30 <FranciscoD> and, the message above it now says?
14:58:40 <dtate_> Changes to be commited:
14:58:46 <Tim__> (use "git rm --cached <file>..." to unstage)
14:58:46 <mah0x00> new file:   hello.sh
14:59:03 <rakya77> ^
14:59:03 <skamath> Tim__, don't do that yet.
14:59:32 <FranciscoD> Great - anyone see something different?
14:59:44 <Tim__> It's green and says new file.
14:59:53 <mah0x00> +1
15:00:15 <FranciscoD> Yes - so what we've done is "staged" the file
15:00:16 <prime_> +1
15:00:26 <rm_> +1
15:00:28 <FranciscoD> this means that git is not watching the file for changes
15:01:01 <FranciscoD> In Git, you stage changes
15:01:04 <ha33> now* :)
15:01:12 <skamath> FranciscoD, not watching?
15:01:17 <prime_> ?  not watching?
15:01:26 <FranciscoD> oh, yeh - now watching
15:01:28 <FranciscoD> oops
15:01:29 <FranciscoD> XD
15:01:32 <aditya_r> FranciscoD: ack
15:01:34 <skamath> \o/
15:01:56 <skamath> I thought my whole life was a life and cross verified.
15:02:01 <skamath> s/life/lie
15:02:03 <skamath> lol
15:02:09 <FranciscoD> so each time you make some changes, you *stage* them
15:02:22 <FranciscoD> and then, you can "commit" these changes
15:02:25 <FranciscoD> let's try that now
15:02:38 <FranciscoD> `git commit -m "first commit"`
15:02:42 <skamath> There we go. The initial commit!
15:02:55 <FranciscoD> then, check status again
15:02:57 <rm_> +1
15:03:10 <aditya_r> what is '-m'?
15:03:29 <dtate_> git: "on branch master\n nothing to commit, working tree clean"
15:03:37 <prime_> ? it says : tell me who you are????
15:03:39 <FranciscoD> eeveryone that wants to know what "-m" does -> `man git-commit`
15:03:40 <rakya77> +1 "nothing to commit, working tree clean"
15:03:53 <dtate_> man git
15:04:10 <mah0x00> !
15:04:10 <ha33> same as prime_
15:04:10 <skamath> FranciscoD, If it is the first time, they will have to git config user.email and user.name
15:04:11 <FranciscoD> prime_: haha - if it's optional, you can skip that. It's asking you to mention your username and e-mail etc
15:04:31 <FranciscoD> skamath: yeh - been a long time since my "first time" with git
15:04:44 <skamath> Hahah, same. Even I just realized that.
15:04:49 <FranciscoD> I thought it just took the current user
15:04:54 <FranciscoD> mah0x00: yeh?
15:04:59 <skamath> FranciscoD, it will still require an email address.
15:05:10 <FranciscoD> skamath: nah, that's optional surely
15:05:15 <mah0x00> so do i do as it say
15:05:24 <Tim__> If it's new, it uses yoru loginname@computername.domain
15:05:30 <skamath> It will be a problem later on if you don't configure now. Pagure won't recognize you
15:05:32 <skamath> Yep.
15:05:36 <FranciscoD> yeh, sure - I'll make a note at the end on how to modify it
15:06:11 <FranciscoD> OK, let's do this then, but I won't explain it for the moment
15:06:24 <FranciscoD> Everyone create a new file in your home directory: `~/.gitconfig`
15:07:01 <dtate_> aditya_r: For those wondering, the `-m` switch allows you to specify a message on the commit line.
15:07:23 <aditya_r> dtate_, I got it thanks.
15:07:34 <aditya_r> I have done with commit.
15:07:36 <FranciscoD> and in that file, add this: https://paste.fedoraproject.org/paste/9JxLl4kg7xYKFF-G6sAw1Q
15:07:55 <aditya_r> It's saying master (root-commit) c51419c] first commit
15:07:58 <FranciscoD> if the file exists, edit it if you want
15:08:03 <FranciscoD> aditya_r: that's correct
15:08:25 <FranciscoD> Everyone at the commit?
15:08:37 <dtate_> yup
15:08:44 <rakya77> +1
15:08:49 <rm_> +1
15:09:04 <capitanocrunch_> ? is it possible to create multiple users in .gitconfig , letsay one account for pagure and one for github?
15:09:12 <prime_> +1
15:09:17 <Tim__> +1 .gitconfig file created and edited, then saved.
15:09:34 <jadupl2> +1
15:09:48 <skamath> capitanocrunch_, Instead of setting it globally, you can also have repo based settings
15:09:57 <FranciscoD> capitanocrunch_: that's the global file, so that'll only have one, but for each repository, you can have different settings
15:10:00 <FranciscoD> as skamath just sid
15:10:05 <prime_> what shoudl we add to .gitconfig file?
15:10:24 <FranciscoD> prime_: https://paste.fedoraproject.org/paste/9JxLl4kg7xYKFF-G6sAw1Q
15:10:36 <capitanocrunch_> ++ FranciscoD skamath
15:10:54 <Tim__> ? And that file goes in /home/<user>, correct?
15:10:57 <FranciscoD> OK, so we've initilised a repo, we've staged changes, and we've committed changes
15:11:06 <mah0x00> can you give 5 min i want to configure git for the first time use according to https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
15:11:10 <aditya_r> +1
15:11:11 <FranciscoD> Tim__: yes, `~/.gitconfig` would be the short cut
15:11:24 <FranciscoD> mah0x00: you can delete the file and do it again later :)
15:11:45 <FranciscoD> Now, try: `git log`
15:11:47 <mah0x00> ok
15:11:52 <sdadasdsad> git log
15:12:00 <dtate_> +1
15:12:02 <shyzus> Question: Iss this meeting topic purely done by text communication?
15:12:21 <FranciscoD> shyzus: yep, it is only over the IRC
15:12:28 <dtate_> It gives me a yellow hash , author, date, and the commit message
15:12:54 <FranciscoD> Everyone, let me know when you see details of the commit
15:13:00 <black3dynamite> +1
15:13:02 <Tim__> +1
15:13:03 <aditya_r> After 'git log' it's showing my first commit id.
15:13:04 <rm_> +1
15:13:05 <dtate_> +1
15:13:08 <LL62> +1
15:13:13 <ha33> +1
15:13:14 <aditya_r> +1
15:13:20 <krilen> +1
15:13:25 * FranciscoD will wait a minute
15:13:30 <FranciscoD> This bit is important :)
15:13:55 <jadupl2_> +1
15:13:59 <FranciscoD> Is anyone in trouble in the meantime?
15:14:14 * FranciscoD will continue at 16:15 (about 45 seconds)
15:14:43 <rakya77> +1
15:15:14 <skamath> +1
15:15:15 <FranciscoD> OK, so what you see is information on your commit
15:15:28 <FranciscoD> the first line gives you the "hash" of the commit
15:15:50 <aditya_r> Author Name
15:15:53 <FranciscoD> Each commit will have a unique hash
15:15:59 <aditya_r> Date
15:16:06 <aditya_r> and commit.
15:16:27 <FranciscoD> Yes, and then, it'll give you information about this particular commit - the author of this commit, the date, and the commit message
15:16:39 <FranciscoD> aditya_r: the whole thing, including the files you added is the commit
15:17:12 <aditya_r> FranciscoD, yes.
15:17:20 <FranciscoD> commit messages are important - Google "How to write a good git commit message" for tips
15:17:23 <FranciscoD> er.. $search
15:17:37 <FranciscoD> What does `git show` tell you?
15:17:37 <rakya77> :)
15:18:10 <krilen> commit same info as log and the code
15:18:23 <FranciscoD> krilen: the *diff* to be more precise
15:18:31 <FranciscoD> it tells you the contents of the commit - what changed
15:18:42 <dtate_> includes the code in green lines with `+` in front of each line
15:18:48 <FranciscoD> the `/dev/null` implies that the file didn't exist before
15:18:55 <krilen> this: diff --git a/Git101.sh b/Git101.sh
15:18:57 <krilen> ?
15:18:57 <aditya_r> 'git show' showing git commit + file detail.
15:19:15 <FranciscoD> krilen: that's the command that it's running - `a` is before the commit, `b` is after the commit
15:19:29 <FranciscoD> so a "diff" between the two states
15:19:54 <FranciscoD> You also have a "diff" command that's independent of Git, by the way
15:20:14 <FranciscoD> #info Homework: Search the web to learn tips on writing good Git commit messages
15:20:30 <FranciscoD> #info Homework: read `man diff` (or search the web)
15:20:49 <FranciscoD> Now, make a change to the file
15:21:15 <FranciscoD> add a new line, or change the message, or delete the line
15:21:16 <rakya77> ? so if I commit multiple times will it show diff between all those or just the previous and lastest commit
15:21:42 <FranciscoD> rakya77: `show` shows all commits in sequence, but there are ways to see diffs between particular commits and so on
15:21:51 <FranciscoD> rakya77: more homework for you ;)
15:22:01 <rakya77> thank you :)
15:22:08 <FranciscoD> When you've changed and saved the file, try `git status` again
15:22:26 <FranciscoD> Let me know if you see something new
15:22:38 <dtate_> in red it now says "modified: git101.sh"
15:22:40 <Tim__> +1 - modified and red text
15:22:43 <ha33> yeah, file modified
15:22:51 <rakya77> +1 modified
15:22:59 <FranciscoD> Does it also tell you what to do if you want to discard these changes?
15:23:04 <krilen> +1 modified
15:23:09 <FranciscoD> try that
15:23:12 <dtate_> yes
15:23:16 <black3dynamite> +1
15:23:23 <FranciscoD> git checkout <fileL
15:23:26 <ha33> yes, git checkout
15:23:26 <FranciscoD> git checkout <file>
15:23:34 <FranciscoD> check status again
15:23:36 <dtate_> done.
15:23:51 <dtate_> now it says nothing to commit.
15:23:57 <Tim__> It changed the file back
15:23:59 <rm_> +1
15:24:05 <FranciscoD> Good - because we asked it to :)
15:24:15 <aditya_r> nothing to commit, working tree clean
15:24:18 <dtate_> *panics* did I loose all my hard work? /s
15:24:25 <krilen> back before the modify
15:24:30 <rakya77> +1 lost changes
15:24:55 <FranciscoD> dtate_: well, yes, in this case, you did :D
15:24:59 <FranciscoD> echo 'echo "Git is goooood"' >>  <file>
15:25:16 <FranciscoD> then do `git diff` - see what it says
15:26:06 <dtate_> has a diff of the old file and the file with the newly added line
15:26:14 <rakya77> added the new line to the file
15:26:16 <black3dynamite> +1
15:26:24 <ha33> +1
15:26:28 <FranciscoD> OK, stage the changes
15:26:42 <FranciscoD> using `Git add`
15:26:52 <dtate_> +1
15:26:56 <FranciscoD> try diff again
15:27:01 <FranciscoD> what now?
15:27:13 <rakya77> empty
15:27:14 <ha33> nothing
15:27:16 <dtate_> nothing
15:27:18 <krilen> diff gives nothing and status is green
15:27:22 <FranciscoD> `git diff --cached`?
15:27:39 <dtate_> I have the diff of the new line now
15:27:47 <Tim__> shows the change +green
15:27:56 <aditya_r> Tim__, same
15:28:00 <FranciscoD> So, diff by default shows *unstaged* changes
15:28:07 <prime_> Oh thats great option to know...
15:28:17 <FranciscoD> when you've staged a change, git now knows about it, so you need to give a --cached flag to see them
15:28:24 <FranciscoD> Go ahead and commit this change
15:28:43 <rm_> +1
15:28:48 <dtate_> +1
15:28:51 <black3dynamite> +1 git diff shown nothing. But uisng git diff --cached worked.
15:28:52 <FranciscoD> check the commit log again: git log
15:29:06 <FranciscoD> check `git show` again
15:29:06 <aditya_r> +!
15:29:10 <dtate_> +1
15:29:13 <aditya_r> +1
15:29:13 <FranciscoD> aditya_r: question?
15:29:18 <aditya_r> no
15:29:18 <FranciscoD> ah, no worries :)
15:29:23 <rm_> +1
15:29:29 <rakya77> +!
15:29:31 <rakya77> +1
15:29:36 <prime_> +1
15:29:46 <Tim__> Now it commited with the correct email, also.
15:29:48 <Tim__> +1
15:29:48 <FranciscoD> now, try this: git show <first commit hash>
15:30:31 <aditya_r> <first commit hash> ?
15:30:35 <dtate_> So it gave me the diff of the original file. But not the newly added line.
15:30:42 <FranciscoD> aditya_r: find the hash of the first commit you had made
15:30:56 <FranciscoD> dtate_: good - it shows you what that particular commit had changed, right?
15:30:58 <skamath> aditya_r, find the commit hash from the log
15:31:11 <ha33> yes it does
15:31:12 <dtate_> yes
15:31:15 <aditya_r> done
15:31:26 <skamath> Excellent!
15:31:40 <FranciscoD> OK - run `git log` again - does it say "(HEAD -> master)" on top for you folks?
15:31:42 <rm_> +1
15:31:47 <rakya77> +1
15:31:53 <FranciscoD> (It does for me, but I may have configured it to say so)
15:32:07 <dtate_> no
15:32:11 <ha33> no
15:32:17 <rm_> yes
15:32:20 <rakya77> It does beside the latest commit
15:32:38 <FranciscoD> dtate_: ha33 : check again, right at the top next to the commit hash?
15:32:44 <black3dynamite> +1
15:33:10 <dtate_> no... nothing
15:33:19 <ha33> same
15:33:24 <FranciscoD> OK, nevermind
15:33:32 <skamath> Doesn't it show by default?
15:33:57 <FranciscoD> skamath: not sure tbh, I thought it did
15:34:11 <aditya_r> Yes it showing (HEAD -> master)
15:34:17 <skamath> try `git log --pretty=full`
15:34:25 <FranciscoD> weird that it's showing for some, and not for others
15:34:28 <skamath> Not sure if makes a difference though.
15:34:51 <FranciscoD> what's the first line in `git status`, though?
15:35:03 <FranciscoD> Does it say anything about a "branch"? ;)
15:35:14 <dtate_> On branch master
15:35:20 <ha33> On branch master
15:35:25 <skamath> For those who are wondering, it looks something like this : https://imgur.com/a/NLdwk
15:35:46 <jadupl2_> on branch master
15:35:56 <FranciscoD> Yes - let's work with branches now!
15:35:59 <FranciscoD> #topic branching
15:36:13 <FranciscoD> By default, you start with a branch - it's called "master"
15:36:20 <FranciscoD> this is purely convention - you can change it to whatever you want
15:37:00 <FranciscoD> `git branch` will tell you what branches you currently have - namely, "master"
15:37:13 <FranciscoD> to get more info, use `git branch -v`
15:37:21 <FranciscoD> that will tell you what commit this branch is currently at too
15:37:55 <FranciscoD> then, create a new branch - you "checkout" a new branch: `git checkout -b newbranch`
15:38:07 <aditya_r> 'git branch -v' -> master 3a618aa added git is good
15:38:41 <FranciscoD> after you checkout your new branch, run `git branch -v` again - see the difference?
15:39:00 <ha33> yeah
15:39:05 <dtate_> so it has the new branch, but the same info
15:39:12 <rm_> +1
15:39:13 <aditya_r> Yes, git checkout -b newbranch -> Switched to a new branch 'newbranch'
15:39:25 <FranciscoD> all a branch does, is point to a commit
15:39:29 <krilen> yes master and newbranch
15:39:32 <FranciscoD> so branches in Git are very cheap
15:39:41 <FranciscoD> make as many of them as you want, they don't cost anything :)
15:40:03 <FranciscoD> try this: `git log --graph --pretty=full --all`
15:40:06 <Tim__> Why woudl one create a new branch?
15:40:19 <FranciscoD> Tim__: I'll show you in a minute ;)
15:40:57 <dtate_> git log --graph --pretty=full --all
15:41:09 <FranciscoD> also add `--color` at the end, just to be sure
15:41:11 <aditya_r> After `git log --graph --pretty=full --all` it showing (HEAD -> newbranch, master)
15:41:25 <rm_> +1
15:41:31 <rakya77> +1
15:41:37 <FranciscoD> does it show a line on the left side?
15:41:44 <rakya77> yep
15:41:45 <dtate_> it still isn't showing HEAD
15:41:46 <FranciscoD> from the old commit to the new one?
15:41:57 <dtate_> yes
15:42:02 <rm_> +1
15:42:07 <mah0x00> +1
15:42:07 <aditya_r> +1
15:42:08 <FranciscoD> dtate_: I'll look at that later - must be a setting somewhere
15:42:13 <krilen> yepp
15:42:14 <dtate_> k
15:42:18 <FranciscoD> OK, so we're all on this new branch, agreed?
15:42:23 <dtate_> yes
15:42:25 <rakya77> (HEAD -> test-branch, master)
15:42:31 <FranciscoD> Create a new file - add another echo, save, stage, commit
15:42:37 <black3dynamite> I see multiple vertical red line
15:42:40 <FranciscoD> You'll know how to do that already :)
15:42:52 <FranciscoD> black3dynamite: that's the ascii way of showing a line from one point to another :)
15:43:04 <black3dynamite> Good to know
15:43:06 <FranciscoD> let me know when you've committed a new file everyone
15:43:38 <rm_> +1
15:44:03 <rakya77> +1
15:44:06 <FranciscoD> run this again `git log --graph --pretty=full --all --color` - see anything different?
15:44:29 <black3dynamite> +1
15:45:00 <jadupl2_> +1
15:45:04 <aditya_r> new file with committed showing on new branch.
15:45:06 <rm_> HEAD -> newbranch  (master left behind at previous commit)
15:45:17 <rakya77> ^
15:45:17 <dtate_> +1
15:45:41 <pj_> +1
15:45:43 <krilen> +1
15:45:50 <Tim__> two red lines on the left, one for each branch?
15:45:58 <aditya_r> How to switch form one branch to another?
15:46:05 <FranciscoD> the red line, is creating a "tree" of your commits
15:46:10 <FranciscoD> it'll get nicer, hold o
15:46:19 <FranciscoD> aditya_r: ah, yes, let's do that
15:46:28 <FranciscoD> you simply checkout another branch: `git checkout master`
15:46:47 <dtate_> k
15:46:48 <FranciscoD> try the full git log command again
15:46:52 <FranciscoD> what do you see now?
15:47:01 <krilen> The HEAD -> moved :)
15:47:08 <rm_> HEAD switched back to master
15:47:10 <dtate_> same thing
15:47:13 <rakya77> +2
15:47:15 <rakya77> +1
15:47:15 <skamath> \o/
15:47:19 <FranciscoD> dtate_: can't be the same thing
15:47:26 <FranciscoD> Oh, but didn't anyone notice?
15:47:33 <FranciscoD> That new file you had made - it's gone
15:47:37 <FranciscoD> ls?
15:47:38 <FranciscoD> ;)
15:47:48 <krilen> yes
15:47:53 <skamath> All my hard work gone? :(
15:47:53 <rakya77> ah
15:48:13 <dtate_> the newfile is gone but the git log is the same
15:48:25 <FranciscoD> skamath: why don't we quickly switch back to the other branch to check? `git checkout <newbranchname>`
15:48:42 <skamath> Git saved my life!!!
15:48:45 <FranciscoD> dtate_: git log --graph --pretty=full --all --color --stat  | fpaste
15:48:56 <x3mboy> I get into the git class?
15:49:01 <x3mboy> Awesome!
15:49:04 <x3mboy> FranciscoD, o/
15:49:05 <skamath> x3mboy, Welcome. I git init you.
15:49:09 <x3mboy> skamath, o/
15:49:18 <skamath> #chair x3mboy
15:49:18 <zodbot> Current chairs: FranciscoD skamath x3mboy
15:49:18 <FranciscoD> Once you're satisfied that tie file is there, switch back to master - create another new file, stage, commit, check log
15:49:34 <mah0x00> what happened?
15:49:40 <dtate_> on the newbranch : git log --graph --pretty=full --all
15:49:44 <mah0x00> the file is still
15:49:56 <dtate_> on the newbranch: https://paste.fedoraproject.org/paste/kbwhNkLD8oGZFFDOZxQWqg/
15:50:01 <aditya_r> Is git log showing commit of same branch that you switch from?
15:50:45 <dtate_> on the master branch: https://paste.fedoraproject.org/paste/8ZEzYCeRX9iTN-MbyE7GEg/
15:50:57 <FranciscoD> aditya_r: git log will show all commits
15:51:03 <mah0x00> can you explain what happing
15:51:10 <mah0x00> a little
15:51:18 <FranciscoD> mah0x00: ask me a question - easier that way
15:51:22 <skamath> dtate_, Are you sure you switched branches?
15:51:34 <dtate_> git status says I did
15:52:02 <FranciscoD> dtate_: fpaste ~/.gitconfig
15:52:24 <mah0x00> ok when i checkout to the master branch the new file gone and when checkout to the new branch the file appears again
15:52:27 <mah0x00> why ?
15:52:49 <FranciscoD> mah0x00: because you only added that file in the new branch
15:53:02 <FranciscoD> master is still at the previous commit, where the new file doesn't exist :)
15:53:15 <dtate_> FranciscoD : https://paste.fedoraproject.org/paste/0-I31thjCGsIIjmyQ-RmaQ
15:53:17 <FranciscoD> Everyone, edit your `~/.gitconfig`, and add this: https://paste.fedoraproject.org/paste/Tn5R-cTowdXFICPS41wagg
15:54:04 <FranciscoD> dtate_: add that too, then try `git lg` and see if that's better
15:54:23 <mido> #info
15:54:26 <FranciscoD> The commands I've asked you to add are "aliases" that display more information in a better formatted manner
15:54:26 <mido> #info
15:54:32 <FranciscoD> mido: info on what? :)
15:54:33 <mido> omg sorry!
15:54:38 <FranciscoD> oh, haha, no worries
15:54:39 <mido> I was trying to search
15:54:45 <mido> ctrl + f #info xD
15:54:50 <rm_> +1
15:54:54 <skamath> mido, info is a command used to log information onto the meeting minutes.
15:55:01 <skamath> Ah, okay
15:55:05 <FranciscoD> When you've added those lines, and saved the file, you should be able to use `git lg`, `git lg1`
15:55:08 <skamath> Been there
15:55:14 <FranciscoD> try them out - they'd be nicer versions of `git log`
15:55:17 <mido> I noticed that its important yeah
15:55:35 <mido> I was looking for the similar lines to get the most important things
15:55:43 <FranciscoD> Let me know when everyone's good with the aliases
15:55:47 <mido> sounds like there is home works :v:
15:55:58 <dtate_> FranciscoD : Okay, I got them and they do look nicer. It now shows me which branch my head is on.
15:56:01 <FranciscoD> mido: there's lots of homework :)
15:56:16 <mido> I just did an alias ->  alias ls="git status" :D
15:56:29 <skamath> What.
15:56:30 <FranciscoD> mido: bad idea - you can't use simple `ls` anymore
15:56:33 <jadupl2_> +1
15:56:37 <mido> thats gonna be cool xD
15:56:46 <mido> just inside my git directory
15:56:49 <skamath> mido, no more ls for you until you clear that.
15:56:51 <mido> since I will be using it a lot
15:57:06 <mido> to list the changes and etc.
15:57:15 <mido> ok I will
15:57:17 <skamath> mido, you can do alias gst="git status"
15:57:25 <mido> great! : )
15:57:56 <aditya_r> +1
15:57:58 <FranciscoD> Right - after you've checked out master, added a new commit there, do you see that the two branches have now diverged?
15:58:03 <FranciscoD> use `git lg`
15:58:27 <rakya77> +1
15:58:30 <FranciscoD> each branch is going a separate way - they're not one after the other any more
15:58:45 <FranciscoD> Tim__: is the function of branches becoming a little clearer now?
15:59:17 <FranciscoD> When there are more branches and more commits, the commits for a "tree"
15:59:18 <aditya_r> +1
15:59:19 <krilen> yes
15:59:21 <dtate_> yes
15:59:38 <FranciscoD> OK, lovely, everyone log in to Pagure!
15:59:45 <Tim__> Yes it is :)
15:59:55 <FranciscoD> Tim__: there's more, wait for it ;)
16:00:06 <dtate_> k
16:00:14 <FranciscoD> Log into pagure, click the "+" button in the top right hand corner
16:00:20 <FranciscoD> https://pagure.io/new
16:00:34 <ha33> just a little question. so usually when developers want to make a new version based on the previous one, branches is the correct way to do it?
16:00:42 <FranciscoD> Create a new project called "Git101"
16:01:07 <FranciscoD> ha33: in the usual workflow, "master" remains the "stable" branch - where code has been tested
16:01:07 <aditya_r> +1
16:01:24 <FranciscoD> different people working on different features will branch off master
16:01:37 <FranciscoD> work on their branches, and then "merge" back - we'll see that shortly :)
16:01:37 <ha33> oh i see
16:01:54 <FranciscoD> On pagure, give the project a name "Git101"
16:02:00 <FranciscoD> same for description
16:02:17 <FranciscoD> Leave everything else as it is, click "create"
16:02:37 <Tim__> The project repo "Git101" already exists
16:02:39 <dtate_> The project repo already exist...
16:02:40 <ha33> The project repo "Git101" already exists
16:02:50 <mah0x00> +1
16:02:54 <rakya77> +1
16:03:00 <FranciscoD> yeh, use: "Git101<yourname>"
16:03:12 <aditya_r> Done
16:03:25 <FranciscoD> hrm, waiting, that's new :)
16:03:30 <krilen> Did I get Git101 :)
16:03:36 <FranciscoD> krilen: I think you did :P
16:03:41 <dtate_> lol
16:03:59 <dtate_> "taking longer than usual" :p
16:04:14 <FranciscoD> Yeh - while Pagure does its thing
16:04:19 <rakya77> "This is taking longer than usual... Sorry for that"
16:04:27 <rakya77> done
16:04:28 <FranciscoD> checkout your new branch
16:04:59 <aditya_r> +1
16:05:03 <dtate_> +1
16:05:08 <FranciscoD> try `git merge master`
16:05:23 <FranciscoD> it'll open a window asking for a commit message - save and quit
16:05:33 <aditya_r> yes
16:05:36 <FranciscoD> if it's VIM, hit `escape` followed by `:wq`
16:05:45 <aditya_r> done
16:05:47 <FranciscoD> (it's probably vi)
16:05:48 <dtate_> done
16:06:21 <FranciscoD> check `git lg1` again - what do you see?
16:06:24 <FranciscoD> also check ls
16:06:27 <FranciscoD> what do you see?
16:06:52 <dtate_> There are now green bars that loop the new branch back into the master branch
16:07:25 <FranciscoD> and what does `ls` show you?
16:07:37 <dtate_> both files
16:07:50 <jadupl2_> files from newbranch are now in master
16:07:53 <jadupl2_> +1
16:07:58 <rakya77> all the files including <new-branch> files
16:08:01 <Tim__> Both files... i'm in newbranch as head
16:08:04 <rakya77> file*
16:08:09 <FranciscoD> jadupl2_: or is it the other way around?
16:08:35 <FranciscoD> look at `git lg` -> where is master?
16:08:46 <dtate_> So all the files with the changes are now in newbranch, but not the other way around
16:09:05 <FranciscoD> dtate_: easy to check - checkout the master branch, see what you've got there :)
16:09:14 <dtate_> +1
16:09:21 <jadupl2_> yes you are right the other way around
16:09:24 <rakya77> +1
16:09:36 <Tim__> master branch does not have file2
16:09:45 <FranciscoD> OK, so until now, everything we've done has been on a *local* repository
16:09:52 <FranciscoD> on your machine
16:09:58 <FranciscoD> no one else has access to any of it
16:10:06 <FranciscoD> (not yet)
16:10:24 <FranciscoD> What we've done on Pagure, is create a "remote" repository
16:10:32 <FranciscoD> #topic Remotes - on Pagure
16:10:52 <FranciscoD> #info We're using Pagure, but the same applies to Github, Gitlab, Bitbucket
16:11:18 <FranciscoD> Pagure and all the rest are just "front ends" - underneath, the same thing happens at all of them
16:11:27 <FranciscoD> Has Pagure finished creating repos for everyone?
16:11:33 <dtate_> yes
16:11:34 <rakya77> yes
16:11:49 <jadupl2_> +1
16:11:55 <FranciscoD> OK, in your terminal, type: `git remote -v`
16:12:03 <FranciscoD> it'll return nothing, because we haven't set one up
16:12:21 <dtate_> +1
16:12:26 <FranciscoD> So, we add a new remote, as pagure tells you:
16:12:39 <FranciscoD> the `git remote add ..` line - copy and paste that in your terminal
16:12:51 <FranciscoD> check `git remote -v` again
16:13:26 <capitanocrunch__> origin bla bla fetch
16:13:35 <dtate_> So now I have a line for (fetch) and a line for (push)
16:13:39 <FranciscoD> Lovely
16:13:43 <capitanocrunch__> origin bla bla (push)
16:13:46 <rakya77> +1
16:13:47 <FranciscoD> Note - the name "origin" is also convention
16:13:54 <FranciscoD> you can change it to whatever you want
16:14:00 <FranciscoD> and in a bit, we'll see that, so don't worry
16:14:38 <FranciscoD> Now, we want to make our remote in sync with our local repository
16:14:51 <FranciscoD> try: `git push -u origin master`
16:15:07 <jadupl2_> shouyld we checkout to master branch before
16:15:10 <FranciscoD> (it'll probably ask you for your pagure password)
16:15:33 <FranciscoD> jadupl2_: you can, but it won't make a difference
16:15:41 <FranciscoD> ah, well, pagure is still working on it, I can't push yet
16:15:45 <Tim__> Permission denied (publickey). fatal: Could not read from remote repository.
16:16:02 <dtate_> mine worked
16:16:18 <FranciscoD> Tim__: public key? Did you set up keys for Pagure?
16:16:26 <aditya_r> Done with git push.
16:16:32 <Tim__> nope
16:16:36 <FranciscoD> OK, everyone try it - mine's still waiting
16:16:54 <rakya77> Permission denied (publickey)
16:17:13 <FranciscoD> Do you folks have ssh keys set up on your machines?
16:17:15 <Tim__> should i use the https and not ssh?
16:17:22 <FranciscoD> yeh, use the https
16:17:26 <dtate_> If you are using the ssh:// address you probably need to set up the ssh key
16:17:31 <FranciscoD> the ssh protocol can only be used with ssh keys
16:17:39 <FranciscoD> that's good, though - modify the remote!
16:17:59 <FranciscoD> well, you can remove it and re-add it
16:18:07 <FranciscoD> or you can use `git remote set-url`
16:18:17 <FranciscoD> or you can add a new one and call it `origin1`
16:18:20 <FranciscoD> up to you
16:18:43 <FranciscoD> git remote <TAB><TAB> is quite helpful ;)
16:18:59 <FranciscoD> Ah, I managed to push too
16:19:02 <FranciscoD> Everyone pushed?
16:19:05 <dtate_> +1
16:19:23 <FranciscoD> Go to the "commits" tab on Pagure, what do you see?
16:19:41 <skamath> I don't think https push works on pagure. Does it?
16:19:50 <FranciscoD> skamath: it should, I hope it does
16:19:54 <Tim__> fatal: repository 'https://pagure.io/Git101<username>.git/' not found
16:19:58 <dtate_> I see all three commits to the master branch
16:20:13 <skamath> last time I tried, it threw a 403.
16:20:16 <FranciscoD> Tim__: change <username> to what you had called it?
16:20:28 <Tim__> I edited it before posting it publicaly
16:20:37 <rakya77> The requested URL returned error: 403 with https
16:20:47 <skamath> Yep, https push doesn't work on pagure yet.
16:20:56 <skamath> You have to set up ssh keys.
16:21:00 <FranciscoD> skamath: so one cannot use it without ssh keys at all?
16:21:07 <skamath> Don't think so.
16:21:14 <FranciscoD> we'll have to move to Github then...
16:21:37 <FranciscoD> Right, everyone login to Github then :D
16:21:41 <FranciscoD> let's create another remote!
16:21:43 <aditya_r> In Commit section it is showing all commit :)
16:22:02 <FranciscoD> Very similar - Login, hit the "+" sign on the right hand top corner
16:22:09 <FranciscoD> "New repository"
16:22:23 <DonQuixote> hi
16:22:42 <FranciscoD> Enter any name, click "create"
16:22:45 <FranciscoD> DonQuixote: hello
16:23:06 <FranciscoD> Now, you already have a remote named "origin", so you'll have to use a different name
16:23:17 <FranciscoD> `git remote add github https:.....`
16:23:25 <FranciscoD> that'll add a new remote called "github"
16:23:30 <FranciscoD> then verify with `git remote -v`
16:23:33 <Tim__> github worked:  "Branch master set up to track remote branch master from origin."
16:23:53 <Tim__> using https url
16:23:54 <DonQuixote> can i Ask a question ?
16:23:59 <FranciscoD> DonQuixote: yeh, of course
16:24:48 <DonQuixote> why i can't edit a commit message?
16:24:57 <skamath> DonQuixote, You can :)
16:25:30 <FranciscoD> DonQuixote: it's slightly advanced: https://help.github.com/articles/changing-a-commit-message/
16:25:34 <FranciscoD> everyone on github?
16:25:47 <FranciscoD> you've pushed master, also push your other branch
16:25:55 <FranciscoD> git push -u <remote> <branch>
16:26:06 <dtate_> Can I follow along on pagure since that was working for me? or are they vastly different?
16:26:25 <skamath> dtate_, It's the same. You can continue on pagure :)
16:26:29 <FranciscoD> dtate_: ++
16:26:51 <dtate_> thanks
16:27:03 <dtate_> Pushed the newbranch
16:27:32 <DonQuixote> thanks Francisco :D
16:27:44 <FranciscoD> OK, great - let's do one last thing
16:28:12 <FranciscoD> If you're on pagure, go to my repository: https://pagure.io/MyGit101/commits/master and click the "fork" button
16:28:37 <FranciscoD> If you're on Github, go to my repository: https://github.com/sanjayankur31/Fedora-classroom-Git-101 and click the "fork" button
16:28:43 <FranciscoD> let me know when you've done that
16:28:59 <dtate_> done
16:29:28 <Tim__> +1
16:29:50 <krilen> +1
16:30:07 <rm_> +1
16:30:13 <jadupl2_> +1
16:30:23 <FranciscoD> What you've done is duplicated my repository
16:30:30 <FranciscoD> you have your own copy of my repo now
16:30:57 <FranciscoD> This is also why git is great - everyone working on a project has their own copy of the code
16:31:06 <FranciscoD> so if github or pagure goes down, say, we all have our copies
16:31:21 <FranciscoD> it's a *distributed* version control system
16:31:23 <FranciscoD> OK?
16:31:27 <dtate_> cool
16:31:31 <jadupl2_> +1
16:31:39 <FranciscoD> So, you have a copy of my repo - but of my remote only
16:31:47 <FranciscoD> you need to "clone" it to make a local copy
16:32:02 <FranciscoD> in your terminal, cd out of your earlier local repo
16:32:33 <dtate_> +1
16:32:45 <FranciscoD> then find the repo's git url - on pagure, this is in the right hand bar
16:32:58 <FranciscoD> on github, click on "clone or download"
16:33:06 <FranciscoD> git clone <url you see there>
16:33:22 <FranciscoD> where before you had "pushed" to a remote, you are now "cloning" a remote
16:33:39 <dtate_> +1
16:34:03 <Tim__> copy that url?
16:34:04 <krilen> +1
16:34:15 <FranciscoD> Tim__: yes, that's the git URL to the remote
16:34:39 <skamath> Also, when you clone a fork, the origin remote is set the URL of your fork and not the parent repo.
16:34:51 <FranciscoD> +1
16:34:51 <rm_> +1
16:34:51 <skamath> ^This is something I found confusing when I started off.
16:34:52 <Tim__> +1 - ls -lash shows your "Fedora-classrom-Git-101" folder
16:34:59 <FranciscoD> Tim__: lovely, it worked
16:35:09 <FranciscoD> everyone, enter the folder you just cloned
16:35:26 <dtate_> +1
16:35:27 <FranciscoD> (btw, you can do git clone <remote url> <folder name> to change the name of the folder)
16:35:41 <FranciscoD> Now, if you run `git lg`, you should see *my* commits :D
16:35:55 <FranciscoD> See em?
16:35:58 <dtate_> +1
16:36:04 <rm_> +1
16:36:21 <pj_> +1
16:37:08 <FranciscoD> If you're on pagure, try this: `git remote add upstream https://pagure.io/MyGit101.git`
16:37:10 <pingou> skamath: too late?
16:37:21 <skamath> pingou, No :)
16:37:25 <Tim__> Looks different than mine.  It doesn't seem like my master branch merged into my newbranch
16:37:32 <skamath> Everyone, pingou is the developer of Pagure :)
16:37:52 <pingou> one of :)
16:37:55 <skamath> pingou, there were difficulties pushing via https.
16:37:57 <FranciscoD> if you're on Github, try this: `git remote add upstream https://github.com/sanjayankur31/Fedora-classroom-Git-101.git`
16:38:09 <pingou> that's expected, pagure doesn't support pushing via https :)
16:38:12 <FranciscoD> Tim__: yeh, because we've done different things with our repos :)
16:38:19 <skamath> FranciscoD hates ssh :P
16:38:34 <FranciscoD> I don't, but not everyone here has keys yet :)
16:38:49 <dtate_> nice to meet you pingou
16:38:55 <FranciscoD> After you've set up the new `upstream` remote, verify using `git remote -v`
16:39:03 <pingou> hi dtate_, same here
16:39:31 <skamath> pingou, It'd be great to know why. Even I am curious why.
16:39:36 <skamath> *now
16:39:46 <FranciscoD> You'll all have 2 remotes (at least) - one of your fork, and one for my "upstream"
16:39:59 <krilen> have it
16:39:59 <pingou> skamath: why it doesn't support https?
16:40:03 <Tim__> +1
16:40:04 <skamath> pingou, yes
16:40:19 <rm_> +1
16:40:22 <pingou> skamath: because no-one invested time to figure out how to make it work? :)
16:40:26 <rakya77> +1
16:40:37 <skamath> Sounds reasonable :p
16:40:43 <skamath> Thanks! pingou++
16:40:44 <FranciscoD> OK, now, create a new branch, call it "feature-X"
16:40:54 <FranciscoD> branch off master, by the way
16:41:02 <FranciscoD> remember - branching points matter ;)
16:41:30 <dtate_> +1
16:41:31 <pingou> skamath: iirc, gitolite does allow it, but I have no idea how
16:41:40 <Tim__> error: pathspec 'feature-x' did not match any file(s) known to git.
16:41:49 <FranciscoD> or call it "feature-yourname" rather - you're all going to open pull requests, so that'll be a bit confusing XD
16:41:58 <FranciscoD> Tim__: git checkout -b branchname
16:42:08 <FranciscoD> you probably forgot the -b bit
16:42:24 <Tim__> Yup, thanks!
16:42:28 <dtate_> can I rename a branch? Or should I just make a new one with the name?
16:42:30 <FranciscoD> happens to me quite a bit
16:43:07 <FranciscoD> dtate_: you can move it, sure  `-m`, but make a new one anyway
16:43:12 <FranciscoD> remember - branches are *cheap*
16:43:15 <dtate_> k
16:43:33 <Tim__> Won't empty branches cause clutter?
16:43:49 <FranciscoD> Tim__: they're not empty, they're pointing to the same commit
16:44:01 <FranciscoD> you can remove them afterwords
16:44:51 <FranciscoD> In this new branch, add a new file - yourname.txt - in it say something like `Hello from London!` - stage, commit, push
16:45:31 <FranciscoD> Then go to your fork on pagure/github
16:45:55 <FranciscoD> Let me know when you've pushed and gone back to your fork :)
16:47:37 <FranciscoD> in the browser, that is
16:47:38 <krilen> done
16:48:03 <FranciscoD> On github, it'll display a message at the top on the lines of "Compare and pull request"
16:48:19 <Tim__> when in your "local" remote fork... are we pushing origin or upstream?
16:48:39 <rm_> ?
16:48:44 <rm_> How do I switch to a fork?
16:48:49 <FranciscoD> Tim__: you can't push to upstream, you only have "read" rights - you can only push to your fork
16:49:10 <FranciscoD> rm_: the repo you've cloned is the fork - check using `git remote -v`
16:49:36 <rm_> Ok.. got it +1
16:49:44 <FranciscoD> effectively, what you're doing is: you've cloned the main repository for a project, called "upstream"
16:49:49 <dtate_> ? I committed to my new branch "feature-x-name" but it won't let me push it. says "src refspec... doesn't match any"
16:50:01 <FranciscoD> you are all "downstream" from it
16:50:08 <FranciscoD> dtate_: tell me the command you used, please?
16:50:22 <dtate_> git push origin feature-x-name
16:50:45 <FranciscoD> is feature-x-name the right branch name?
16:50:52 <FranciscoD> `git branch` and check
16:51:05 <Tim__> Your recently pushed branches: feature-tim_ (1 minute ago)
16:51:20 <dtate_> well with the full feature-x-dtate which what I used in the full command
16:51:24 <FranciscoD> Tim__: and does it say "compare and pull request"?
16:51:38 <FranciscoD> dtate_: then the branch name is "feature-x-dtate" and you must use that
16:51:57 <dtate_> I did, and it failed.
16:52:24 <FranciscoD> dtate_: and origin refers to your fork?
16:52:41 <dtate_> oops... you are correct, I typoed "feature" :p
16:52:47 <FranciscoD> ha, no worries
16:52:56 <dtate_> now I look like an idiot
16:53:19 <FranciscoD> Tim__: create a pull request?
16:53:23 <rm_> I used 'git push origin feature-rm' and receive 'permission denied'
16:53:36 <FranciscoD> rm_: pagure or github?
16:53:39 <rakya77> same as rm_
16:53:43 <rm_> github.. sorry
16:53:45 <rakya77> on github
16:53:48 <FranciscoD> and is origin your fork?
16:54:01 <FranciscoD> and is it using https?
16:54:04 <rm_> I thought it was.  How do I check?
16:54:08 <FranciscoD> `git remote -v` will tell you
16:54:50 <rm_> origin	https://github.com/sanjayankur31/Fedora-classroom-Git-101.git (fetch) origin	https://github.com/sanjayankur31/Fedora-classroom-Git-101.git (push)
16:55:04 <rm_> That's the output of git remote -v
16:55:10 <rm_> (for origin)
16:55:22 <FranciscoD> ah, and is there another entry for your fork?
16:55:37 <FranciscoD> You can all only push to your forks - you don't have write access to my "upstream" repository
16:55:58 <FranciscoD> you can do what you want with your fork, but with the main "upstream" repository, you only have read access.
16:56:05 <FranciscoD> so push to your fork
16:56:14 <FranciscoD> git push <name of fork remote> <name of branch>
16:56:23 <rakya77> done
16:57:10 <FranciscoD> rm_: work for you?
16:57:15 <FranciscoD> Tim__: you've already pushed, I gather?
16:57:23 <FranciscoD> dtate_: pushed to the fork?
16:57:29 <dtate_> yes...
16:57:33 <Tim__> yes I pushed to my fork
16:57:38 <dtate_> and I created a pull request
16:57:46 <FranciscoD> Ooo - let me check!
16:57:59 <FranciscoD> The folks on github - create a pull request too
16:58:07 <rakya77> I had origin and upstream with same url >  https://github.com/sanjayankur31/Fedora-classroom-Git-101.git , then I removed origin and added origin with my fork url
16:58:14 <Tim__> https://github.com/tjgruber/Fedora-classroom-Git-101/tree/feature-tim_
16:58:16 <FranciscoD> rm_: nice!
16:58:21 <Tim__> Not sure if I did it right
16:58:22 <rm_> OK!  FInally! +1
16:58:54 <Tim__> It's in tree
16:59:05 <FranciscoD> Tim__: go back to the overview of your fork
16:59:26 <FranciscoD> there, it says "your recently pushed branches" - and on their right, it'll say "compare and pull request"
16:59:47 <FranciscoD> Folks on pagure - see your pull requests here: https://pagure.io/MyGit101/pull-requests
17:00:07 <FranciscoD> Folks on github, see them here: https://github.com/sanjayankur31/Fedora-classroom-Git-101/pulls
17:00:17 <FranciscoD> let's wait for a few minutes
17:01:05 <Tim__> Yes I see my "recently pushed branches" and the "compare and pull request" button.
17:01:17 <FranciscoD> Tim__: click the compare and pull request one
17:02:03 <Tim__> And then click "Create pull request" button?
17:02:54 <FranciscoD> yeh
17:03:45 <FranciscoD> Lovely
17:03:48 <FranciscoD> I merged them all!
17:04:10 <dtate_> Nicwe
17:04:11 <FranciscoD> if you look at the commits now, you'll see your commits there too
17:04:25 <FranciscoD> let's do one last thing and call it a day
17:04:40 <FranciscoD> git fetch <remote referring to upstream> master
17:05:12 <FranciscoD> git fetch <remote referring to upstream>
17:05:13 <dtate_> k.
17:05:15 <FranciscoD> will do actually
17:06:11 <FranciscoD> try that now..
17:06:22 <rm_> +1
17:06:38 <dtate_> +1
17:06:45 <FranciscoD> so, you've asked git to "fetch" changes from the upstream remote
17:06:56 <FranciscoD> nothing will change, you've only "fetched"
17:06:58 <FranciscoD> OK?
17:07:00 <Tim__> git fetch origin master?
17:07:13 <dtate_> Ok...
17:07:18 <FranciscoD> Tim__: git fetch <whatever the upstream remote is called>
17:07:53 <krilen> +1
17:08:19 <rakya77> git lg now shows commits from me and others
17:08:46 <FranciscoD> rakya77: yep, but you'll notice, it'll always say that they're on the remote
17:08:51 <FranciscoD> your local branches will be unchanged
17:09:05 <FranciscoD> to apply these to your locals, use this:
17:09:12 <FranciscoD> git checkout master (to get on master)
17:09:25 <FranciscoD> git merge <upstream name>/master master
17:09:48 <FranciscoD> this is asking git to merge the changes that it found on the remote to your local repository
17:09:59 <FranciscoD> then, try `git lg` - see what happened
17:09:59 <rm_> +1
17:10:08 <FranciscoD> One or two things to remember:
17:10:21 <FranciscoD> always *always* make sure you've updated your local copy to match upstream
17:10:33 <FranciscoD> because if you make changes, and I've made changes in the meantime, we'll have clashes
17:10:46 <FranciscoD> so before you open a pull request, make sure you update your fork
17:11:05 <FranciscoD> did everyone fetch changes from my upstream repo?
17:11:22 <rakya77> +1
17:11:32 <dtate_> +1
17:11:33 <pj_> +1
17:11:55 <rm_> +1
17:12:41 <FranciscoD> Tim__: did that work for you?
17:12:55 <FranciscoD> now if you push to your fork, you'll update it too
17:13:11 <FranciscoD> so - a) update your local from my upstream; b) push to your fork to update it as well
17:13:17 <Tim__> I think i need to make a flow chart of commands for this
17:13:23 <dtate_> hahaha
17:13:27 <rakya77> :)
17:13:29 <FranciscoD> Tim__: hold on, I have one already
17:13:52 <FranciscoD> Anyway, let's close with lots of homework!
17:13:55 <FranciscoD> #topic homework
17:14:22 <FranciscoD> 1. Read the git book - https://git-scm.com/book/en/v2
17:14:35 <FranciscoD> 2. Here's an interactive cheat sheet: https://ndpsoftware.com/git-cheatsheet.html
17:14:40 <Tim__> I got it merged:  "git merge https://github.com/sanjayankur31/Fedora-classroom-Git-101.git", but if I add /master master or any combination after it< i get error
17:14:48 <FranciscoD> 3. When in doubt, search
17:15:01 <FranciscoD> Tim__: ah, you don't need to specify the URL there - the name of the remote will do
17:15:29 <FranciscoD> I should probably info the homework..
17:15:37 <FranciscoD> #info 1. Read the git book - https://git-scm.com/book/en/v2
17:15:47 <FranciscoD> #info 2. Here's an interactive cheat sheet: https://ndpsoftware.com/git-cheatsheet.html
17:15:51 <Tim__> Oh, there's my problem.  I dont' knwo the name of the remote
17:15:58 <FranciscoD> #info  3. When in doubt, search
17:16:04 <FranciscoD> Tim__: git remote -v :)
17:16:17 <FranciscoD> #info 4. Another cheatsheet: https://www.git-tower.com/blog/git-cheat-sheet/
17:16:32 <FranciscoD> #info 5. Pull requests: https://help.github.com/articles/about-pull-requests/
17:16:44 <FranciscoD> #info 6. Good commit messages: https://medium.com/@steveamaza/how-to-write-a-proper-git-commit-message-e028865e5791
17:16:49 <Tim__> okay, according to that it's called "upstream"
17:16:59 <FranciscoD> https://xkcd.com/1597/
17:17:05 <FranciscoD> https://xkcd.com/1296/
17:17:19 <FranciscoD> #info 7. Consider setting up keys: https://mikegerwitz.com/papers/git-horror-story
17:17:29 <FranciscoD> #info 8. Remember the man pages!
17:17:32 <FranciscoD> Right
17:17:37 <FranciscoD> I think that's quite enough for one day
17:17:38 <FranciscoD> XD
17:17:45 <FranciscoD> skamath: 3 hours today :D
17:17:47 <dtate_> :)
17:17:57 <FranciscoD> let's close the meeting
17:18:07 <dtate_> Thanks for all of that FranciscoD. I think I learned a lot.
17:18:13 <FranciscoD> Thanks everyone for coming! :)
17:18:14 <Tim__> Thank you!
17:18:20 <ha33> thank you :)
17:18:21 <FranciscoD> if you have an FAS account, let us know!
17:18:26 <FranciscoD> #endmeeting