aboutsummaryrefslogtreecommitdiff
path: root/documentation/content/en/books/handbook/mirrors/_index.adoc
blob: b2977e50073e0351dde6ef4a3cbbb9664be4912b (plain) (blame)
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
1001
1002
---
title: Appendix A. Obtaining FreeBSD
part: Part V. Appendices
prev: books/handbook/partv
next: books/handbook/bibliography
description: "How to get FreeBSD: CD and DVD sets, FTP sites and how to install and use Git"
tags: ["Obtaining", "CD", "DVD", "FTP", "Git"]
showBookMenu: true
weight: 39
path: "/books/handbook/"
---

[appendix]
[[mirrors]]
= Obtaining FreeBSD
:doctype: book
:toc: macro
:toclevels: 1
:icons: font
:sectnums:
:sectnumlevels: 6
:sectnumoffset: A
:partnums:
:source-highlighter: rouge
:experimental:
:images-path: books/handbook/mirrors/

ifdef::env-beastie[]
ifdef::backend-html5[]
:imagesdir: ../../../../images/{images-path}
endif::[]
ifndef::book[]
include::shared/authors.adoc[]
include::shared/mirrors.adoc[]
include::shared/releases.adoc[]
include::shared/attributes/attributes-{{% lang %}}.adoc[]
include::shared/{{% lang %}}/teams.adoc[]
include::shared/{{% lang %}}/mailing-lists.adoc[]
include::shared/{{% lang %}}/urls.adoc[]
toc::[]
endif::[]
ifdef::backend-pdf,backend-epub3[]
include::../../../../../shared/asciidoctor.adoc[]
endif::[]
endif::[]

ifndef::env-beastie[]
toc::[]
include::../../../../../shared/asciidoctor.adoc[]
endif::[]

[[mirrors-http]]
== HTTP Mirrors

The official sources for FreeBSD are available via HTTP from a worldwide set of mirror sites.
The site {central-http} is available via HTTP and anonymous FTP.
It is made up of many machines operated by the project cluster administrators and behind GeoDNS to direct users to the closest available mirror.

[[primary]]
*{mirrors-primary}*

In case of problems, please contact the hostmaster `<{mirrors-primary-email}>` for this domain.

* {mirrors-primary-ftp4-http} / {mirrors-primary-ftp4-httpv6}
* {mirrors-primary-ftp10-http} / {mirrors-primary-ftp10-httpv6}
* {mirrors-primary-ftp14-http}

[[armenia]]
*{mirrors-armenia}*

In case of problems, please contact the hostmaster `<{mirrors-armenia-email}>` for this domain.

* {mirrors-armenia-ftp-http}

[[austria]]
*{mirrors-austria}*

In case of problems, please contact the hostmaster `<{mirrors-austria-email}>` for this domain.

* {mirrors-austria-ftp-http} / {mirrors-austria-ftp-httpv6}

[[brazil]]
*{mirrors-brazil}*

In case of problems, please contact the hostmaster `<{mirrors-brazil-email}>` for this domain.

* {mirrors-brazil-ftp2-http}

[[bulgaria]]
*{mirrors-bulgaria}*

In case of problems, please contact the hostmaster `<{mirrors-bulgaria-email}>` for this domain.

* {mirrors-bulgaria-ftp-http} / {mirrors-bulgaria-ftp-httpv6}

[[czech-republic]]
*{mirrors-czech}*

In case of problems, please contact the hostmaster `<{mirrors-czech-email}>` for this domain.

* {mirrors-czech-ftp-http} / {mirrors-czech-ftp-httpv6}
* {mirrors-czech-ftp2-http}

[[denmark]]
*{mirrors-denmark}*

In case of problems, please contact the hostmaster `<{mirrors-denmark-email}>` for this domain.

* {mirrors-denmark-ftp-http} / {mirrors-denmark-ftp-httpv6}

[[france]]
*{mirrors-france}*

In case of problems, please contact the hostmaster `<{mirrors-france-email}>` for this domain.

* {mirrors-france-ftp1-http}

[[germany]]
*{mirrors-germany}*

In case of problems, please contact the hostmaster `<{mirrors-germany-email}>` for this domain.

* http://www1.de.FreeBSD.org/freebsd/
* http://ftp2.de.FreeBSD.org/pub/FreeBSD/
* http://ftp4.de.FreeBSD.org/pub/FreeBSD/
* http://ftp7.de.FreeBSD.org/pub/FreeBSD/

[[korea]]
*{mirrors-korea}*

In case of problems, please contact the hostmaster `<{mirrors-korea-email}>` for this domain.

* {mirrors-korea-ftp2-http}

