Git is the modern standard for source code hosting. Large hosting platforms like GitHub and Atlassian's Bitbucket allow for easy creation of git repositories for storing apps and web source code for sharing amongst teams during the development process. But, what if you want to access the repositories, perform merges, and commit code while you're on iOS?
Fortunately, there are quite a few good apps that you can use on the iPhone and iPad to do this, and we'll take a look at one of the best: Working Copy.
SEE: Apple releases iOS 10.3.1 for iPhone, iPad (ZDNet)
Download Working Copy
I like Working Copy because it's a universal app that works on iPhone and iPad; it includes a built-in editor that lets you edit code; and it can handle many simple git tasks such as forking, merging, and reverting changes.
Working Copy is a paid app available on the App Store. It costs $14.99 USD to download.
Sign in with your git account or import keys
- Open Working Copy.
- Tap Settings in the top left-hand corner and then tap Hosting Providers.
- Select your provider (Figure A).
- Enter your username and password
Now that you've signed in to your git hosting account, you'll need to either generate a new SSH key for your device or import an existing key. Follow the directions below for each of those tasks.
How to generate a new SSH key
- Open Working Copy.
- Select Settings | SSH Keys | + Button (Figure B).
- Select Generate Key.
You'll be presented with a new SSH key that you can name to your liking. You can export the public or private keys via email, iMessage, or AirDrop so you can import those keys with your git hosting provider.
How to import an existing SSH key
- Open Working Copy.
- Select Settings | SSH Keys | + Button.
- Select either Import File (if the SSH key to import is stored in iCloud Drive or another location on your device) or Import From Clipboard (if you copied your SSH key to your iOS clipboard).
If you don't wish to add an SSH key and use HTTP or HTTPS clones instead, you can skip this step. When cloning the repository you'll be prompted to enter the username and password if cloning via HTTP/S.
How to clone repositories
To clone a repository to your local device, open Working Copy and navigate back to the app's main screen. Tap the + button to bring up the Clone Repository view (Figure C).
To clone a new repository on the device, follow these steps.
- Enter the URL (HTTP, HTTPS, and SSH URLs are supported).
- Select Clone.
While in this view, you can also see all repositories available to clone from your signed in hosting account, such as Bitbucket and GitHub, from the list below the clone URL text entry.
If the SSH key created in the Working Copy app has already been associated with your git hosting service, the clone will start immediately. If you're using an HTTP/S clone, you'll be prompted to provide your username and password before continuing.
After tapping the Clone button, the repository will be cloned from the remote URL and added to Working Copy where you can edit the files inside of the app by tapping a file name. Once edited, the changes will appear and can be committed and pushed back to the remote repository.
- 4 handy iOS 10 Phone app tips and tricks (TechRepublic)
- 3 iOS apps for learning to code in bite-size lessons (TechRepublic)
- 5+ features in iOS 10.3 that business users should be excited about (TechRepublic)
- What you can learn from GitHub's top 10 open source projects (TechRepublic)
- GitHub rolls out new business option (ZDNet)
- GitHub awards researcher $18,000 for remote code execution flaw discovery (ZDNet)
- Microsoft takes CodePlex to death row on back of GitHub monoculture (ZDNet)
- Interview questions: iOS developer (Tech Pro Research)
Cory Bohon is an indie developer, creating both iOS and OS X applications at Cocoa App (his own company), MartianCraft, and for various other clients. As a part of full disclosure, he does not write about any software that he has created or has helped to create through these outlets.
Cory Bohon is an indie developer specializing in iOS and OS X development. He runs a software company called Cocoa App and is also a developer at MartianCraft. He was introduced to technology at an early age and has been writing about his favorite technology part-time since 2007. He runs a development blog named ObjDev when he isn’t writing about consumer tech.