In this lesson
- Pull from GitHub
- Add files from Continuous to repo
- Push files to GitHub
Tap on time to skip ahead
In this video, we’re going to explore how we can use Git with Continuous via Working Copy. So before we jump into our iPad and Working Copy, we’ll see that I’ve created a repo for the Continuous version of STL Brews and you can see right now it’s pretty empty. I just have my README and my license. So let’s go over to our iPad because we want to be able to get these files and then take files from Continuous and put it into the repository. Working Copy is an app you can download from the Appstore and allows you to plug into your GitHub as well as BitBucket accounts and download files onto your iPad. Now, if you want to edit files and push them back up to your git repo you’ll have to unlock it by purchasing a license and you can purchase a license for either 3 weeks or permanently and there’s varying costs for each of those. So I have Working Copy open here and I’ve already configured it with my GitHub information – I’m not going to cover that because it’s pretty straightforward.
Clone Git Repository with Working Copy
To kick things off, I hit the plus button up here next to “Repositories” and like a lot of git clients it will ask us “Do I wanna clone a repository? Or create a repository.” In this particular instance, I’m gonna go ahead and clone the one that we already have on GitHub. And so we’ll see that here we got Continuous-STL-Brews here. Some I’m going to go ahead tap that. And then I hit clone up here in the upper right. That’s going to authenticate and pull those files down. And we’ll see that I have my standard .gitignore here for VisualStudio not that I think this is important for Continuous but if I’m gonna maybe take over this project with VisualStudio it would probably be handy to have. Typical license and then just kind of README here.
Copy Code from Continuous to Working Copy
So let’s get our code from Continuous and put it into this repo. So I’m gonna go back to Continuous. I’m going to see my STL Brews solution here in the projects tab. And I want to tap the little info icon. And I’ll have different options of how I can share this I can share it as a zip or share it as a file. In this particular instance, I want to zip up our entire solution and send it over to Working Copy. So I’m going to tap “Share Zip.” And here you’ll see I have “Save in Working Copy” as an option. If you don’t see “Save in Working Copy” as an action, if you tap more you can turn that on. Like so. So I’m going to tap “Save in Working Copy” and this is the thing I really like about Working Copy is it gives me a couple of options on what to do with this zip. I can import this whole zip as a whole new repository or I can just save the zip file to the repository or I can unzip the contents to the repository and that’s what I want to do in this particular instance. And then I’m going to tap extract. And we’ll see that we’ve added those directories.
Commit and Push to Git Repo with Working Copy
Now if I go back to Working Copy. We’ll see that we have our models and services projects as well as our solution file. So let’s get this back up to GitHub. So I’m gonna tap on the repository entry here at the top. And I’m gonna tap commit changes here. And like a lot of git clients and I can type in a short summary. And I’m going to give it a description because I’m a good developer and I like to work with others. Like so. And then we have this option here in the upper right where I can immediately push after committing. And I can toggle that off and on. So I’m going to toggle it on and hit commit. And then I’ll get this message saying “Hey you need to select at least one file to commit.” So I can either do that by tapping on the left on the icons here of each file or I can just select all. And now if I hit commit. It should work. And we’ll see that, hey, we committed our files to GitHub.
So if all went well and Working Copy is not lying to us. When I refresh here, we will see that we do have our models and services. So this is one way that we can get our files from Continuous up to GitHub and we can either pull it down to like a laptop or a desktop to do whatever builds of our iOS application – maybe even at some of the files – or if we’re really advanced users we can potentially push our files or commit our files to a git repo that maybe a continuous integration system like Jenkins or something that using to do our builds for us.
Register to get access to additional resources and info.