[[latvia]]
*{mirrors-latvia}*

In case of problems, please contact the hostmaster `<{mirrors-latvia-email}>` for this domain.

* {mirrors-latvia-ftp-http}

[[lithuania]]
*{mirrors-lithuania}*

In case of problems, please contact the hostmaster `<{mirrors-lithuania-email}>` for this domain.

* {mirrors-lithuania-ftp-http}

[[netherlands]]
*{mirrors-netherlands}*

In case of problems, please contact the hostmaster `<{mirrors-netherlands-email}>` for this domain.

* {mirrors-netherlands-ftp-http}

[[new-zealand]]
*{mirrors-new-zealand}*

* {mirrors-new-zealand-ftp-http}

[[russia]]
*{mirrors-russia}*

In case of problems, please contact the hostmaster `<{mirrors-russia-email}>` for this domain.

* {mirrors-russia-ftp-http}
* {mirrors-russia-ftp2-http}
* {mirrors-russia-ftp5-http}

[[spain]]
*{mirrors-spain}*

In case of problems, please contact the hostmaster `<{mirrors-spain-email}>` for this domain.

* {mirrors-spain-ftp-http}

[[sweden]]
*{mirrors-sweden}*

In case of problems, please contact the hostmaster `<{mirrors-sweden-email}>` for this domain.

* {mirrors-sweden-ftp4-http} / {mirrors-sweden-ftp4-httpv6}
* {mirrors-sweden-ftp6-http}

[[switzerland]]
*{mirrors-switzerland}*

In case of problems, please contact the hostmaster `<{mirrors-switzerland-email}>` for this domain.

* {mirrors-switzerland-ftp-http}

[[taiwan]]
*{mirrors-taiwan}*

In case of problems, please contact the hostmaster `<{mirrors-taiwan-email}>` for this domain.

* {mirrors-taiwan-ftp2-http} / {mirrors-taiwan-ftp2-httpv6}
* {mirrors-taiwan-ftp11-http}

[[ukraine]]
*{mirrors-ukraine}*

* {mirrors-ukraine-ftp-http}
* {mirrors-ukraine-ftp6-http}

[[usa]]
*{mirrors-us}*

In case of problems, please contact the hostmaster `<{mirrors-us-email}>` for this domain.

* {mirrors-us-ftp4-http} / {mirrors-us-ftp4-httpv6}
* {mirrors-us-ftp13-http}
* {mirrors-us-ftp14-http}

[[mirrors-ftp]]
== FTP Sites

In addition to HTTP mirrors, FreeBSD is available via anonymous FTP from the following sites.
When obtaining FreeBSD via anonymous FTP, please try to use a nearby site.
The mirror sites listed as "Primary Mirror Sites" typically have the entire FreeBSD archive (all the currently available versions for each of the architectures) but faster download speeds are probably available from a site that is in your country or region.
The regional sites carry the most recent versions for the most popular architecture(s) but might not carry the entire FreeBSD archive.
All sites provide access via anonymous FTP but some sites also provide access via other methods.
The access methods available for each site are provided in parentheses after the hostname.

<<central, {central}>>, <<primary, {mirrors-primary}>>, <<armenia, {mirrors-armenia}>>, <<australia, {mirrors-australia}>>, <<austria, {mirrors-austria}>>, <<brazil, {mirrors-brazil}>>, <<bulgaria, {mirrors-bulgaria}>>, <<czech-republic, {mirrors-czech}>>, <<denmark, {mirrors-denmark}>>, <<estonia, {mirrors-estonia}>>, <<finland, {mirrors-finland}>>, <<france, {mirrors-france}>>, <<germany, {mirrors-germany}>>, <<greece, {mirrors-greece}>>, <<hong-kong, {mirrors-hongkong}>>, <<ireland, {mirrors-ireland}>>, <<japan, {mirrors-japan}>>, <<korea, {mirrors-korea}>>, <<latvia, {mirrors-latvia}>>, <<lithuania, {mirrors-lithuania}>>, <<netherlands, {mirrors-netherlands}>>, <<new-zealand, {mirrors-new-zealand}>>, <<norway, {mirrors-norway}>>, <<poland, {mirrors-poland}>>, <<russia, {mirrors-russia}>>, <<saudi-arabia, {mirrors-saudi-arabia}>>, <<slovenia, {mirrors-slovenia}>>, <<south-africa, {mirrors-south-africa}>>, <<spain, {mirrors-spain}>>, <<sweden, {mirrors-sweden}>>, <<switzerland, {mirrors-switzerland}>>, <<taiwan, {mirrors-taiwan}>>, <<ukraine, {mirrors-ukraine}>>, <<uk, {mirrors-uk}>>, <<usa, {mirrors-us}>>.

