forked from palmin/workingcopyapp.github.io-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanual.html
1637 lines (1453 loc) · 104 KB
/
manual.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Working Copy Users’ guide</title>
<link rel="shortcut icon" href="/img/favicon.png">
<meta name="author" content="Anders Borum">
<meta name="keywords" content="iOS,git,repository,programming,automation,workflow,x-callback-url,WebDAV">
<meta name="apple-itunes-app" content="app-id=896694807">
<link rel="mask-icon" href="/img/mask-icon.svg" color="#399CFC">
<link rel="stylesheet" type="text/css" href="/css/style6.css">
<meta property="og:type" content="website" />
<meta property="og:image" content="https://workingcopyapp.com/img/users-guide-open-graph.jpg">
<meta property="og:description" content="Learn how to use this powerful Git client for iOS, for stand-alone Post-PC development or to complement your existing workflow.">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@workingcopyapp">
<meta name="twitter:creator" content="@workingcopyapp">
<meta name="twitter:image" content="https://workingcopyapp.com/img/users-guide-twitter.jpg">
<meta name="twitter:title" content="Working Copy - Users Guide">
<meta name="twitter:description" content="Learn how to use this powerful Git client for iOS, for stand-alone Post-PC development or to complement your existing workflow.">
<script>
// redirect /manual/section-name to manual.html#section-name
var pathname = window.location.pathname;
if(pathname.indexOf("/manual/") == 0 && !window.location.hash && pathname.indexOf("/manual.html") < 0) {
var section = pathname.substr("/manual/".length).replace(/\/+$/, "");
window.location = window.location.protocol + "//" + window.location.host + "/manual.html#" + section;
}
</script>
<script>
function imgLoaded(img) {
img.parentNode.style.background = 'transparent';
}
</script>
<style>
#second-intro-image {
display: none;
}
@media print, (min-width: 640px) {
#table-of-contents {
padding-top: 1em;
column-count: 2;
}
li.header2 {
break-inside: avoid-column;
-moz-column-break-inside:avoid;
-moz-page-break-inside:avoid;
page-break-inside: avoid;
}
#first-intro-image {
display: none;
}
#second-intro-image {
display: block;
}
}
</style>
</head><body>
<header>
<h1 itemprop="name"><a href="/">Working Copy</a>
<div class="subhead">Users’ guide</div></h1>
</header>
<div class="full" class="intro-image" id="first-intro-image">
<img src="/img/action-shot-71-800.jpg" style="width: 100%"
srcset="/img/action-shot-71-800.jpg 800w, /img/action-shot-71-1200.jpg 1200w, /img/action-shot-71-2000.jpg 2000w"/>
</div>
<div class="outer" id="table-of-contents">
<div class="inner"><nav>
<ul class="toc">
<li class="header2"><a href="/manual/introduction">1. Introduction:</a>
<ul>
<li class="header3"><a href="/manual/cloning-repos">1.1 Cloning repositories</a></li>
<li class="header3"><a href="/manual/accessing-files">1.2 Accessing files</a></li>
<li class="header3"><a href="/manual/committing-changes">1.3 Committing changes</a></li>
<li class="header3"><a href="/manual/up-to-date">1.4 Staying up-to-date</a></li>
<li class="header3"><a href="/manual/deleting-repos">1.5 Deleting repositories</a></li>
</ul>
</li>
<li class="header2"><a href="/manual/remotes">2. Remotes:</a>
<ul>
<li class="header3"><a href="/manual/clone-catalog">2.1 Clone catalog</a></li>
<li class="header3"><a href="/manual/ssh-keys">2.2 SSH keys</a></li>
<li class="header3"><a href="/manual/ssh-troubleshooting">2.3 SSH Troubleshooting</a></li>
<li class="header3"><a href="/manual/heruko-remotes">2.4 Heroku Remotes</a></li>
<li class="header3"><a href="/manual/aws-codecommit">2.5 AWS CodeCommit</a></li>
<li class="header3"><a href="/manual/glitch">2.6 Glitch</a></li>
<li class="header3"><a href="/manual/hosting-provider">2.7 Hosting Providers</a></li>
<li class="header3"><a href="/manual/access-tokens">2.8 Access Tokens</a></li>
</ul>
</li>
<li class="header2"><a href="/manual/viewing-editing">3. Viewing and editing:</a>
<ul>
<li class="header3"><a href="/manual/edit">3.1 Text Editing</a></li>
<li class="header3"><a href="/manual/preview">3.2 Preview</a></li>
<li class="header3"><a href="/manual/search">3.3 Search and navigation</a></li>
<li class="header3"><a href="/manual/file-changes">3.4 File changes</a></li>
</ul>
</li>
<li class="header2"><a href="/manual/commit-revert">4. Committing or reverting:</a>
<ul>
<li class="header3"><a href="/manual/commit-history">4.1 Commit history</a></li>
<li class="header3"><a href="/manual/branching">4.2 Branches</a></li>
<li class="header3"><a href="/manual/pull-requests">4.3 Pull Requests</a></li>
<li class="header3"><a href="/manual/commit-graph">4.4 Commit Graph</a></li>
<li class="header3"><a href="/manual/resolve-tool">4.5 Resolving conflicts</a></li>
<li class="header3"><a href="/manual/signed-commits">4.6 Signed Commits</a></li>
<li class="header3"><a href="/manual/tagging">4.7 Tagging</a></li>
</ul>
</li>
<li class="header2"><a href="/manual/extending-ios">5. Extending iOS:</a>
<ul>
<li class="header3"><a href="/manual/dragdrop">5.1 Drag and Drop</a></li>
<li class="header3"><a href="/manual/saving">5.2 Saving to Working Copy</a></li>
<li class="header3"><a href="/manual/edit-in-app">5.3 Edit in App</a></li>
<li class="header3"><a href="/manual/files-sync">5.4 Files synchronisation</a></li>
<li class="header3"><a href="/manual/webdav-server">5.5 WebDAV access</a></li>
<li class="header3"><a href="/manual/shortcuts">5.6 Shortcuts and automation</a></li>
<li class="header3"><a href="/manual/callbacks">5.7 Callback URLs</a></li>
<li class="header3"><a href="/manual/draftcode">5.8 DraftCode</a></li>
<!--<li class="header3"><a href="/manual/swift-playgrounds">5.8 Swift Playgrounds</a></li>-->
</ul>
</li>
<li class="header2"><a href="/manual/beyond-ios">6. Beyond iOS:</a>
<ul>
<li class="header3"><a href="/manual/logfiles">6.1 Log files</a></li>
<li class="header3"><a href="/manual/ssh-upload">6.2 SSH Upload</a></li>
<li class="header3"><a href="/manual/ssh-command">6.3 SSH Command</a></li>
</ul>
</li>
<li class="header2"><a href="/manual/support">7. Help and Support</a>
<ul>
<li class="header3"><a href="/manual/file-backup">7.1 File Backup</a></li>
<li class="header3"><a href="/manual/purchase">7.2 How to purchase</a></li>
</ul>
</li>
</ul>
</nav></div>
</div>
<div class="full" class="intro-image" id="second-intro-image">
<img src="/img/action-shot-71-800.jpg" style="width: 100%"
srcset="/img/action-shot-71-800.jpg 800w, /img/action-shot-71-1200.jpg 1200w, /img/action-shot-71-2000.jpg 2000w"/>
</div>
<div class="outer">
<h2 id="introduction">1. Introduction</h2>
<div class="inner">
<p><a href="/">Working Copy</a> is a full featured Git client for iOS and since Git is a powerful version-control system it can take some time to master.
The same is true for Working Copy, and even though you will not need to work with the command-line, some understanding of Git is needed.
If you are not confident with Git's core concepts you should read the first few chapters of
<a target="reference" href="http://git-scm.com/book/en/v2">Pro Git</a> by Scott Chacon or the
excellent <a target="reference" href="https://www.atlassian.com/git/tutorials/">tutorials</a>
Atlassian has made available.</p>
<h3 id="cloning-repos">1.1 Cloning repositories</h3>
<div class="left">
<img class="animated" onload="imgLoaded(this)" src="/img/clone-77.png"
alt="Video showing cloning on phone: User presses + in the upper right corner and picks clone. Picks protocol, types username, hostname and path on the Other tab. Picks repository from list on GitHub tab. Presses Clone to start transfer. When cloning completes the repository contents are shown."
/>
</div>
<p>The first step is to get hold of a local copy of the Git repositories you want to access.
Duplicating a repository from a remote server is
known as cloning, and you do this by pressing + on the list of repositories.</p>
<p>You provide a URL pointing to a repository on the Git remote you wish to clone from.
Working Copy can transfer data from the remote using http, https, git or ssh protocols. However, you should be careful
using http transfer since data will be sent without encryption, which means your login credentials and your source
code can be intercepted. If you are not on a trusted network you should avoid using http transfer.</p>
<p id="hosting-services">There is special support for BitBucket, GitHub and some other <a href="/manual/hosting-provider">hosting
providers</a> to list your available repositories such that cloning amounts to picking a repository and tapping clone.
Even when Working Copy has no specific support for a hosting provider, you can copy-paste your
URL into the top field and Working Copy will clone just as well. </p>
<p id="itunes-import">You can also import repositories from a Mac or PC by dragging directories into iTunes Document lists.
If the directory does not contain a .git subdirectory at top-level, Working Copy assumes you want a new repository with
all these files added. Zip-files can also be dragged into iTunes.</p>
</div><div class="inner">
<div class="right"><img src="/img/css-content-45-transparent.png" onload="imgLoaded(this)" /></div>
<h3 id="accessing-files">1.2 Accessing files</h3>
<p>Data in Working Copy is organized as repositories, containing directories, which themselves contain
either sub-directories or files.
Tapping a file shows the file content, the changes to the file and the status of the file.</p>
<p>File content is shown with syntax highlighting for sourcecode and a preview of html and document files.
To edit you will need to switch away from Preview mode with the button at the top showing your current mode.
Tap the action-button in the upper-right corner to send the file to other applications such as Mail
through a share sheet.</p>
<p>The editing inside Working Copy is bare-bones and neutral in that
neither programming languages, markdown nor regular text
files get special treatment. If you are performing heavy editing consider using a
specialized text-editor app for programming, markdown or other purposes.
You can read <a href="/manual/extending-ios">more</a> about using Working Copy in combination
with other applications.</p>
<p>To copy files use the <em>Copy</em> action from the share sheet, then navigate to the destination directory
and press <em>+</em> in the upper right corner to insert <em>File from clipboard</em>.
Move files and directories by
<a target="iPad-guide" href="https://support.apple.com/guide/ipad/drag-and-drop-ipadaa83b207/ios">dragging</a>
them around directory listings. </p>
</div><div class="inner">
<h3 id="committing-changes">1.3 Committing changes</h3>
<div class="left"><img src="/img/commit-sheet-32-transparent.png" onload="imgLoaded(this)" /></div>
<p>When you have file modifications the Changes tab lights up. You can see what has been added in green and what has
been deleted in red. If you are satisfied with the changes you can commit
them to the repository with a button on the Status tab.
A faster way, however, is to swipe left on the file in the directory listing.
Swiping left can generally be performed on lists of files,
directories and repositories allowing convenient access to frequent actions.</p>
<p>You can commit a single file, multiple files or the entire repository at once, and it is considered good practice to make a
commit represent one conceptual change to your repository. Following this practice also makes it easier to come up with concise
yet descriptive commit messages.
</p>
<p>Word suggestions are shown above the keyboard when writing your commit message. Suggestions are based on
the filenames and changes you are about to commit, as well as previous commit messages in the same repository.
This is combined with frequently used sentences in commit messages in public repositories. No information
from your commits or repository is collected to make this happen. </p>
<p>The list of files include everything that can be committed. You tap files to stage or unstage for commit
and the rightmost button shows the difference for this particular file between working directory and
last commit. When looking at differences you can stage/unstage individual hunks by
long-tapping and swiping making it possible to commit some changes in a file but leave others uncommitted.
</p>
<p id="push-feature">When you have made one or more commits your on-device repository is seen as being ahead of the remote repository
and you <em>push</em> these commits to the remote. Because <em>Commit</em> and <em>Push</em> are distinct
actions you can <em>Commit</em> while offline and <em>Push</em> once you get back online.</p>
<p>To <em>Push</em> after <em>Commit</em> use the branch dropdown available on top of directory listings or by
swiping left on repositories. You need to
<a href="/manual/purchase">unlock</a> the ability to <em>Push</em> with an in-app purchase.</p>
</div>
<div class="inner">
<h3 id="up-to-date">1.4 Staying up-to-date</h3>
<div class="right"><img class="right" src="/img/status-79-transparent.png" onload="imgLoaded(this)" /></div>
<p>Commits can be pushed to the remote from many sources.
Other people contribute their work, or you could be doing something
on a regular computer or another iOS device which results in commits that end up on the remote. </p>
<p>You get commits back into Working Copy through a two-step process where you <em>Fetch</em> and <em>Merge</em>.
<em>Fetch</em> reads commits from the
server and requires a network connection. The commits will not be integrated with the local data on your device until
you <em>Merge</em>, which will combine the new commits from the server with your local data.</p>
<p>You can pull the list of repositories down to <em>Fetch</em> for all your repositories. If any of your
repositories received new commits you will be able to <em>Merge</em> all these repositories with a
single tap.</p>
<p>Sometimes data cannot be automatically combined because your local changes conflict with the changes from the
commits fetched. These conflicts can be resolved by manually editing files and picking the wanted parts
from the conflict markers and tapping the Resolve button. A faster solution is to use the
<a href="/manual/resolve-tool">Resolve</a> tool that lets you resolve conflicts for many files at once.</p>
<p>As a short-hand you can <em>Fetch</em>, <em>Merge</em> and <em>Push</em> a repository with the <em>Sync</em> button
on the detail screen of your remote.</p>
<p id="rebase-pull">You can configure repositories to <em>Rebase</em> instead of <em>Merge</em> commits
from the Configuration page inside Repository status.
This is a pro configuration available to users that purchased or upgraded their
<a href="/manual/purchase">pro unlock</a> on October 17, 2018 or later.</p>
<h3 id="deleting-repos">1.5 Deleting repositories</h3>
<p>Once you are done with a repository you can delete it from the
repository status screen. This has no influence on any remote repositories. </p>
<div style="clear: both;"></div>
</div>
<h2 id="remotes">2. Remotes</h2>
<div class="inner">
<div class="left"><img class="left" onload="imgLoaded(this)" src="/img/remote-details-81-transparent.png" /></div>
<p>Git remotes are server-side duplicates of your repositories with full history.
These can be services such as GitHub, BitBucket etc. or they can be be privately hosted servers.</p>
<p>When you clone a repository, the URL of the remote repository is your starting point. Working Copy supports ssh, https and
http remotes and the URL consists of protocol scheme, the hostname, username and the path to the repository on the host.
The following are typical examples of remote URLs:</p>
ssh://[email protected]/home/andrew/git/site.git/
[email protected]/home/andrew/git/site.git/
</pre>
<p>The last two URLs are equivalent since ssh is the default protocol. </p>
<p>Authentication will always try with a username included on the form <em>username@</em>
otherwise remembering the last username for that host.
The username <em>git</em> has special meaning for many hosts such that the actual user
account is derived from the SSH key used to authenticate.</p>
<p>If you enter the Repository page you can add or delete remotes. After cloning there is only a single “origin”
remote and, in many scenarios, there is no need for additional remotes.</p>
</div>
<div class="inner">
<h3 id="clone-catalog">2.1 Clone catalog</h3>
<div class="right"><img class="right" onload="imgLoaded(this)" src="/img/clone-catalog-transparent.png" /></div>
<p>When cloning repositories from BitBucket and GitHub you can enter your credentials to get a list of repositories to clone.
Working Copy tries to show the most relevant repositories at the top, these being the ones where you have administrative
or push privileges. Your GitHub Gists and BitBucket Snippets are also available from this list.
</p>
<p>If the list is long, enter keywords in the search field in order to only see repositories containing these.
If you do not see the repository you wish to clone, you can still copy-paste the clone URL into the top-field manually.</p>
<p id="restriced-github-orgs">Organizations on GitHub can be configured to
<a target="GitHub" href="https://help.github.com/articles/about-third-party-application-restrictions/">restrict</a>
third-party applications such that repositories are not listed and you might need to
<a target="GitHub" href="https://help.github.com/articles/requesting-organization-approval-for-your-authorized-applications/">ask
your administrator</a> to approve Working Copy.
</p>
<p>You configure additional <a href="/manual/hosting-provider">hosting providers</a> from Working Copy settings
or you can clone using a URL from the clipboard.</p>
</div>
<div class="inner">
<h3 id="ssh-keys">2.2 SSH keys</h3>
<div class="left"><img class="left" onload="imgLoaded(this)" src="/img/ssh-config-30-transparent.png" /></div>
<p>SSH transfers support password authentication but also public/private key authentication for
improved security. The public part of a SSH key corresponds to a padlock that you use to
lock-down resources. The private part of the SSH key corresponds to the physical key that
opens the padlock. Your private key must be kept secret and the public key can be
distributed to servers where you want to store remote repositories.</p>
<p>If you tap “Connect with BitBucket” or “Connect with GitHub” your public key will automatically
be registered with BitBucket or GitHub. For other Git hosting providers such as
<a target="server" href="https://www.openshift.com">OpenShift</a> or
<a target="server" href="https://aws.amazon.com/codecommit/">AWS CodeCommit</a> you need to
enter your public key in the settings page for that service. The details will depend upon
the service in question, but your first step is to Export the public key.
When using a Linux server, you need to append the public key to the
<em>$HOME/.ssh/authorized_keys</em> file.</p>
<p>Working Copy generates 4096 bit RSA keys and imports RSA, ECDSA or Ed25519 private keys in
PEM or OpenSSH format.</p>
</div>
<div style="clear: both;"></div>
<div class="inner">
<h3 id="ssh-troubleshooting">2.3 SSH Troubleshooting</h3>
<p>If you are having problems authenticating with an SSH server check that the public key installed on the server
matches the private key in Working Copy. If you have some other SSH client on your device or computer, you should make sure
you can connect from these without problems. If this works, you must also make sure you use the same SSH key in Working Copy,
possibly importing the private key from the other application.</p>
<p>When exporting the public key you end up with something on the form:</p>
<pre>ssh-rsa AAAAB3NzaC1…g+y4Pfz9 WorkingCopy@iPadPro-31092017</pre>
<p>Everything after the second space is just a comment, that makes it easier to
determine where and how the key was created. It can sometimes help to remove this comment,
before registering the key with your Git server.</p>
</div>
<div class="inner">
<h3 id="heruko-remotes">2.4 Heroku Remotes</h3>
<p>It is possible to deploy to
<a href="http://heroku.com/" target="heroku">Heroku</a> using Git.
You need to setup a second remote for your repository that points
to your Heroku application. Since the
<a target="heroku" href="https://toolbelt.heroku.com/">Heroku Toolbelt</a>
is not available on iOS, you must manually configure the remote. </p>
<p>The easiest way to do this is to
<a target="heroku" href="https://devcenter.heroku.com/articles/git#creating-a-heroku-remote">setup your remote</a>
on a regular computer and determine the remote
details on the command line by entering:</p>
<pre>git remote -v</pre>
<p>You then create a new remote from this URL in Working Copy. Note that username and password
for remote is not your Heroku account credentials. You will find this information
in your home directory in the hidden file <em>.netrc</em></p>
<pre>cat ~/.netrc</pre>
<p>When you push to your Heroku remote the deployment status is <a href="/manual/logfiles">logged and shown</a> inside
Working Copy.</p>
<h3 id="aws-codecommit">2.5 AWS CodeCommit</h3>
<p>To use Working Copy with <a href="https://aws.amazon.com/codecommit/" target="aws">AWS CodeCommit</a>
you need to create an IAM user with the <em>IAMUserSSHKeys</em> Policy. You also need to add some Policy allowing
repository access and <em>AWSCodeCommitPowerUser</em> is a good choice, unless you only need to
clone and fetch code in which case <em>AWSCodeCommitReadOnly</em> is preferable.
</p>
<p>You must also export your SSH Key from Working Copy and <em>Upload SSH Public Key</em>. This is done
in the <em>Security Credentials</em> tab of your
<a href="https://console.aws.amazon.com/iam/#users" target="aws">IAM User</a>.
When your SSH Key has been uploaded it
will be listed with a <em>SSH Key Id</em> that will be needed for the next step.</p>
<p>
Your repositories are listed in the <a href="https://console.aws.amazon.com/codecommit/" target="aws">CodeCommit Dashboard</a>.
When looking at individual repositories
you can request the Clone URL in the SSH format, which can be used inside Working Copy, but you need to
use the <em>SSH Key Id</em> as your username. Your URL should end up looking something like:
</p>
<h3 id="glitch">2.6 Glitch</h3>
<p><a href="https://glitch.com/">Glitch</a> is a online service and community for creating web apps.
You can edit from a web browser but they also provide access through a Git remote.
</p>
<p>If you use
<em>Process in Working Copy</em> from the share sheet in Safari
the equivalent Git repository is opened in Working Copy cloning it as needed. If you are editing
on glitch.com when using <em>Process in Working Copy</em> the remote url includes a username
token that grants you push permissions on the remote.
</p>
<p>When pushing changes back to glitch you need to push to another branch than master and
use their console to merge in and reload changes. You can read about this
<a href="https://support.glitch.com/t/possible-to-code-locally-and-push-to-glitch-with-git/2704/3">here</a>.
</p>
<p>Git remotes at <em>api.glitch.com</em> behave slightly differently than other Git remotes and you need
to include the username and a empty password to the remote url for pushing to work.</p>
<h3 id="hosting-provider">2.7 Hosting Providers</h3>
<p>To make it easier to <a href="/manual/clone-catalog">list</a> your repositories, to create new remote repositories
and to configure your <a href="/manual/ssh-keys">SSH keys</a> you can configure hosting providers.</p>
<div class="right" style="margin-top: 1em"><img class="right" onload="imgLoaded(this)"
src="/img/hosting-provider-transparent.png" /></div>
<p>Working Copy supports private instances of
BitBucket <a target="hosting" href="https://www.atlassian.com/software/bitbucket/server">Server</a>
(previously known as Stash),
GitHub <a target="hosting" href="https://enterprise.github.com/">Enterprise</a>,
<a target="hosting" href="https://about.gitlab.com/features/">GitLab</a>,
Team Foundation Server (<a target="hosting"
href="https://www.visualstudio.com/en-us/news/releasenotes/tfs2017-relnotes">TFS</a>)
and <a target="hosting" href="https://gogs.io">Gogs</a>.</p>
<p>
You enter the hostname of your server and the instance type is identified automatically trying a
combination of schemes and ports. If your hosting provider isn't recognised or auto-detection is
taking too long it can help to enter a full URL including scheme and port.
</p>
<p>You can configure cloud instances of the above hosting providers as well as
<a target="hosting" href="https://azure.microsoft.com/en-us/services/devops/">Azure DevOps</a> and
<a target="hosting" href="http://beanstalkapp.com">Beanstalk</a>.
Even a regular Linux server, BSD server or
<a href="https://www.youtube.com/watch?v=WMcAcUknHMw" target="youtube">Synology NAS</a>
can act as a hosting provider, using SSH <a href="javascript:showSecureShellInfo();">commands</a> for
listing repositories.
</p>
<p>If you have several user accounts for a hosting provider you can bake the user
for each user.</p>
<p>When you add hosting providers it is often a good idea to disable the built-in providers you are
not using to avoid clutter in other parts of Working Copy. This is especially important when
you configure providers with a baked-in username as the default providers for the same service
will switch between user accounts. </p>
<h3 id="access-tokens">2.8 Access Tokens</h3>
<p>If you hosting provider does not allow authenticating with a regular password
access tokens can often be used instead.</p>
<p>For GitHub Enterprise you visit the website and go to <em>Settings > Developer Settings > Personal access tokens</em>
and tap <em>Generate new token</em>. This token should be granted <em>repo</em>, <em>read:org</em>,
<em>admin:public_key</em>, <em>gist</em> and <em>admin:gpg_key</em>
to support all Working Copy features but <em>repo</em> is the most important one.</p>
<p>On GitLab you go to <em>User Settings > Access Tokens</em> to create new tokens
where the <em>api</em> scope is required.
</p>
<p>You use the access token instead of a password and it will be remembered
until you sign out of the service.</p>
</div>
<div id="ssh-clone-catalog" class="inner" style="display: none">
<h3 id="ssh-host-info">SSH Providers</h3>
<p>
When Working Copy lists your repositories on a regular SSH server, it uses the built-in shell
on the server to execute commands. When you create a new repository a series of commands are also executed.</p>
<p>
For this to work <em>git</em>, <em>/bin/sh</em>, <em>find</em> and <em>mkdir</em> need to be available
and have sensible behaviour.
If these commands are not available you will get error messages and the server will not work as
a hosting provider. The series of commands have been tested on major Linux and BSD variants to
work as expected when commands are available and to fail with no side-effects when commands are
unavailable.
</p>
<p> In the rare case where the above mentioned commands are available but do something different,
there is the possibility that the hosting provider commands will have unintended
consequences and could cause data loss. When enabling a SSH Server
as a hosting provider, Working Copy will execute commands on your behalf, and this is done entirely
at your own risk. </p>
<p>The scripts are listed for you to evaluate. </p>
<pre>git --version && echo && find "$path" -type d \( -exec sh -c 'cd "{}"; var=`git 2> /dev/null rev-parse --is-bare-repository`; if [ "$var" = "true" ]; then exit 0; else exit 1; fi' - \; -print -prune \)
</pre>
<p>The script listing repositories starts by making sure <em>git</em> is installed, to avoid doing any work on a server
that is unable to function as a remote. It then looks at all directories from the starting <em>path</em>
of your hosting provider and outputs the ones that are <em>bare</em> repositories. Notice that non-bare repositories
will not be included.</p>
<pre>git --version && cd "$path" && mkdir "$repo" && cd "$repo" && ( var=`git 2> /dev/null rev-parse --is-inside-git-dir`; if [ "$var" = "true" ]; then echo "Unable to create repository inside existing repository"; exit 1; fi ) && ( var=`git 2> /dev/null rev-parse --is-inside-work-tree`; if [ "$var" = "true" ]; then echo "Unable to create repository inside existing repository"; exit 1; fi ) && git init --bare
</pre>
<p>When creating repositories we also make sure <em>git</em> is installed. All the commands need to
complete without error for the next one to start. If you try to create a <em>repo</em> where a directory already
exists, <em>mkdir</em> fails and <em>git init</em> never runs.</p>
<p>Some servers are configured to <a target="git" href="https://git-scm.com/docs/git-shell">restrict</a>
secure shell to only run Git. You can enable listing repositories and creating repositories from the app
by creating the directory <em>~/git-shell-commands</em> and placing the scripts
<a href="/shell-commands/working-copy-list">working-copy-list</a> and
<a href="/shell-commands/working-copy-create">working-copy-create</a> inside.
</p>
</div>
<div style="clear: both;"></div>
<h2 id="viewing-editing">3. Viewing and editing</h2>
<div class="inner">
<div class="left"><img class="left" onload="imgLoaded(this)" src="/img/dir-structure-21-transparent.png" /></div>
<div class="left noshadow" style="position: relative; left: -50px; margin-right: -25px;">
<img src="/img/content-action-sheet-34.png" onload="imgLoaded(this)"
srcset="/img/content-action-sheet-34.png 200w, /img/content-action-sheet-34-400.png 400w, /img/content-action-sheet-34-645.png 645w"
/>
</div>
<p>A repository is presented as a hierarchy of directories and files where you tap a directory to enter and
view the contents.</p>
<p>You can swipe left or right on entries to access commonly used actions such as <em>Commit</em>,
<em>Revert</em> and invoke the share sheet which allows exporting single files, directories or the entire
repository.</p>
<p style="padding-bottom: 1em">Some repositories have deep directory hierarchies and
to avoid having to go back repeatedly, you can tap and hold the back button to choose
how far back you want to step. The same popup shows your recently accessed documents
making it fast to open these.</p>
<p> If you tap a file and pick the Content tab you can view the file in different modes.
This is controlled by the button in the top bar indicating the current mode. The top choices
are the recommended mode for this file and depends on both filename and file content.
When you pick a mode for a given file, Working Copy remembers this choice for other files
with the same file extension.
</p>
</div>
<div style="clear: both;"></div>
<div class="inner">
<h3 id="edit">3.1 Text Editing</h3>
<div class="right"><img class="right animated" src="/img/content-preview.png" onload="imgLoaded(this)" /></div>
<p>Text files can be viewed as plain text or with syntax highlighting for <span id="expandLanguages" style="white-space: normal;">one of the
<a href="" onclick="return showLanguages();">supported languages</a>.</span>
<span id="allLanguages" style="display: none; white-space: normal;">Apache, Bash, C#, C/C++, CSS, Clojure, CoffeeScript,
Dart, Diff, Erlang, F#, Go, HTML, HTTP Headers,
Haskell, Ini, JSON, Java, JavaScript, Lua, Makefile, Markdown, Nginx, Objective-C, PHP, Perl, Python, R, Ruby, SML,
SQL, SVG, Scala, Swift, VIM, XML, YAML and ΤeΧ.
</span>
Font size is adjusted in the popup switching between modes and is remembered
individually for different modes.</p>
<p id="font-customisation">You can pick between a number of included fonts or import new OpenType or TrueType fonts
as a pro feature.</p>
<p>Looking at source code you can tap anywhere to start editing. <em>Done</em> in the upper right corner
stops editing. You undo latest changes with the undo-button above the keyboard on iPad or by shaking
your iPhone. If you want to undo all your changes, switch to the Status tab where you can revert the
file to how it was at last commit.</p>
<p>
Any text selection can be transformed with action extensions, which will let you do things such as URL encode text
from within the editor.
<a target="app" href="https://itunes.apple.com/app/workflow-powerful-automation/id915249334?mt=8&at=1000lHq">Shortcuts</a>
is the prime example of such a application.</p>
<p>
When your selection matches a valid <a target="wikipedia" href="https://en.wikipedia.org/wiki/Web_colors">CSS color</a>
you can adjust this. Placing the caret where a color is expected the popup menu also
lets you use the color picker to make a new color.</p>
<p>Use <a href="https://editorconfig.org/" target="_blank">.editorconfig</a> files to control encoding, newline style
and indentation in a manner supported by a wide range of editors and IDEs.</p>
<h3 id="preview">3.2 Preview</h3>
<p>You enable <em>Preview</em> mode with the button in the upper right corner which is available
for HTML, Javascript, Markdown, org-mode, AsciiDoc and Jupyter notebook files.
</p>
<p>When previewing HTML files, relative links to images, javascript and stylesheets resolve to files inside
repository and will work without Internet connection. External assets require a Internet connection to load.
If offline preview is important to you, consider including javascript frameworks inside repository.
</p><p>
You can make edits from other apps while previewing using the iOS <a href="/manual/extending-ios">document picker</a>
or <a href="/manual/webdav-server">WebDAV</a> access.
When there are changes to the file being previewed or any local assets it depends on, the preview will automatically
reload. To make it easy to evaluate changes, the scroll and zoom settings are restored during reload.
</p><p>
Enable the Javascript Console to check for errors, warnings or log statements.
Errors that occur in javascript files inside repository can be tapped taking you to the line in
the source file. You can evaluate javascript
in the context of the HTML page and when external keyboard is attached, the ↑↓ keys let you step through
evaluation history.
</p>
<p id="external-preview">
You can preview from other devices or computers, by enabling <em>External URL</em>. Long tap the URL
to put it on the clipboard or use Handoff to connect. This preview will keep working as you switch back to
editing mode.
</p><p>
Putting your iPad in split screen mode you can have Safari side-by-side with Working Copy to preview and edit
simultaneously. <!-- If you connect a external display through AirPlay or a HDMI adapter you can enable
preview on the external display by tapping the small monitor icon at the top of the screen. -->
</p>
<p>External preview is a pro feature available to users that <a href="/manual/purchase">purchased</a> the unlock or upgraded their
pro unlock on January 8, 2018 or later.</p>
</div><div class="inner">
<h3 id="search">3.3 Search and navigation</h3>
<p>You can search repository files by name, text content or symbol declarations, which is often
the fastest way to navigate a large repository.</p>
<p>
When you search from the top of directory listings, results are included from this location
in the file hierarchy including files inside sub-directories. Search from the <em>Content</em> tab of a file
includes results from the entire repository or the current file depending on the scope selection.
</p>
<div class="ipad"><img class="ipad animated" src="/img/manual-search.png" onload="imgLoaded(this)" /></div>
<p>Search queries will be matched against filenames, symbols, line numbers and text content. For filenames
and symbols a fuzzy matching will be performed which means that the characters in query must occur in the given
order but characters can be skipped. The query <em>read.md</em>
will fuzzy match both <em><u>read</u>me<u>.md</u></em> and <em><u>read</u>me<u>.m</u>ark<u>d</u>own</em> but the first one
will be ranked higher as it's closer to a non-fuzzy match.
</p><p>
When you type several search words they all have to match either a filename, symbol, line number or text.
The query <em>read.md 10</em> will be understood as
<ul>
<li>line 10 of the files where name fuzzy matches "read.md"</li>
<li>occurrences of the text "10" in files where name fuzzy matches "read.md"</li>
<li>files containing the text "read.md" and "10"</li>
</ul>
To make it easier to restrict queries, the words matching the filename must lead your query and search results
matching filenames or symbols will appear at the top of search results with lower ranking the more fuzzyness was
required to reach a match.
</p>
<p>
All files in your repository need to be read and parsed to satisfy searching for text content and symbols.
When you search for the first time in a large repository, indexing can take several minutes and the progress is shown
in the right part of the search field. Filename searches will be available almost immediately
while text content and symbol results will update as the repository is indexed.
Only files that have changed since the last search will be indexed
when you search a repository that has been indexed previously, requiring much less work.
</p>
<p>Editor search uses your current selection or the word at your cursor as the start of your search.
This is convenient to lookup a symbol declaration or the usages of
a function or class. Invoking search when looking at the <em>Content</em> tab of a non-text file the query will be your
current filename, showing usages of that particular file.
</p>
<p> The prefilled query is selected such that it can be deleted with a single tap and when the query is
empty you are shown recent edit points for repository scope and symbol declarations for the file scope,
which is useful for quick back and forth navigation.
</p>
<p>Typing on a external keyboard it can be efficient to not more your hands from the keyboard to the screen.
The arrow keys let you cycle through search history, but this makes it impossible to navigate search results
with these keys. The trick is to refine your query until the result you want is the top one,
and ⌘⏎ lets you pick the top result.
</p>
</div><div class="inner">
<h3 id="file-changes">3.4 File changes</h3>
<div class="wide noshadow left" style="margin-left: -5%"><img class="wide left" style="margin-left: -5%" onload="imgLoaded(this)"
src="/img/split-diff-36-transparent.png" /></div>
<div style="clear: both; margin-top: -75px" class="left noshadow"><img class="animated" play_button_bottom="30%"
onload="imgLoaded(this)" src="/img/image-diff-83.png"
srcset="/img/image-diff-83.png 200w, /img/image-diff-83-450.png 450w, /img/image-diff-83-645.png 645w"/></div>
<p>A badge on the Changes tab shows the number of lines added or deleted from a file.
The Changes tab itself shows the differences
between the last version committed and the current version. <!-- You can long-tap changed blocks to recover deleted blocks or
remove added blocks. --> The two-panel split-view in the screenshot requires the screen to be wide and for phones to be
turned to landscape mode.</p>
<p>Image changes can be viewed in a split-mode where zooming one image will make the other one follow -
making it easy to focus on the details.
If you are unsure as to where the changes are in an image, use the Color mode that
highlights changed areas in green where identical areas are without color. Cut mode is useful for images with
global changes and allows you to drag and rotate a partitioning line in such a way that everything on one side is the old image.
The previous image will have a red border, and the new one a green border.</p>
<p>The Status tab says whether the file is modified and allows you to commit or revert changes.
</p>
<div style="clear: both;"></div>
</div>
<h2 id="commit-revert">4. Committing or reverting</h2>
<div class="inner">
<div class="right"><img class="right" onload="imgLoaded(this)" src="/img/commit-sheet-32-transparent.png" /></div>
<p>You can commit changes to your files for the entire repository, for all files in a sub-directory or for a specific file.
If you do not wish to commit some of your files you can Revert to how they where at the last commit.
The files taken into account are determined by where in the directory structure you initiate the commit.
As a short-hand you can swipe left on a repository, directory or file to commit.</p>
<div class="left"><img class="left" onload="imgLoaded(this)" src="/img/status-modified-19-transparent.png" /></div>
<p>During commit you are shown a list of changed files and can view differences for individual files by pressing the button
that shows the number of lines added or deleted. Files with a checkmark will be included in the commit and you toggle the
checkmark by tapping the file.
Working Copy will push the commit to the remote right away if you enable the <em>+Push</em> button.</p>
<p>As a general rule you should make commits with a single purpose and only include the changed files that helped achieve this purpose.
You should write a message in the top line describing this purpose;
if it is hard to write something short but concrete you might
need to break your commit into smaller parts.</p>
</div>
<div class="inner">
<div class="right"><img class="right" onload="imgLoaded(this)" src="/img/commit-list-28-transparent.png" /></div>
<h3 id="commit-history">4.1 Commit history</h3>
<p>The value of well-drafted commit messages becomes apparent when looking at a log of previous commits.
You may do this for either the entire repository, a directory with all its files or for single files.
If your commit messages are meaningful, even if you return to a project after months or years you have a much
better chance of making sense of the source-code.
Tap a commit to see specific changes this commit made to the files in question.</p>
<p>The images shown in commit-logs are determined from the email-address of the person making the commit with the
help of <a target="gravatar" href="http://gravatar.com/">gravatar.com</a>.
At the commit-list for the entire repository you can Checkout old versions of your
files by swiping left on a commit. Your repository will be in a “detached head” state where you cannot commit any changes,
but if you make modifications and wish to keep these, you should create a new branch.
</p>
<p>Checking out the topmost commit will reattach the head in such a way that your repository is back to normal.</p>
<p id="commit-undo">When not yet pushed to a remote, you can <em>Undo</em> your latest commit by swiping left in the commit-list.
All changes for that commit are kept in your working directory as modified files. If you commit again
the last commit message is remembered, making it very easy to commit again to fix typos in the
commit message or only commit some of the files, splitting a large commit into smaller ones. When the
last commit has been undone, you can <em>Undo</em> another, letting you squash several
commits into one.</p>
</div>
<div style="clear: both;"></div>
<div class="inner">
<h3 id="branching">4.2 Branches</h3>
<div class="left"><img class="left" onload="imgLoaded(this)" src="/img/branch-52-transparent.png" /></div>
<p>A great advantage of Git compared to other version-control software is the ease at which you can branch your
repository to work independently on different things.
Once you are confident with the work undertaken in a branch, you can merge
it back to one of your main branches.</p>
<p>In Working Copy you can do this from the Repository screen by tapping the current
branch name to access a list of branches. Tapping a branch brings up a detail view
where you can checkout the branch (make it current), rename or delete it. </p>
<p>You can swipe left on branches to <em>Checkout</em>, <em>Rename</em> or <em>Delete</em> without having to
go to the detail screen and when a local branch is ahead of its remote, you can <em>Push</em> as well.
</p>
<p> You create new branches from the current one with the upper-rightmost button.
To put commits on a branch you can either <em>Merge</em> or <em>Rebase</em>. Atlassian has a
great <a target="atlassian" href="https://www.atlassian.com/git/tutorials/merging-vs-rebasing/">tutorial</a>
describing the differences. In both situations you change your current branch to include commits from some
other branch.
</p>
<p>
Merge will create a merge-commit as needed, while rebase will rewrite commits from your
current branch on top of the commits from the other branch. Working Copy will not rebase if this
requires rewriting commits that have already been pushed to a server. You can override this behaviour
by configuring the branch for <em>History Rewriting</em>, but this in turn requires you to <em>Force Push</em>.
This also lets you <a href="/manual/commit-undo">Undo</a> commits already pushed to a remote.
</p>
<p>
You <em>Reset</em> the head of the current branch from the detail screen of the commit you want to
become HEAD. This is a soft reset that leaves the working directory as before the reset which can be
fixed with <em>Revert</em> as needed. If you navigate the commit list through a non-current local branch you are able
to <em>Reset</em> the head of this branch. In all cases you will be told what is about to happen as you
confirm the <em>Reset</em>.
</p>
<h3 id="pull-requests">4.3 Pull Requests</h3>
<div class="right iphonex"><img class="right animated iphonex" src="/img/pull-request.png" onload="imgLoaded(this)" /></div>
<p>
Where <em>Merge</em> and <em>Rebase</em> incorporates changes from other branches into your current
branch, a Pull Request or <em>PR</em> works in the opposite direction asking others to incorporate
changes from your current branch into some base branch. Working Copy supports creating these for
<a href="https://www.atlassian.com/git/tutorials/making-a-pull-request" target="pr">BitBucket</a>,
<a href="https://help.github.com/en/articles/about-pull-requests" target="pr">GitHub</a> and
<a href="https://docs.gitlab.com/ee/user/project/merge_requests/" target="pr">GitLab</a>.
</p>
<p>You tap <em>PR</em> from the full list of branches and pick the remote branch that should be the base of
the Pull Request. It is the base branch that receives new commits from your current branch.</p>
<p>In order to open Pull
Requests between different repositories you need to have a remote configured corresponding to the
repository with the base branch. When cloning from GitHub and GitLab the app tries to
configure a <em>upstream</em> remote when the cloned repository is a fork.
Do a single <em>Fetch</em> after enabling the upstream remote to include
this repository in your branch list.</p>
<p>Creating a Pull Request is the first step in a workflow that might involve code review, discussions or
automated verification and ends up with the pull request being accepted or closed days or weeks later. </p>
<p>You manage existing Pull Requests in your browser of with apps such as
<a href="https://githawk.com" target="app">GitHawk</a> and
<a href="https://itunes.apple.com/app/apple-store/id1371929193?mt=8" target="app">Grape for Github</a>.
Tap the pull request confirmation message to open it. Which app to use for
this is configured at the bottom of App Integration settings.
</p>
<p>Pull Request creation is a <a href="/manual/purchase">Pro feature</a>.</p>
<div style="clear: right"></div>
<h3 id="commit-graph">4.4 Commit Graph</h3>
<div class="left"><img class="left" onload="imgLoaded(this)" src="/img/commit-graph.png"
srcset="/img/commit-graph.png 200w, /img/commit-graph-400.png 400w, /img/commit-graph-645.png 645w" /></div>
<p>To explore repository changes across branches use the Commit Graph available from the Repository screen.</p>
<p>Commits are presented in chronological order with lines showing which commits are based on each other,
with tags and branch heads displayed as well as the commit message summary, date and information about the
author of the commit.
</p>
<p>Pinch to zoom will let you explore additional details, such as the full commit message, the full name of the author
rather than initials, a commit identifier and the files modified by this commit. If you connect an external
screen or projector to your device, you will get a full-screen Commit Graph without any interface elements
obscuring the view. This makes for a convenient tool when your team needs to discuss the project.</p>
<p>Tap and hold or double-tap elements of a commit for additional actions, where
the commit message itself takes you to a detail view.</p>
<p>You can copy the author email to the clipboard or start composing a email to the author.</p>
<p>It is also possible to view the commit date in your calendar to see what else happened around this time and
when <a href="https://flexibits.com/fantastical-iphone" target="fantastical">Fantastical</a> is installed,
it will be used instead of the built-in Calendar app.</p>
<div style="clear: both"></div>
<h3 id="resolve-tool">4.5 Resolving conflicts</h3>
<div class="right"><img class="right" onload="imgLoaded(this)" src="/img/resolve-tool.png" /></div>
<p>Working Copy has a built-in Resolve tool that can be used to fix conflicts for the entire repository,
a subdirectory or single files, depending on where in the directory hierarchy the tool is invoked.
Swipe left on cells for repository, directories or files to get started.</p>
<p>Text files are shown as chunks of text, where everything both files agree on start out in the center,
and everything from <em class="our">our</em> version is to the left and
<em class="their">their</em> version to the right.
You swipe these chunks towards the center to include them and away to exclude them. This way your final
file will be lined up at the center. Chunks at the border are pending your decision.
</p>
<p>If you want to use all chunks from one version of a file and discard the other version of the file entirely,
you can tap one of the branch names
at the header of the file. These are <em class="our">HEAD</em> and
<em class="their">other</em> in the screenshot.</p>
<p>There is no way to combine conflicted images and other binary files.
You need to pick one or the other by tapping the one you want.
The selected version is marked by a thick border.</p>
<p>When all chunks have been either accepted or rejected and no binary files are awaiting your choice,
tap <em>Resolve</em> to verify your choice and mark files as resolved. Next commit
will conclude the merge. If there are chunks or files pending your decision, the <em>Resolve</em>
button will scroll to indicate this.</p>
<p>You can also resolve conflicts by manually editing files. The Content tab for a conflicted file
has a <em>Resolve</em> button for marking the file as resolved, when you have picked the content
you want and removed conflict markers.</p>
<h3 id="signed-commits">4.6 Signed Commits</h3>
<p>Git supports
<a target="gitbook" href="https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work#_signing_commits">signing commits</a>
to make it possible for others to verify that commits have been made by you. When signing you need
a <a target="pgp" href="https://gnupg.org">GPG</a> private key that must be kept secret and when
verifying commits the corresponding public key is needed.</p>
<p>
You attach a private key to your Identity which can be imported or generated inside the app.
If the key is generated inside Working Copy you can attach
it to your GitHub account with a single tap or you can export the public or private parts of
the key to do manual configuration.
</p><p>
Your private key needs a passphrase. You can configure
Working Copy to <em>Ask</em> every time the passphrase is needed, to store the passphrase in the keychain
requiring you to authenticate with <em>Touch ID</em> before it is read or to just
<em>Remember</em> the passphrase in the keychain. </p>
<div class="ipad"><img class="ipad animated" play_button_bottom="20%" src="/img/commit-signing.png" onload="imgLoaded(this)" /></div>
<p>Signing commits makes it possible to verify that the commit is made by someone with access to
the private key. This information is only useful when other people can trust the private key is yours
and they need a PGP public key for this. GitHub makes this easy by letting you
<a target="github" href="https://help.github.com/articles/adding-a-new-gpg-key-to-your-github-account/">associate</a>
a public key with your <a target="github" href="https://github.com/settings/keys">user account</a>,
but commit verification is possible in other environments
by <a target="pgp" href="https://www.gnupg.org/gph/en/manual/x56.html#AEN83">importing public keys</a> into the GPG keyring.
</p>
<h3 id="tagging">4.7 Tagging</h3>
<p>Git has the ability to create a <a target="gitbook" href="https://git-scm.com/book/en/v2/Git-Basics-Tagging">tag</a> in a
repository to reference a specific point in history. This is typically used to mark a release or
other milestone on a project.</p>
<p>Create tags by navigating to a specific commit and tapping <em>Tag</em> along the top.
To create a lightweight tag you enter a name and leave the message empty. Enter a message
for a full annotated tag that includes author information, date and the message entered.
Creating annotated tags is generally considered best practice. </p>
<p>
Your tags will be send to the remote on next <em>Push</em>.
</p>
</div>
<div style="clear: both;"></div>
<h2 id="extending-ios">5. Extending iOS</h2>
<div class="inner">
<div class="right"><img class="right animated" onload="imgLoaded(this)"
play_button_bottom="23%" src="/img/extending-ios.png" /></div>
<p>All repositories in Working Copy can be accessed by other applications using the document picker or
file browser components introduced with iOS 11.
The other application is allowed to read and make changes to this file and these changes stay inside Working Copy.
You can perform editing in this application and switch to
Working Copy to review and commit changes.
</p>
<p>Initially you need to
<a target="iPad-guide" href="https://support.apple.com/en-au/HT206481#thirdparty">enable</a>
Working Copy as a Location in the Files app and on iPad you can
use <a target="iPad-guide" href="https://help.apple.com/ipad/9/#/iPad63ea0cbb">Split View</a>
to avoid switching between Working Copy and the editing application.</p>
<p><a target="app" href="https://itunes.apple.com/dk/app/textastic-code-editor-6/id1049254261?mt=8&at=1000lHq">Textastic</a> is a
very good general purpose/programmers editor that works well with Working Copy. Use <em>Open…</em>
to open files and <em>Add External Folder…</em> to open entire directories in-place. You can read more
about this in the Textastic <a target="textastic"
href="https://www.textasticapp.com/v9/manual/integration_other_apps/git_client_working_copy.html">documentation</a>.</p>
<p><a target="app" href="https://ia.net/writer">iA Writer</a> is a markdown editor
with great design and typography that can edit Working Copy files and directories in-place.
Files are added at the <em>From Other Apps</em> screen. Add entire
directories by tapping <em>Edit</em> and then <em>Add Location…</em> from the
<a target="app" href="https://ia.net/writer/support/ios/the-library">Library</a> screen.</p>
<p><a target="app" href="https://itunes.apple.com/us/app/1writer/id680469088?ls=1&mt=8&at=1000lHq">1Writer</a>
is another good Markdown editor and you open files in Working Copy by tapping <img class="oneWriter" alt="+" src="/img/1writer-plus.png"/>
in the lower right corner. If you need to work with images
<a target="app" href="https://itunes.apple.com/us/app/pixelmator/id924695435?mt=8&at=1000lHq">Pixelmator</a>
is a good choice.</p>
<div style="clear: left"></div>
<h3 id="dragdrop">5.1 Drag and Drop</h3>
<p>
Drag and Drop between apps is exclusive to iPad, and makes it much easier to get files into or out of your repositories.
</p>
<div class="ipad"><img class="ipad animated" play_button_bottom="10%" src="/img/drag-and-drop.png" onload="imgLoaded(this)" /></div>
<p>Drag files from your emails, the Files app or any other supporting app to add to your repositories.
When files already exist you can import as a new file or overwrite the existing one and when the existing file in your
repository is already committed overwriting is automatic, saving you a little time, as it is very easy to Revert to
get back old files.</p>
<p>Directories can be dragged into repositories or to the repository list to import a new repository and zip
archives can be decompressed as they are dragged.</p>
<p>When dragging files out of Working Copy the result will depend on the target app. Dragging files into
emails will attach them and dragging into the Files app will export to this location. Editing apps such as
<a target="app" href="https://itunes.apple.com/dk/app/textastic-code-editor-6/id1049254261?mt=8&at=1000lHq">Textastic</a>
that support this can receive a reference to files or directories letting them edit in-place such that changes are made
inside the repository.</p>
<div style="clear: left"></div>
<h3 id="saving">5.2 Saving to Working Copy</h3>
<div class="left"><img class="left" onload="imgLoaded(this)" src="/img/edit-in-app-transparent.png" /></div>
<p>Saving files into Working Copy can be accomplished by way of a Share sheet,
the mechanism also used to share files with Mail or Messages.
Picking <em>Save in Working Copy</em> on a Share sheet will present a list of repositories,
where you drill down to the
directory where the file should be saved.
To overwrite existing files you tap a file before confirming. Otherwise you will be prompted to
enter a new file name.</p>
<p>After saving a file you can optionally <em>Commit</em> this change immediately and <em>Push</em> to
the remote right away.</p>
<p>When saving zip-archives into Working Copy you can either import the archive as a new
repository, extract to a existing repository overwriting existing files as needed,
or you can save the zip-file as is.</p>
<h3 style="padding-top: 15px" id="edit-in-app">5.3 Edit in App</h3>
<p>In some situations you browse files in Working Copy and need to pick out a file you want to edit in
another application. The action-button in the upper-right corner used to present a share-sheet also
lets you send files to other applications.</p>
<p><em>Open In …</em> or <em>Copy to …</em> is the most basic choice and lets you pick any app
supporting that type of file. Editing will often be on a copy of the file and it must be transferred back
to Working Copy with <em>Save in Working Copy</em>, but if the app you pick
says <em>Open in</em> as opposed to <em>Copy to</em>
the application is able to edit the file in-place with no need to write back changes.
In some situations the iOS share sheet does not know whether editing will be on a copy of the
file or in-place until you have picked the action once. This has been known to happen with
<a target="app" href="https://itunes.apple.com/dk/app/textastic-code-editor-6/id1049254261?mt=8&at=1000lHq">Textastic</a>
that might start out with the action <em>Copy to Textastic</em> even though editing happens in-place.
</p>
<p>To edit with <a target="app" href="https://itunes.apple.com/app/editorial/id673907758?mt=8&at=1000lHq">Editorial</a>
you transfer a copy of the file into Editorial with a filename such that Working Copy can recognise the file later on.
This requires a workflow inside Editorial to facilitate file transfer. It
is installed the first time you use <em>Edit in Editorial</em> or if you delete
or rename the workflow. This workflow serves a dual purpose in that it receives files
when activated from Working Copy, and returns files to Working Copy when activated from Editorial. </p>
<p><p>
You will only see actions for apps you have already installed and you can change the order
by picking <em>More</em> to the far right.
</p>
</div>
<div style="clear: left"></div>
<div class="inner">
<h3 id="files-sync">5.4 Files synchronisation</h3>
<p>Some apps do not support opening files or directories in-place, but if they use
iCloud Drive or "On My Device" to store documents, you can use Files Syncronization for Git
integration.</p>