PBS_2024_10_10
An audio podcast where Bart Busschots is teaching the audience to program. Associated tutorial shownotes are available at https://pbs.bartificer.net.
Automatic Shownotes
Chapters
Introduction to Programming by Stealth
Exploring Git Submodules
Git on iOS Devices
Navigating the Files App
Setting Up Local Git Repositories
Connecting to GitHub
Managing Remotes in Git
Fetching and Pulling Changes
Workflow Using Working Copy
Conclusion and Reflections
Long Summary
This week on Programming by Stealth, we dive into Tidbit 9, recorded on October 10th, 2024. In this episode, co-hosts Alison Sheridan and Bart Bouchotts take a fresh look at Git, focusing on a powerful feature known as submodules. They discuss how this feature can effectively address challenges they're facing in their podcasting workflow and their ongoing projects.
Our discussion sets the stage for learning about how Git isn't restricted to powerful desktops; instead, we explore its capabilities on mobile devices. With the evolution of iOS, we emphasize the potential for full Git functionality on iPhones and iPads, debunking the myth that these devices are not suitable for serious development work. We note that while iOS prioritizes security through its sandboxing architecture—where each app operates independently—newer iOS features now allow more integration between apps, specifically through the Files app.
Alison shares her experiences grappling with Git as she builds her confidence, often noting her frustrations, particularly when it comes to integrating Git workflows into her non-programming landscape. She recounts the learning curve that comes with using Git through command-line interfaces and various applications on her devices. By leveraging submodules, both she and Bart express excitement about the possibilities of simplifying their workflows, making collaboration easier while working on projects like show notes.
We delve into the technicalities of file management within the Files app. Bart explains the intricacies of navigating this app to create local Git repositories, explaining how to connect them seamlessly to remote servers like GitHub. They go through the steps required to establish a proper Git workflow on mobile by using local directories for Git repositories while sharing tricks to link these repositories efficiently across applications. Emphasis is placed on the importance of not storing repositories in cloud-synced folders, which can cause conflicts and disrupt collaboration.
Their playful banter highlights the evolution of text editors and Git clients available on iOS. Bart introduces the tools he uses, such as Textastic and Working Copy, explaining their functionalities and how they intersect with Git processes, whether through commits, pulls, or merges. The conversation turns technical when discussing how to handle conflicts, particularly those that may arise during collaborative efforts, cautioning listeners on best practices to prevent chaos when managing their workflow on mobile devices.
Through practical examples and user anecdotes, Bart and Alison present a compelling case for embracing Git on iOS. They underscore the ease of editing documents in various text editors while managing the Git repository through Working Copy, demonstrating that the barriers once associated with mobile development environments are gradually dissolving. They emphasize how the new iOS capabilities offer users a sophisticated yet charming way to develop, communicate, and manage their projects on the go.
Listeners are encouraged to embrace this newfound knowledge to improve their workflows, tackle challenges head-on, and maintain productivity—regardless of whether they're seated at a desktop or enjoying a walk with their mobile devices. Bart and Alison conclude with a reminder of the importance of continuous learning in computing and collaboration, leaving the audience inspired to explore the Git features discussed in today's episode.
Our discussion sets the stage for learning about how Git isn't restricted to powerful desktops; instead, we explore its capabilities on mobile devices. With the evolution of iOS, we emphasize the potential for full Git functionality on iPhones and iPads, debunking the myth that these devices are not suitable for serious development work. We note that while iOS prioritizes security through its sandboxing architecture—where each app operates independently—newer iOS features now allow more integration between apps, specifically through the Files app.
Alison shares her experiences grappling with Git as she builds her confidence, often noting her frustrations, particularly when it comes to integrating Git workflows into her non-programming landscape. She recounts the learning curve that comes with using Git through command-line interfaces and various applications on her devices. By leveraging submodules, both she and Bart express excitement about the possibilities of simplifying their workflows, making collaboration easier while working on projects like show notes.
We delve into the technicalities of file management within the Files app. Bart explains the intricacies of navigating this app to create local Git repositories, explaining how to connect them seamlessly to remote servers like GitHub. They go through the steps required to establish a proper Git workflow on mobile by using local directories for Git repositories while sharing tricks to link these repositories efficiently across applications. Emphasis is placed on the importance of not storing repositories in cloud-synced folders, which can cause conflicts and disrupt collaboration.
Their playful banter highlights the evolution of text editors and Git clients available on iOS. Bart introduces the tools he uses, such as Textastic and Working Copy, explaining their functionalities and how they intersect with Git processes, whether through commits, pulls, or merges. The conversation turns technical when discussing how to handle conflicts, particularly those that may arise during collaborative efforts, cautioning listeners on best practices to prevent chaos when managing their workflow on mobile devices.
Through practical examples and user anecdotes, Bart and Alison present a compelling case for embracing Git on iOS. They underscore the ease of editing documents in various text editors while managing the Git repository through Working Copy, demonstrating that the barriers once associated with mobile development environments are gradually dissolving. They emphasize how the new iOS capabilities offer users a sophisticated yet charming way to develop, communicate, and manage their projects on the go.
Listeners are encouraged to embrace this newfound knowledge to improve their workflows, tackle challenges head-on, and maintain productivity—regardless of whether they're seated at a desktop or enjoying a walk with their mobile devices. Bart and Alison conclude with a reminder of the importance of continuous learning in computing and collaboration, leaving the audience inspired to explore the Git features discussed in today's episode.
Brief Summary
In this episode of Programming by Stealth, co-hosts Alison Sheridan and Bart Bouchotts dive into Git submodules to enhance their podcasting workflow. They discuss the capabilities of Git on mobile devices, highlighting how advancements in iOS facilitate serious development.
Alison shares her challenges with Git integration and Bart explains managing local repositories through the Files app while connecting to remote servers like GitHub. They also explore tools like Textastic and Working Copy, covering conflict management best practices. The episode encourages listeners to embrace Git on mobile to improve their workflows and embrace continuous learning.
Alison shares her challenges with Git integration and Bart explains managing local repositories through the Files app while connecting to remote servers like GitHub. They also explore tools like Textastic and Working Copy, covering conflict management best practices. The episode encourages listeners to embrace Git on mobile to improve their workflows and embrace continuous learning.
Tags
Programming by Stealth
Git submodules
podcasting workflow
iOS development
Git integration
local repositories
Files app
remote servers
conflict management
continuous learning
Transcript
[0:00]
Introduction to Programming by Stealth
[0:00]Music
[0:07]Well, it's that time of the week again. It's time for Programming by Stealth. And this week, we have Tidbit 9. We've recorded this on October 10th, 2024. I'm your host, Alison Sheridan. And of course, I'm joined by your co-host, Bart Bouchotts. How are you doing today, Bart?
[0:21]I am doing very good today. I have had a very good day of nerd fun that I'm sure people will hear about on the Nacilla Castor and something else at some stage. But it's been a day of fun. And because it's been a day of fun, I didn't have time to write show notes for what we're planning to do. So I'm going to set a little scene here.
[0:44]
Exploring Git Submodules
[0:38]This tidbit is perfectly timed because in the main feature, I guess we call it a main feature. In the main feature, we're about to revisit Git to learn about a very powerful feature of Git called submodules because they solve two problems. One of them is directly related to what we're doing in Programming by Stealth in terms of the XK PassWD rewrite. And the other one is related to what myself and Alison do every second week, which is record segments for the No Silicast podcast. And so we have two problems that we can both solve with submodules. So it seems like the perfect time to go back and learn that power feature of Git that I intentionally skipped because I thought we'd loaded our brains with enough. We've done a lot of Git.
[1:27]And this is something I'm really excited about too, this particular tidbit that we're going to go into. But I'm also very excited about sub-modules solving a problem. Like Bart says, we eat the dog food by doing the show notes in Git. And I complained to Bart about it all the time. I would say every week to week and a half, I'm telling him why I hate it. But it's forced me to learn how to use it and just get better and better at it over time. Because to be honest, I don't do that much programming. So it would get rusty real quickly, but he forces me to use it all the time. So we have new problems to be solved.
[2:03]
Git on iOS Devices
[2:01]But today we're going to play. We're going to have fun.
[2:03]We are. So we are going to learn that Git doesn't only live on your big, heavy computers. It also can live in your pocket or, I guess, wherever you do with an iPad.
[2:14]Basically, iOS has evolved since its very early days, and you can now do full-on Git coolness, including the sub-modules we're going to learn about in future installments, right on your iPhone or on your iPad. And this came as a surprise to me, because when iOS released, one of its selling points, and it's still a selling point, was that it was a security-first architecture. Steve Jobs felt that the user should never know that there was a file system. So the devices will be really easy to use and under the hood every app lives in its own little playpen all by itself they're called sandboxes is the jargon word but I'm going to call them a little playpen so when you install your favorite text editing app it gets a little playpen where you can save files for it and then when you install a different app it gets its own little playpen and it keeps its files there and so in my brain that's not good for git because in my brain you have a git client and that gets files onto your iphone and then they're in the git clients little playpen and then you get your favorite text editor and you go to open the files only it's in a different playpen so it has no idea but the cool toy sitting in the other playpen, And that would never work. So in the original iPhone, you would have needed a single app that was simultaneously a great Git client and the perfect text editor for every type of file you plan to work in. So a great JavaScript editor, a great Perl editor, a great Markdown editor, a great plain text editor.
[3:41]I don't know about you, Alison, but how opinionated are you about your text editors?
[3:46]All of them have different uses and I have to keep them all on my machine at the same time. So no, there's no perfect one.
[3:53]Exactly, that's the sign of a true programmer. If you're a real coder, you have not a text editor, you laugh at the idea of a text editor. You have millions of text editors.
[4:05]It does seem like a disease.
[4:07]It didn't stop evolving. If you want to not use the power of iOS, you can continue to pretend that there is no file system. You can continue to pretend that iOS does not, under the hood, have exactly the same file system as your Mac does.
[4:23]
Navigating the Files App
[4:23]But if you don't want to pretend, Apple have allowed you to take the blue pill, if I'm going to mix all of my metaphors together here, and actually have a look a little bit under the hood. They don't let you all the way in, but they let you a little bit under the hood. And that's the Files app that is now a standard part of iOS. The wonderfully named, try Google it, the Files app, like the Photos app, like the contact app oh so helpful you're on mute there Allison.
[4:51]Sorry yeah along with mail calendar photos like you said
[4:58]Yeah, so the Files app lets you see all the play pens and the play pens will have the little icon of the app that made the play pen or that the play pen belongs to. But there's a section called iCloud Files, which is where you can put files that you want to sync across all of your devices. Or for our purposes, there's a section called On My iPhone or On My iPad. And those are your local files. That is like a local folder on your Mac. And so if you can make folders in there, you can move files around in there, you can rename files. It's like a little mini finder. So you can make a folder in there and call it my git repo. And the second piece of magic...
[5:40]Let me tell you why you do it there. Sorry, we're going to just pause there for a second. I don't know if you remember, but when you were first teaching me git, I thought, you know what would be perfect is if I put my git repos in iCloud. And to say that was a failure would be an understatement. I mean, it trying to do syncing while Git was trying to do syncing, not syncing and only pulling and pushing. And it was a nightmare. So you don't want your Git repos in anything that's being synced by something else. Don't put it in Dropbox. Don't put it in Google Drive. Don't put it in OneDrive. Put it on your iPad and on your Mac.
[6:14]Exactly. So this is why the on my iPhone or on my iPad is where you want to be. And the second piece of the magic. So the files app lets you, the human, poke around, but Apple also provided APIs for developers who make apps to allow those apps to ask for permission from you, the human being, to leave the playpen.
[6:35]
Setting Up Local Git Repositories
[6:35]The app can't do it without you pushing i say pushing tapping right if no human taps the app is trapped in the playpen but there is a mechanism where the app can ask the human to let it out and then the human goes and picks a folder and then what's happening is the operating system is saying there is a teeny tiny pinhole in this in this little sandbox and this one app is allowed to that one folder that the human being went tap open so when you use that file picker to open an app you are granting the app access out of its playpen to that one file or folder that you tapped on so if you give it a folder then everything in that folder including all the subfolders is now available from the app and so you can now have a git app that you say you have permission to use this local folder and then it can do its git magic and check out 20 million branches and all that kind of cool stuff and it'll actually make a little dot git folder under the hood just like it would on your mac but it's a hidden folder so you won't see it and you can do all of your branches and all of the stuff you're used to doing in your git client and that will now be sitting in your iphone on a local folder and then you get a good text editor that supports the files api and then you go into your favorite text editor and go either open or link so a lot of the text editors let you link a folder so that the next time you open the text editor it's in your list of possible files waiting for you always okay and so if you link your git repository in your text editor of choice then you just open the text editor edit away to your heart's content.
[8:05]And then when you're ready to commit, you open your Git app and you commit or pull or push or whatever it is you want to do. And that's just like what I do on the Mac, right? I have Git Kraken as my preferred Git client on the Mac. So I use Git Kraken to push and pull and get my stuff. And then I open up VS Code at the moment as my IDE du jour.
[8:24]So I work away in there. Although actually, that's only for PowerShell, which I'm doing a lot of in work. Actually, no, I'm still using. Oh, what's the name of that lovely Markdown editor we like? It's open right now typora thank you why don't i look in the menu bar yeah typora there it is so i've you know on my i use typora i edit away and then i go back to get cracking on my iphone i use an app called textastic um which is a sort of a portmanteau of text and fantastic textastic, um and so and a git client called working copy and this is where we have to give a hat tip to Nocilla Castaway extraordinaire, Jill of Kent. There may or may not be woods, and there may or may not be north of Kent, but not the same Jill. This is Jill of Kent, not Jill of the Northwoods, or from the Northwoods.
[9:12]Wait, Jill from the Northwoods, Jill of Kent. This is Jill of Kent.
[9:16]Yes, I think I got it right, but you definitely got it right, so we'll go with what you said.
[9:22]So she told us a long time ago that we could do this, right? That we could do it on our iPads.
[9:29]In iphones yeah and i've been doing it behind the scenes without telling you for at least a year and i know that jill told us even before then but i i have only so much time for experimenting and i have to prioritize things and it's been you know you know that list of things i really should dot dot dot this get on ios, Because I thought this is complicated, but actually, it turns out, well, it is. It is still a little complicated because working copy has the advantage of being really powerful and the disadvantage of suffering from what I call by Linux nerd for Linux nerd programming. The UI is a little rough at times.
[10:12]Well, you know, it's odd. It's pretty. Pretty so it's not like you're you know it doesn't look linuxy it doesn't look uh you know um cold war era program or design the design is very pretty but the icons either make no sense or they're not labeled or it turns out if you press on the word you get something different than if you press on the icon that's next to the word you get something completely different so We're going to try to be fairly specific on this. By the way, Textastic is $10, and it runs on the Mac, the iPhone, and the iPad. I don't know if you have to try it separately. Working Copy, I think I made a note on that of what that costs. That's $14.99 for the Pro version in order to do it, $15.
[11:03]Okay, good. Well, not good, but yes. There are probably, in fact, there are certainly other alternatives. this is the path I've gone down. So this is an example of, as opposed to the only way to, because basically this model, a Git client, plus a local folder, plus a text editor will work. The magic is the local folder acting as the bridge to connect everything together. So as long as you have a text editor that uses folders and a Git client that uses folders, you're away. These are just the two I'm using.
[11:39]Right, so big picture-wise, that is the setup. Make a local folder, clone into it, edit it in your favorite text editor.
[11:45]
Connecting to GitHub
[11:46]That is big picture, all we're doing. But there is a walkthrough of how to do this using working copy and textastic, and you could use any Git server, but I'm going to be using GitHub, because that's where I live. And hey, we've all sort of made our home there while doing the PBS series, because that's what we use for all of our examples once we learned about remote repositories in the main main feature so in order for this to work it's just like on your mac you're going to have to have your ssh keys and stuff so inside working copy you can make an ssh key and then it'll give you the public key to stick into your github and then you can check out sorry you can clone repositories and so forth with your ssh key just like you do to your mac but now you're doing it to your iOS device.
[12:37]Yeah, I don't remember the specific step. I've gone through these instructions after Bart wrote up the structure of it, and some parts were hard, and that part wasn't. I don't remember exactly how it worked, but I remember it going, yeah, you want some SSH keys? Sure, okay. And it authenticated with my face and did it. So I didn't have to do much to get into it, but I did have to do something. I think I had to look at my face ID
[13:03]Yeah, and I have very much yadda yadda in the show notes because by the time I got as far as writing up these instructions to myself, I had long ago set up working copy and I couldn't get back to zero. So I sort of said, prerequisite, get working copy connected to your Git server of choice. It could be GitHub, it works. But yeah, I'm afraid that is an exercise for the listener or the reader. There is no viewer, just listener or reader.
[13:25]It did walk me through fairly easily. I did it hours ago and I can't remember how I did it, so it was easy. because I remember all the hard parts.
[13:35]Yeah, exactly. That's exactly how it works. So assuming you have those prerequisites, the first thing to do is to go to the Files app and make your local folder. So basically, you open the Files app, which you may or may not have ever used, and then you go to On My iPhone or On My iPad, which is a top-level area within the Files app. You may see other areas. If you're a Dropbox user, you'll probably see an area for Dropbox. You'll probably see an iCloud area, but there's going to be one of those areas labeled On My iPhone or On My iPad. And in there click the button to make a new folder and name it whatever you like just remember what you named it i start mine with git dash and then whatever it is i want to do.
[14:15]So in this case i called mine as i went through it i called it git pbs so if we can just use that terminology so we have something that's the local folder that we made uh was git pbs
[14:25]Perfect so that folder now exists on your iPhone. So the next step is to go into working copy and tell working copy that we would like to start using that folder as a git repository. And so working copy can either check stuff out into its own little playpen, which is what happens if you go, you click the plus button, which used to be a plain old plus, but then they made it complicated by making it be, working copies fingerprint icon with a teeny tiny plus this.
[14:57]Is where we're going to be uh actually confusing things i think we ended up actually no you're right you're right it was it was the fingerprint with the plus but you got to get into the right place to find that fingerprint with the plus
[15:10]Well it's at the top level so the first time it's easy because the first time you open the app you're at the top level what you'll find is it's folders inside folders inside folders in working copy and it's very hard to find your way to the top, i find anyway but when you open it first you're at the top yeah so when you're at that top and you click that little plus well hidden plus icon one of the options is to clone a repository which sounds like what you want clone oh yeah great i'll do that that will that will clone but it will clone into the playpen that belongs to working copy, not into a generic folder.
[15:49]Yeah, this is what Allison did when she followed the instructions. And after I was done, I was like, okay, I made that Git PBS folder, and there's nothing in it. How am I looking at the files? And back out when you're looking at the files app where you can see iCloud and Dropbox and on my iPhone or on my iPad, there's now a new one called Working Copy. And so the files are in their sandbox inside Working Copy, which is fine if you don't want to use an external text editor. but the point of this is to try to do both. That's kind of what Barton is trying to teach us here. So don't clone the repo, which seems like the obvious thing to do.
[16:27]It does, doesn't it? Yeah. So instead you want to link to external folder and that will give you the file picker and let you navigate to the folder you just made. And then you select it and you're effectively...
[16:41]So you hit the fingerprint with the plus on it, you hit link external repository, and then you hit directory. So you're taking the external repository and linking it to this directory that you just created out in the files app
[16:55]Yeah perfectly clear totally clear so what you then have when you've done that link is you then have a local git repository that is as if you had just gone git init on your mac and never told it about any other server anywhere just into any empty folder it went git init that's the equivalent of what you've just done there. So now you have a completely empty Git repository. So the next thing you have to do is tell that completely empty Git repository that you would like to pair it because a Git is a peer-to-peer relationship. So you want to add a remote to use the Git lingo, which is going to be your
[17:37]
Managing Remotes in Git
[17:34]server, or GitHub in our case is our server. And so you got to then do a little bit of jiggery-pokery to get to that stage. So, When you're going into that newly linked directory, you're going to have to tell working copy that while we're using this empty Git repository you've just made, I need you to use this particular username and password that we created earlier, which is called an identity is the official jargon. And this is where we get into this bio Linux for Linux for the first time, because you have to click on the word configuration on one of these devs.
[18:15]Back up, you're going a little bit too far here. Let's back up just a minute here. So we've created this linked folder that's in the files app. And by the way, it gets a little link next to it if you've done it right. If you've done it wrong, it doesn't. So what we're going to need to do is we're going to, we need to tell this to be connected to our repo on GitHub. So in order to do that, you want to go into that linked shared folder first, which I didn't do the first time. So you want to go into it, and now you're going to see a page that has a whole bunch of stuff on it, and one of the things is going to be your username on GitHub, for example, maybe. Mine says podfeed at users.noreply.github.com. I don't know where no reply comes.
[19:04]Let's back up a second. So these people are going to be arriving at a completely empty new folder. So all they're going to see is one thing at the top that says repository as the English, and then it's going to have a chevron to the right. And that chevron is disconnected from the word repository. It looks like one big button. If you click on the chevron, it does one thing. If you click on the word repository, it does something completely different. And this drove myself and Alison crazy in the pre-show because we couldn't figure out how I had figured out what to do because we both accidentally clicked on the wrong half of the apparently single button. But you click on the word repository.
[19:45]It says repository, status and configuration on kind of the left side. And on the right side, it shows a thing that looks like branches and a chevron to the right. Once you have gotten all of this stuff linked together, that's a fun little place to go look at. It's basically the branch tree that you're used to seeing in a regular Git repo. That's lovely, but it's going to be empty if you click it before you actually connect up to your repo. So you want to click on repository, and that's where you're going to be able to see one identity and one identity. Or more.
[20:17]You're going to have to click the configuration button next, and then you're going to see a list of identities. And if there's only one identity, it looks like it's already selected because you only see one. But it isn't selected. Because when you click on it, it gets a tick box. Now it's selected. And there's no save button. So at this point, I was scratching my head again. But you just back out of it.
[20:36]How you figured out to tap that is a miracle. I'm not sure it was quick. I'm looking at his instructions going, And he's telling me to tap on my identity. There's my name. Okay, I'll tap it. And all of a sudden, this big checkbox comes open. And I'm like, oh, now I've told it, pick that one.
[20:58]Yeah. Yeah, it took me a while. I don't know how many not Boy Scout safe words, I believe, is the phrase you prefer. There may have been some shouting. Anyway, there's no save button. Once you've ticked it, it's ticked. So now you hit the back button to go back to where you were. And now we're ready because we know about a username and password so now we're ready, to actually go and connect to a remote server so there's a blue button so you're going to see a section labeled remotes which is actually a list but it's a list of zero items so it doesn't look like a list yet it just says remotes and then a blue button add remote that's the button we want, and you can click that button and then simultaneously you want to switch to safari, and go navigate to your github repository and copy the ssh url for the repository you want to clone you want you want to you know you want to add to this folder and once you have that in your clipboard then you paste that in after you hit the add repository button and now working copy, is going to call the server origin which is what we're used to seeing inside git kraken right we We see GitHub as being called Origin.
[22:12]Let me stop you for just a second. So he's right. You hit the blue button that says you want a new remote, and you want to paste in the URL for the SSH URL. There's a whole bunch of other buttons there. Don't touch anything. It says fetch, merge, push, synchronize, name, allow fetch, allow push, test, create repo, which is kind of interesting, so that might be useful later. But all you want to do is tap on URL, paste it in, and I'll go back again.
[22:37]Yeah. And now you'll see it sitting there. Under remotes it'll say origin and then you still have the blue button because you could in theory add infinitely many remotes right there are scenarios where you might have a dev server and a production server as separate remotes that's a real world scenario that's quite common and then you can push i've got.
[22:54]Steve mattan's mattan's uh remote in git kraken i could do it here
[23:00]Exactly precisely yes exactly exactly that kind of thing so you now have told it there's a URL and it's your remote called origin, but it won't show you any branches yet because it hasn't actually asked GitHub anything. All it's done is just said, okay, I know you exist. I don't know anything about you. And the git commands to ask a server to tell you about itself without actually doing anything, without actually making any changes to any of your files is a fetch. It's like a non-destructive it's half a pull and the half you're missing is the half that changes your files which is a good half not to do so you just do the fetch and at that point in time your iphone will know about those branches.
[23:47]Hang on. Let's talk about how hard it is to find the fetch button. So on the iPhone, in the upper right-hand corner, as you're still, you've just hit add remote and you've come back, so it knows about the remote. On the iPhone, there's a three-dot menu and it's got commit, revert, merge, fetch, pull, and push. So we want to hit fetch right there. But when you're looking at the iPad, the three-dot menu does not have any of those things in there. It has status, location, and customized toolbar. However, it's because it's got a bunch more space for a nice little toolbar. But there's no way to know what the icons in that toolbar mean because they don't have little words under them. So you don't know which ones fetch and which ones pull. And I thought maybe customized toolbar would let me turn on the labels for the buttons, but no. and it's not like the Mac where you can hover and get a little tool tip tells you what that button does. You have to just indiscriminately start pushing buttons. So I'll tell you what it looks like. Fetch is a down arrow inside of a box, straight down arrow, because we're going to come to the curvy one a little bit.
[24:49]Yeah. So an interesting technique is that in the iOS app, it has the word and the icon. So if you have an iPhone and an iPad, you could use the iPhone to learn the icons and then the icons do exist on the iPad version.
[25:05]
Fetching and Pulling Changes
[25:01]So let me ask, why don't we pull? Why do we fetch instead of pulling right away?
[25:05]So right now, assuming you follow down for a completely empty repo, your local branch isn't connected to a specific upstream branch yet because it doesn't even know what branches exist in GitHub because we haven't actually asked it to go and fetch the list.
[25:22]It wouldn't pull main by default?
[25:24]Maybe, but there's no git reason it would because we haven't actually explicitly connected to. So a push and a pull only makes sense on a local branch that is connected to a remote branch. And we do that connection by starting on the remote and checking it out. But we haven't started on a remote because we haven't actually got the list of what's available. We haven't got the menu. So we haven't ordered from the menu. Yeah, we don't have the menu. So that's what we fetch. We fetch to get the menu. And then we can use the icon to show us all the branches. And after we fetch, when we click on that icon to show us all the branches, it will show us the remotes and it'll show us basically the... The local branches which is just going to be one called main and it'll show us the remote ones and then if we click remote main or any other branch and we say checkout that's going to, connect the two together and from that point in time push pull is all like normal.
[26:33]Okay wait a minute how did i do oh we pressed on branch
[26:36]We pressed on branch yeah to get.
[26:39]To that And that lets us see and switch to the one we want. Okay. And then check out. Okay.
[26:45]And once you've checked out, the act of checking it out means you now get a local copy of that branch that is connected to that specific remote because you started on the remote and said, check this remote out. And so now working copy has made a permanent link between those two. And so now when you pull, it knows where to pull from because it's linked. And when you push, it knows where to push to because it's linked. So now, forevermore, push and pull make perfect sense because they are now connected branches. And so away you go.
[27:12]Okay.
[27:13]Now you're in normal.
[27:13]So now we pull, and the pull is the bendy arrow, but it bends down and to the right.
[27:21]What you're actually doing with a pull is two git operations. You're saying, dear server, tell me all the commits you have and take the most recent one and merge it into whatever is sitting in this folder now.
[27:35]So, yeah, it's bendy with a line under it.
[27:38]So, in other words, don't just take stuff and have it go nowhere, which is the down arrow. Take stuff and put it into what I'm working on now. So, it's basically from the cloud and in is how I mentally visualize it. I don't know if that helps. It's a down arrow, and it's not only down. It's down and into something, and the something is your local branch.
[27:57]So, the one that means push might be the up bendy arrow to the left with the line under it.
[28:04]I would imagine so.
[28:06]No, that's merge.
[28:10]Yeah, I haven't got a mnemonic for that one.
[28:13]Fatch is a down arrow. Push is an up arrow. It shouldn't be. Pull is bendy down to the right with the horizontal line. There's no consistency here.
[28:20]Oh, this is by geeks for geeks.
[28:24]Yeah, well, merge kind of makes sense because you've got these two things.
[28:28]Right. Revert makes sense. It's an arrow that goes back in itself. That one I'm going to grant them. That one makes sense.
[28:33]Yeah. It looks like undo.
[28:35]It looks like undo, which is what it is. Run away. Right. Revert is the runaway button.
[28:40]OK.
[28:41]Oh, and Git is like a message icon. Oh, sorry. Commit is like a message icon. That's also fair.
[28:48]Yeah. You should. It kind of makes sense because you're going to do a commit message.
[28:51]Yes. Oh, have you found the other little wonderful thing? By default, when you hit commit, it doesn't select any files and you have to click the tick boxes every time.
[29:00]No, I have not yet committed a change.
[29:04]Ah, OK. When you do, you'll type all of your text and you'll go to hit commit and it'll be grayed out and you won't know why. And it's because you have to go down to the list of changes and tick the box next to the file you'd like to commit. It doesn't automatically choose everything.
[29:17]I'm going to fix a typo.
[29:20]Yeah, I'm sure you found something I spelled wrong.
[29:24]No problem. Shockingly, it's a hyphen.
[29:29]Too many or too few?
[29:32]In this case, too many. What we've determined is basically a conservation of hyphens. Okay, so I've done one. So I guess I've got to push the commit button. And then it wants a message summary. And I'm going to say feet... Not F-E-E-T, F-E-A-T, typo.
[29:53]Before you do anything, I want to draw your attention to two things, because you're now a guinea pig. So there are two things that may or may not be obvious. So depending on whether or not you've used the app a lot already, is automatically push selected or not selected?
[30:07]It is not. There's an amend toggle and a push toggle sitting next to the word commit.
[30:13]So make sure you have commit set to push. so that otherwise when you hit this commit it.
[30:19]No no maybe i want to commit and just keep it local right you
[30:24]Might okay i never do okay because i'm on my iphone i just want to say go up to the cloud alice needs these typos quickly.
[30:30]But let's say i'm i'm halfway through doing something and i'm going to have lunch i want to commit it's essentially like saying save right i've saved what i've done and i know what i remember what i've done and i might want to come back but so if i want to in this case i do want to push it and then i want to hit commit but it's going to yell at me because i haven't selected anything i bet yeah you need to stage at least one file to commit well that's what i have to do and get cracking i have to select every file one by one that i need to i want to commit yeah
[30:58]But the button is grayed out somehow in get cracking the interface makes me do the right thing automatically where here the interface makes me pound the button and then then i get confused.
[31:07]I never remember to commit to uh stage the changes before i hit commit and i and i watched helma doing it and she did the same thing she committed and then i think it was helmar maybe it's you okay so it says unable to push changes that could not be fast forwarded tapped emerging changes from origin and retry push
[31:27]That means there was a poll waiting for you that you hadn't taken that's fine though you can let it do that.
[31:31]Hang on hang on i literally just pulled let's see pull again pull received something that had one conflict to have to resolve. Oh, good, good gracious. I don't know.
[31:45]Let's not...
[31:46]No, it's angry about something.
[31:47]I was going to say, with all of our faffing about, I think I may have done a commit after you did a pull or something on the iPhone.
[31:54]Okay.
[31:55]Given our past history with merge conflicts, I don't think we're going to try to resolve that on the iPhone live on the air. I think that may...
[32:02]Oh, I'm going to do it.
[32:04]Well, I can always roll back, of course. This is the thing I always tell you, no matter how much you mess up in Git, we can always just go back in time. We have a time machine. It only goes one way, which is the back way, not the interesting forward way. Oh, wouldn't that be great? Check out next week's show notes, please.
[32:21]What should the first sentence be? For a long time... Wait, no, that's not... Security-first design? Should that be in the first sentence?
[32:30]For a long time, I assume iOS couldn't provide a good Git experience because of its security-first design.
[32:36]Okay. So now that's the one I'm gonna get rid of. Okay. I will play with this later, but at least now we've tried it once. We have a vague idea how to do it. I don't think that's terrible. I mean, like I said, I have to select it and get cracking. That's not terrible.
[32:52]And now that we have successfully connected the remote and the local branches, now we're in normal land. Now it's just I can't get cracking. We push, we pull, we commit. We're now doing everything we normally do. We can change branches and all that kind of stuff. And when you go into the files app, you can see everything in the files app that is in that repository. So if you check out a different branch and you go back to the files app, all the files will have changed. So now you can open your favorite text editor of choice like textastic and just connect it to that same folder and then you edit in textastic say you know you don't even have to save it's ios you just leave the app and go to working copy and come in or go to working copy and pull and then go
[33:39]
Workflow Using Working Copy
[33:36]back to textastic and all your changes are waiting for you yeah.
[33:39]Yeah there have been a lot of times that i've wanted to do something on my ipad like this and i'm just like i'm too lazy to go get my mac and i haven't been able to
[33:47]Yeah so it's something the listeners may or may not know depending on what other shows they listen to but i do a lot of the show notes while i'm out walking which is a skill i have picked up over the years and i haven't i'm going to knock on all the wood i haven't run into anything in years i may have done a few times in the early days and the key to making all of this work is that i can just push and pull using working copy and so i'll basically i'll be working away at the comfort of my Mac until it's time to get some exercise and then I'll push and then I'll take out my cool clicks keyboard for my iPhone plug the iPhone into it go out for a walk and using working copy pull headed away and then when I you know as I approach my front door I'll push go make myself a nice cup of tea sit down in front of the Mac pull and carry on and at some point in the middle I'll have told Allison hey fix all of my typos and then Allison I've corrected 20 million things and then i'll do it all again and little by little that's how that's how the sausage gets made folks there.
[34:47]You go and and i like this a lot better than the uh what was it one week that you thought doing the show notes in uh apple notes was a good idea
[34:55]It was briefly a good idea until it came to the sharing part actually we could share it fine we couldn't get it out of notes it was You could see my changes, I could see your changes, but it was trapped. Yeah.
[35:07]Yeah.
[35:08]Oh, God.
[35:09]It's not a good design.
[35:12]
Conclusion and Reflections
[35:11]No.
[35:12]Well, this is fun. I know this wasn't a detailed every single step tutorial, but I think everyone's clever enough to probably get through it with the hot tips we have about things like press on the word, not the icon, things like that.
[35:28]Yeah, and also the chances are there's other apps you might prefer to use instead of these apps, right? The real thing I'm hoping people take away is that remember the power of the Files app to let you do way more on your iPhone than you remember being able to do. Because you didn't used to be able to, but now you can. Because you are on, what, iOS 18? I don't know, I've lost track. What are we?
[35:48]Is it 18? 18 is the newest one, yeah.
[35:51]Yeah, we've come a long way. We've come a long way. Because what, copy and paste was three?
[35:58]I forget exactly how soon that was but yeah we have come a long way this is they've come out with a good way i think to be able to uh marry the security model with the uh a little more freedom than we used to have so that's fun yeah all right well this was a light lift actually i think this was fun i am a little cross with you for taking jill's advice and figuring it out and using it for a year before you told me you were doing it i'm cross about that but uh at least I'm happy today.
[36:26]Okay, well, good, folks. And remember, the most important thing, lots and lots of happy computing.
[36:32]If you learn as much from Bart each week as I do, I'd like you to go over to lets-talk.ie and press one of the buttons over there to help support him. He does 98% of the work here. I'm just the stooge that listens to him and asks the dumb questions. If you go over to lets-talk.ie, you can support him on Patreon. You can donate via PayPal, or you can use one of his referral links. I really hope you'll go over and help him out. In the meantime, you can contact me at podcast.com.
[37:02]Music