[[central]]
*{central}*

{central-ftp} (ftp / ftpv6)

[[primary]]
*{mirrors-primary}*

In case of problems, please contact the hostmaster `<{mirrors-primary-email}>` for this domain.

* {mirrors-primary-ftp1}
* {mirrors-primary-ftp2}
* {mirrors-primary-ftp3}
* {mirrors-primary-ftp4} (ftp / ftpv6)
* {mirrors-primary-ftp5}
* {mirrors-primary-ftp6}
* {mirrors-primary-ftp7}
* {mirrors-primary-ftp10} (ftp / ftpv6)
* {mirrors-primary-ftp11}
* {mirrors-primary-ftp13}
* {mirrors-primary-ftp14}

[[armenia]]
*{mirrors-armenia}*

In case of problems, please contact the hostmaster `<{mirrors-armenia-email}>` for this domain.

* {mirrors-armenia-ftp} (ftp / rsync)

[[australia]]
*{mirrors-australia}*

In case of problems, please contact the hostmaster `<{mirrors-australia-email}>` for this domain.

* {mirrors-australia-ftp}
* {mirrors-australia-ftp2}
* {mirrors-australia-ftp3}

[[austria]]
*{mirrors-austria}*

In case of problems, please contact the hostmaster `<{mirrors-austria-email}>` for this domain.

* {mirrors-austria-ftp} (ftp / ftpv6)

[[brazil]]
*{mirrors-brazil}*

In case of problems, please contact the hostmaster `<{mirrors-brazil-email}>` for this domain.

* {mirrors-brazil-ftp2}
* {mirrors-brazil-ftp3} (ftp / rsync)
* {mirrors-brazil-ftp4}

[[bulgaria]]
*{mirrors-bulgaria}*

In case of problems, please contact the hostmaster `<{mirrors-bulgaria-email}>` for this domain.

* {mirrors-bulgaria-ftp} (ftp / {mirrors-bulgaria-ftpv6} / rsync / rsyncv6)

[[czech-republic]]
*{mirrors-czech}*

In case of problems, please contact the hostmaster `<{mirrors-czech-email}>` for this domain.

* {mirrors-czech-ftp} (ftp / {mirrors-czech-ftpv6} / rsync / rsyncv6)
* {mirrors-czech-ftp2}

[[denmark]]
*{mirrors-denmark}*

In case of problems, please contact the hostmaster `<{mirrors-denmark-email}>` for this domain.

* {mirrors-denmark-ftp} (ftp / ftpv6)

[[estonia]]
*{mirrors-estonia}*

In case of problems, please contact the hostmaster `<{mirrors-estonia-email}>` for this domain.

* {mirrors-estonia-ftp}

[[finland]]
*{mirrors-finland}*

In case of problems, please contact the hostmaster `<{mirrors-finland-email}>` for this domain.

* {mirrors-finland-ftp}

[[france]]
*{mirrors-france}*

In case of problems, please contact the hostmaster `<{mirrors-france-email}>` for this domain.

* {mirrors-france-ftp}
* {mirrors-france-ftp1} (ftp / rsync)
* {mirrors-france-ftp3}
* {mirrors-france-ftp5}
* {mirrors-france-ftp6} (ftp / rsync)
* {mirrors-france-ftp7}
* {mirrors-france-ftp8}

[[germany]]
*{mirrors-germany}*

In case of problems, please contact the hostmaster `<{mirrors-germany-email}>` for this domain.

* ftp://ftp.de.FreeBSD.org/pub/FreeBSD/
* ftp://ftp1.de.FreeBSD.org/freebsd/
* ftp://ftp2.de.FreeBSD.org/pub/FreeBSD/ (ftp / rsync)
* ftp://ftp4.de.FreeBSD.org/FreeBSD/
* ftp://ftp5.de.FreeBSD.org/pub/FreeBSD/
* ftp://ftp7.de.FreeBSD.org/pub/FreeBSD/

[[greece]]
*{mirrors-greece}*

In case of problems, please contact the hostmaster `<{mirrors-greece-email}>` for this domain.

* {mirrors-greece-ftp}
* {mirrors-greece-ftp2}

[[hong-kong]]
*{mirrors-hongkong}*

{mirrors-hongkong-ftp}

[[ireland]]
*{mirrors-ireland}*

In case of problems, please contact the hostmaster `<{mirrors-ireland-email}>` for this domain.

* {mirrors-ireland-ftp} (ftp / rsync) 

[[japan]]
*{mirrors-japan}*

In case of problems, please contact the hostmaster `<{mirrors-japan-email}>` for this domain.

* {mirrors-japan-ftp}
* {mirrors-japan-ftp2}
* {mirrors-japan-ftp3}
* {mirrors-japan-ftp4}
* {mirrors-japan-ftp5}
* {mirrors-japan-ftp6}
* {mirrors-japan-ftp7}
* {mirrors-japan-ftp8}
* {mirrors-japan-ftp9}

[[korea]]
*{mirrors-korea}*

In case of problems, please contact the hostmaster `<{mirrors-korea-email}>` for this domain.

* {mirrors-korea-ftp} (ftp / rsync)
* {mirrors-korea-ftp2}

[[latvia]]
*{mirrors-latvia}*

In case of problems, please contact the hostmaster `<{mirrors-latvia-email}>` for this domain.

* {mirrors-latvia-ftp}

[[lithuania]]
*{mirrors-lithuania}*

In case of problems, please contact the hostmaster `<{mirrors-lithuania-email}>` for this domain.

* {mirrors-lithuania-ftp}

[[netherlands]]
*{mirrors-netherlands}*

In case of problems, please contact the hostmaster `<{mirrors-netherlands-email}>` for this domain.

* {mirrors-netherlands-ftp} (ftp / rsync)
* {mirrors-netherlands-ftp2}

[[new-zealand]]
*{mirrors-new-zealand}*

* {mirrors-new-zealand-ftp}

[[norway]]
*{mirrors-norway}*

In case of problems, please contact the hostmaster `<{mirrors-norway-email}>` for this domain.

* {mirrors-norway-ftp} (ftp / rsync) 

[[poland]]
*{mirrors-poland}*

In case of problems, please contact the hostmaster `<{mirrors-poland-email}>` for this domain.

* {mirrors-poland-ftp}
* ftp2.pl.FreeBSD.org

[[russia]]
*{mirrors-russia}*

In case of problems, please contact the hostmaster `<{mirrors-russia-email}>` for this domain.

* {mirrors-russia-ftp} (ftp / rsync)
* {mirrors-russia-ftp2} (ftp / rsync)
* {mirrors-russia-ftp5} (ftp / rsync)
* {mirrors-russia-ftp6}

[[saudi-arabia]]
*{mirrors-saudi-arabia}*

In case of problems, please contact the hostmaster `<{mirrors-saudi-arabia-email}>` for this domain.

* {mirrors-saudi-arabia-ftp}

[[slovenia]]
*{mirrors-slovenia}*

In case of problems, please contact the hostmaster `<{mirrors-slovenia-email}>` for this domain.

* {mirrors-slovenia-ftp}

[[south-africa]]
*{mirrors-south-africa}*

In case of problems, please contact the hostmaster `<{mirrors-south-africa-email}>` for this domain.

* {mirrors-south-africa-ftp}
* {mirrors-south-africa-ftp2}
* {mirrors-south-africa-ftp4}

[[spain]]
*{mirrors-spain}*

In case of problems, please contact the hostmaster `<{mirrors-spain-email}>` for this domain.

* {mirrors-spain-ftp}
* {mirrors-spain-ftp3}

[[sweden]]
*{mirrors-sweden}*

In case of problems, please contact the hostmaster `<{mirrors-sweden-email}>` for this domain.

* {mirrors-sweden-ftp}
* {mirrors-sweden-ftp2}
* {mirrors-sweden-ftp3}
* {mirrors-sweden-ftp4} (ftp / {mirrors-sweden-ftp4v6})
* {mirrors-sweden-ftp6}

[[switzerland]]
*{mirrors-switzerland}*

In case of problems, please contact the hostmaster `<{mirrors-switzerland-email}>` for this domain.

* {mirrors-switzerland-ftp}

[[taiwan]]
*{mirrors-taiwan}*

In case of problems, please contact the hostmaster `<{mirrors-taiwan-email}>` for this domain.

* {mirrors-taiwan-ftp} (ftp / {mirrors-taiwan-ftpv6} / rsync / rsyncv6)
* {mirrors-taiwan-ftp2} (ftp / {mirrors-taiwan-ftp2v6} / rsync / rsyncv6)
* {mirrors-taiwan-ftp4}
* {mirrors-taiwan-ftp5}
* {mirrors-taiwan-ftp6} (ftp / {mirrors-taiwan-ftp6v6} / rsync)
* {mirrors-taiwan-ftp7}
* {mirrors-taiwan-ftp8}
* {mirrors-taiwan-ftp11}
* {mirrors-taiwan-ftp12}
* {mirrors-taiwan-ftp13}
* {mirrors-taiwan-ftp14}
* {mirrors-taiwan-ftp15}

[[ukraine]]
*{mirrors-ukraine}*

* {mirrors-ukraine-ftp}
* {mirrors-ukraine-ftp6}
* {mirrors-ukraine-ftp7}

[[uk]]
*{mirrors-uk}*

In case of problems, please contact the hostmaster `<{mirrors-uk-email}>` for this domain.

* {mirrors-uk-ftp}
* {mirrors-uk-ftp2}
* {mirrors-uk-ftp3}
* {mirrors-uk-ftp4}
* {mirrors-uk-ftp5}

[[usa]]
*{mirrors-us}*

In case of problems, please contact the hostmaster `<{mirrors-us-email}>` for this domain.

* {mirrors-us-ftp}
* {mirrors-us-ftp2}
* {mirrors-us-ftp3}
* {mirrors-us-ftp4} (ftp / ftpv6)
* {mirrors-us-ftp5}
* {mirrors-us-ftp6}
* {mirrors-us-ftp8}
* {mirrors-us-ftp10}
* {mirrors-us-ftp11}
* {mirrors-us-ftp13} (ftp / rsync)
* {mirrors-us-ftp14}
* {mirrors-us-ftp15}

[[git]]
== Using Git

[[git-intro]]
=== Introduction

As of December 2020, FreeBSD uses git as the primary version control system for storing all of FreeBSD's base source code and documentation.
As of April 2021, FreeBSD uses git as the only version control system for storing all of FreeBSD's Ports Collection.

[NOTE]
====
Git is generally a developer tool.
Users may prefer to use `freebsd-update` (crossref:cutting-edge[updating-upgrading-freebsdupdate,“FreeBSD Update”]) to update the FreeBSD base system, and `portsnap` (crossref:ports[ports-using,“Using the Ports Collection”]) to update the FreeBSD Ports Collection.
====

This section demonstrates how to install Git on a FreeBSD system and use it to create a local copy of a FreeBSD repository.
Additional information on the use of Git is included.

[[git-install]]
=== Installation

Git can be installed as a package:

[source,shell]
....
# pkg install git
....

Git can also be installed from the Ports Collection:

[source,shell]
....
# cd /usr/ports/devel/git
# make install clean
....

[[git-usage]]
=== Running Git

To fetch a clean copy of the sources into a local directory, use `git`.
This directory of files is called the _working tree_.

[WARNING]
====

Move or delete an existing destination directory before using `git clone` for the first time.
Cloning over an existing non-git directory will fail.
====

Git uses URLs to designate a repository, taking the form of _protocol://hostname/path_.
The first component of the path is the FreeBSD repository to access.
There are three different repositories, `src` for the FreeBSD system source code, `doc` for documentation, and `ports` for the FreeBSD Ports Collection.
For example, the URL `https://git.FreeBSD.org/src.git` specifies the main branch of the src repository, using the `https` protocol.

[[git-url-table]]
.FreeBSD Git Repository URL Table
[options="header,footer"]
|=======================================================
|Item | Git URL
| Web-based repository browser src         | `https://cgit.freebsd.org/src`
| Read-only src repo via HTTPS             | `https://git.freebsd.org/src.git`
| Read-only src repo via anon-ssh          | `ssh://anongit@git.freebsd.org/src.git`
| Read/write src repo for committers       | `ssh://git@gitrepo.freebsd.org/src.git` (*)
| Web-based repository browser doc         | `https://cgit.freebsd.org/doc`
| Read-only doc repo via HTTPS             | `https://git.freebsd.org/doc.git`
| Read-only doc repo via anon-ssh          | `ssh://anongit@git.freebsd.org/doc.git`
| Read/write doc repo for committers       | `ssh://git@gitrepo.freebsd.org/doc.git` (*)
| Web-based repository browser ports       | `https://cgit.freebsd.org/ports`
| Read-only ports repo via HTTPS           | `https://git.freebsd.org/ports.git`
| Read-only ports repo via anon-ssh        | `ssh://anongit@git.freebsd.org/ports.git`
| Read/write ports repo for committers     | `ssh://git@gitrepo.freebsd.org/ports.git` (*)
|=======================================================
  - (*) `git` is a special user on the repository server which will map your registered ssh key in FreeBSD.org to your identity, no need to change it.

[WARNING]
====
Sometime after the switch to git is complete, `gitrepo.freebsd.org` will change to simply `repo.freebsd.org`.
====

To get started, clone a copy of the FreeBSD repository:

[source,shell]
....
# git clone -o freebsd [ -b branch ] https://git.FreeBSD.org/repo.git wcdir
....

where:

* _repo_ is one of the Project repositories: `src`, `ports`, or `doc`.
* _branch_ depends on the repository used.
`ports` and `doc` are mostly updated in the `main` branch, while `src` maintains the latest version of -CURRENT under `main` and the respective latest versions of the -STABLE branches under `stable/12` (12._x_) and `stable/13` (13._x_).
* _wcdir_ is the target directory where the contents of the specified branch should be placed.
This is usually [.filename]#/usr/ports# for `ports`, [.filename]#/usr/src# for `src`, and [.filename]#/usr/doc# for `doc`.
* _freebsd_ is the name of the origin to use.
By convention in the FreeBSD documentation, the origin is assumed to be `freebsd`.

This example checks out the `main` branch of the system sources from the FreeBSD repository using the HTTPS protocol, placing the local working copy in [.filename]#/usr/src#.
If [.filename]#/usr/src# is already present but was not created by `git`, remember to rename or delete it before the checkout.
Git will refuse to do anything otherwise.

[source,shell]
....
# git clone -o freebsd https://git.FreeBSD.org/src.git /usr/src
....

Because the initial checkout must download the full branch of the remote repository, it can take a while.
Please be patient.

After the initial checkout, the local working copy can be updated by running:

[source,shell]
....
# cd wcdir
# git pull --rebase
....

To update [.filename]#/usr/src# created in the example above, use:

[source,shell]
....
# cd /usr/src
# git pull --rebase
....

The update is much quicker than a checkout, only transferring files that have changed.

There are also external mirrors maintained by project members available, please refer to the <<external-mirrors>> section.

=== SSH related information

* `ssh://${user}@${url}/${repo}.git` can be written as `${user}@${url}:${repo}.git`, i.e., following two URLs are both valid for passing to `git`:
--
** `ssh://anongit@git.freebsd.org/${repo}.git`
** `anongit@git.freebsd.org:${repo}.git`

As well as the read-write repo:

** `ssh://git@(git)repo.freebsd.org/${repo}.git`
** `git@(git)repo.freebsd.org:${repo}.git`
--

* gitrepo.FreeBSD.org host key fingerprints:
** ECDSA key fingerprint is `SHA256:seWO5D27ySURcx4bknTNKlC1mgai0whP443PAKEvvZA`
** ED25519 key fingerprint is `SHA256:lNR6i4BEOaaUhmDHBA1WJsO7H3KtvjE2r5q4sOxtIWo`
** RSA key fingerprint is `SHA256:f453CUEFXEJAXlKeEHV+ajJfeEfx9MdKQUD7lIscnQI`

* git.FreeBSD.org host key fingerprints:
** ECDSA key fingerprint is `SHA256:/UlirUAsGiitupxmtsn7f9b7zCWd0vCs4Yo/tpVWP9w`
** ED25519 key fingerprint is `SHA256:y1ljKrKMD3lDObRUG3xJ9gXwEIuqnh306tSyFd1tuZE`
** RSA key fingerprint is `SHA256:jBe6FQGoH4HjvrIVM23dcnLZk9kmpdezR/CvQzm7rJM`

These are also published as SSHFP records in DNS.

=== Web-based repository browser

The FreeBSD project currently uses cgit as the web-based repository browser: https://cgit.freebsd.org/.
The URLs of individual repositories are listed in <<git-url-table>>.

=== For Users

Using `git clone` and `git pull` from the official distributed mirrors is recommended.
The GeoDNS should direct you to the nearest mirror to you.

=== For Developers

Please see the extref:{committers-guide}[Committer's Guide, git-mini-primer].

[[external-mirrors]]
=== External mirrors

Those mirrors are not hosted in FreeBSD.org but still maintained by the project members.
Users and developers are welcome to pull or browse repositories on those mirrors.
The project workflow with those mirrors are still under discussion.

==== Codeberg
  - doc: https://codeberg.org/FreeBSD/freebsd-doc
  - ports: https://codeberg.org/FreeBSD/freebsd-ports
  - src: https://codeberg.org/FreeBSD/freebsd-src

==== GitHub
  - doc: https://github.com/freebsd/freebsd-doc
  - ports: https://github.com/freebsd/freebsd-ports
  - src: https://github.com/freebsd/freebsd-src

==== GitLab
  - doc: https://gitlab.com/FreeBSD/freebsd-doc
  - ports: https://gitlab.com/FreeBSD/freebsd-ports
  - src: https://gitlab.com/FreeBSD/freebsd-src

=== Mailing lists

General usage and questions about git in the FreeBSD project: https://lists.freebsd.org/subscription/freebsd-git[freebsd-git]

Commit messages will be sent to the following mailing lists:

- https://lists.freebsd.org/subscription/dev-commits-doc-all[dev-commits-doc-all]: All changes to the doc repository
- https://lists.freebsd.org/subscription/dev-commits-ports-all[dev-commits-ports-all]: All changes to the ports repository
- https://lists.freebsd.org/subscription/dev-commits-ports-main[dev-commits-ports-main]: All changes to the "main" branch of the ports repository
- https://lists.freebsd.org/subscription/dev-commits-ports-branches[dev-commits-ports-branches]: All changes to the quarterly branches of the ports repository
- https://lists.freebsd.org/subscription/dev-commits-src-all[dev-commits-src-all]: All changes to the src repository
- https://lists.freebsd.org/subscription/dev-commits-src-main[dev-commits-src-main]: All changes to the "main" branch of the src repository (the FreeBSD-CURRENT branch)
- https://lists.freebsd.org/subscription/dev-commits-src-branches[dev-commits-src-branches]: All changes to all stable branches of the src repository

For more information, please refer to the "Commit message lists" section of C.2.
"Mailing Lists" in handbook: crossref:handbook/eresources[eresources-mail, Mailing lists].

[[svn]]
== Using Subversion

[[svn-intro]]
=== Introduction

As of December 2020, FreeBSD uses git as the primary version control system for storing all of FreeBSD's source code and documentation.
Changes from the git repo on the `stable/11`, `stable/12` and related releng branches are exported to the subversion repository.
This export will continue through the life of these branches.
From July 2012 to March 2021, FreeBSD used Subversion as the only version control system for storing all of FreeBSD's Ports Collection.
As of April 2021, FreeBSD uses git as the only version control system for storing all of FreeBSD's Ports Collection.

[NOTE]
====
Subversion is generally a developer tool.
Users may prefer to use `freebsd-update` (crossref:cutting-edge[updating-upgrading-freebsdupdate,“FreeBSD Update”]) to update the FreeBSD base system, and `portsnap` (crossref:ports[ports-using,“Using the Ports Collection”]) to update the FreeBSD Ports Collection.
After March 2021, subversion use is only for legacy branches (`stable/11` and `stable/12`).
====

This section demonstrates how to install Subversion on a FreeBSD system and use it to create a local copy of a FreeBSD repository. Additional information on the use of Subversion is included.

[[svn-svnlite]]
=== Svnlite

A lightweight version of Subversion is already installed on FreeBSD as `svnlite`.
The port or package version of Subversion is only needed if the Python or Perl API is needed, or if a later version of Subversion is desired.

The only difference from normal Subversion use is that the command name is `svnlite`.

[[svn-install]]
=== Installation

If `svnlite` is unavailable or the full version of Subversion is needed, then it must be installed.

Subversion can be installed from the Ports Collection:

[source,shell]
....
# cd /usr/ports/devel/subversion
# make install clean
....

Subversion can also be installed as a package:

[source,shell]
....
# pkg install subversion
....

[[svn-usage]]
=== Running Subversion

To fetch a clean copy of the sources into a local directory, use `svn`.
The files in this directory are called a _local working copy_.

[WARNING]
====
Move or delete an existing destination directory before using `checkout` for the first time.
Checkout over an existing non-`svn` directory can cause conflicts between the existing files and those brought in from the repository.
====

Subversion uses URLs to designate a repository, taking the form of _protocol://hostname/path_.
The first component of the path is the FreeBSD repository to access.
There are three different repositories, `base` for the FreeBSD base system source code, `ports` for the Ports Collection, and `doc` for documentation.
For example, the URL `https://svn.FreeBSD.org/base/head/` specifies the main branch of the src repository, using the `https` protocol.

A checkout from a given repository is performed with a command like this:

[source,shell]
....
# svn checkout https://svn.FreeBSD.org/repository/branch lwcdir
....

where:

* _repository_ is one of the Project repositories: `base`, `ports`, or `doc`.
* _branch_ depends on the repository used. `ports` and `doc` are mostly updated in the `head` branch, while `base` maintains the latest version of -CURRENT under `head` and the respective latest versions of the -STABLE branches under `stable/11` (11._x_) and `stable/12` (12._x_).
* _lwcdir_ is the target directory where the contents of the specified branch should be placed. This is usually [.filename]#/usr/ports# for `ports`, [.filename]#/usr/src# for `base`, and [.filename]#/usr/doc# for `doc`.

This example checks out the Source Tree from the FreeBSD repository using the HTTPS protocol, placing the local working copy in [.filename]#/usr/src#.
If [.filename]#/usr/src# is already present but was not created by `svn`, remember to rename or delete it before the checkout.

[source,shell]
....
# svn checkout https://svn.FreeBSD.org/base/head /usr/src
....

Because the initial checkout must download the full branch of the remote repository, it can take a while.
Please be patient.

After the initial checkout, the local working copy can be updated by running:

[source,shell]
....
# svn update lwcdir
....

To update [.filename]#/usr/src# created in the example above, use:

[source,shell]
....
# svn update /usr/src
....

The update is much quicker than a checkout, only transferring files that have changed.

An alternate way of updating the local working copy after checkout is provided by the [.filename]#Makefile# in the [.filename]#/usr/ports#, [.filename]#/usr/src#, and [.filename]#/usr/doc# directories.
Set `SVN_UPDATE` and use the `update` target.
For example, to update [.filename]#/usr/src#:

[source,shell]
....
# cd /usr/src
# make update SVN_UPDATE=yes
....

[[svn-mirrors]]
=== Subversion Mirror Sites

The FreeBSD Subversion repository is:

[.programlisting]
....
svn.FreeBSD.org
....

This is a publicly accessible mirror network that uses GeoDNS to select an appropriate back end server.
To view the FreeBSD Subversion repositories through a browser, use https://svnweb.FreeBSD.org/[https://svnweb.FreeBSD.org/].

HTTPS is the preferred protocol, but the [.filename]#security/ca_root_nss# package will need to be installed in order to automatically validate certificates.

=== For More Information

For other information about using Subversion, please see the "Subversion Book", titled http://svnbook.red-bean.com/[Version Control with Subversion], or the http://subversion.apache.org/docs/[Subversion Documentation].

[[mirrors-rsync]]
== Using rsync

These sites make FreeBSD available through the rsync protocol.
The rsync utility transfers only the differences between two sets of files.
This is useful for mirror sites of the FreeBSD FTP server.
The rsync suite is available for many operating systems, on FreeBSD, see the package:net/rsync[] port or use the package.

Czech Republic::
rsync://ftp.cz.FreeBSD.org/
+
Available collections:

** ftp: A partial mirror of the FreeBSD FTP server.
** FreeBSD: A full mirror of the FreeBSD FTP server.

Germany::
rsync://rsync3.de.FreeBSD.org/freebsd/

Netherlands::
rsync://ftp.nl.FreeBSD.org/
+
Available collections:

** FreeBSD: A full mirror of the FreeBSD FTP server.

Russia::
rsync://ftp.mtu.ru/
+
Available collections:

** FreeBSD: A full mirror of the FreeBSD FTP server.
** FreeBSD-Archive: The mirror of FreeBSD Archive FTP server.

Sweden::
rsync://ftp4.se.freebsd.org/
+
--
Available collections:

** FreeBSD: A full mirror of the FreeBSD FTP server.
--
+
{mirrors-sweden-ftp2-rsync}
+
{mirrors-sweden-ftp4-rsync}
+
{mirrors-sweden-ftp4-rsyncv6}

Taiwan::
rsync://ftp.tw.FreeBSD.org/
+
rsync://ftp2.tw.FreeBSD.org/
+
rsync://ftp6.tw.FreeBSD.org/
+
Available collections:

** FreeBSD: A full mirror of the FreeBSD FTP server.

Ukraine::
{mirrors-ukraine-ftp6-rsync}

United Kingdom::
rsync://rsync.mirrorservice.org/
+
--
Available collections:

** ftp.freebsd.org: A full mirror of the FreeBSD FTP server.
--
+
{mirrors-uk-ftp2-rsync}

United States of America::
rsync://ftp-master.FreeBSD.org/
+
This server may only be used by FreeBSD primary mirror sites.
+
Available collections:
+
--
** FreeBSD: The master archive of the FreeBSD FTP server.
** acl: The FreeBSD master ACL list.
--
+
rsync://ftp13.FreeBSD.org/
+
Available collections:

** FreeBSD: A full mirror of the FreeBSD FTP server.

[[mirrors-cdrom]]
== CD and DVD Sets

FreeBSD CD and DVD sets are available from several online retailers:

* FreeBSD Mall, Inc. +
2420 Sand Creek Rd C-1 #347 +
Brentwood, CA +
94513 +
USA +
Phone: +1 925 240-6652 +
Fax: +1 925 674-0821 +
Email: <info@freebsdmall.com> +
WWW: https://www.freebsdmall.com

* Getlinux +
78 Rue de la Croix Rochopt +
Épinay-sous-Sénart +
91860 +
France +
Email: <contact@getlinux.fr> +
WWW: http://www.getlinux.fr/

* Dr. Hinner EDV +
Kochelseestr. 11 +
D-81371 München +
Germany +
Phone: (0177) 428 419 0 +
Email: <infow@hinner.de> +
WWW: http://www.hinner.de/linux/freebsd.html