Hash :
60aa1fa0
Author :
Date :
2022-03-17T16:38:43
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 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064
.\"
.\" Copyright (c) 2017 Martin Pieuchot
.\" Copyright (c) 2018, 2019, 2020 Stefan Sperling
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate$
.Dt GOT 1
.Os
.Sh NAME
.Nm got
.Nd Game of Trees
.Sh SYNOPSIS
.Nm
.Ar command
.Op Fl h
.Op Ar arg ...
.Sh DESCRIPTION
.Nm
is a version control system which stores the history of tracked files
in a Git repository, as used by the Git version control system.
This repository format is described in
.Xr git-repository 5 .
.Pp
.Nm
is a
.Dq distributed
version control system because every copy of a repository is writeable.
Modifications made to files can be synchronized between repositories
at any time.
.Pp
Files managed by
.Nm
must be checked out from the repository for modification.
Checked out files are stored in a
.Em work tree
which can be placed at an arbitrary directory in the filesystem hierarchy.
The on-disk format of this work tree is described in
.Xr got-worktree 5 .
.Pp
.Nm
provides global and command-specific options.
Global options must precede the command name, and are as follows:
.Bl -tag -width tenletters
.It Fl h
Display usage information and exit immediately.
.It Fl V , -version
Display program version and exit immediately.
.El
.Pp
The commands for
.Nm
are as follows:
.Bl -tag -width checkout
.It Cm init Ar repository-path
Create a new empty repository at the specified
.Ar repository-path .
.Pp
After
.Cm got init ,
the
.Cm got import
command must be used to populate the empty repository before
.Cm got checkout
can be used.
.Tg im
.It Cm import Oo Fl b Ar branch Oc Oo Fl m Ar message Oc Oo Fl r Ar repository-path Oc Oo Fl I Ar pattern Oc Ar directory
.Dl Pq alias: Cm im
Create an initial commit in a repository from the file hierarchy
within the specified
.Ar directory .
The created commit will not have any parent commits, i.e. it will be a
root commit.
Also create a new reference which provides a branch name for the newly
created commit.
Show the path of each imported file to indicate progress.
.Pp
The
.Cm got import
command requires the
.Ev GOT_AUTHOR
environment variable to be set,
unless an author has been configured in
.Xr got.conf 5
or Git's
.Dv user.name
and
.Dv user.email
configuration settings can be obtained from the repository's
.Pa .git/config
file or from Git's global
.Pa ~/.gitconfig
configuration file.
.Pp
The options for
.Cm got import
are as follows:
.Bl -tag -width Ds
.It Fl b Ar branch
Create the specified
.Ar branch
instead of creating the default branch
.Dq main .
Use of this option is required if the
.Dq main
branch already exists.
.It Fl m Ar message
Use the specified log message when creating the new commit.
Without the
.Fl m
option,
.Cm got import
opens a temporary file in an editor where a log message can be written.
.It Fl r Ar repository-path
Use the repository at the specified path.
If not specified, assume the repository is located at or above the current
working directory.
.It Fl I Ar pattern
Ignore files or directories with a name which matches the specified
.Ar pattern .
This option may be specified multiple times to build a list of ignore patterns.
The
.Ar pattern
follows the globbing rules documented in
.Xr glob 7 .
.El
.Tg cl
.It Cm clone Oo Fl a Oc Oo Fl b Ar branch Oc Oo Fl l Oc Oo Fl m Oc Oo Fl q Oc Oo Fl v Oc Oo Fl R Ar reference Oc Ar repository-URL Op Ar directory
.Dl Pq alias: Cm cl
Clone a Git repository at the specified
.Ar repository-URL
into the specified
.Ar directory .
If no
.Ar directory
is specified the directory name will be derived from the name of the
cloned repository.
.Cm got clone
will refuse to run if the
.Ar directory
already exists.
.Pp
The
.Ar repository-URL
specifies a protocol scheme, a server hostname, an optional port number
separated from the hostname by a colon, and a path to the repository on
the server:
.Lk scheme://hostname:port/path/to/repository
.Pp
The following protocol schemes are supported:
.Bl -tag -width git+ssh
.It git
The Git protocol as implemented by the
.Xr git-daemon 1
server.
Use of this protocol is discouraged since it supports neither authentication
nor encryption.
.It git+ssh
The Git protocol wrapped in an authenticated and encrypted
.Xr ssh 1
tunnel.
With this protocol the hostname may contain an embedded username for
.Xr ssh 1
to use:
.Mt user@hostname
.It ssh
Short alias for git+ssh.
.El
.Pp
Objects in the cloned repository are stored in a pack file which is downloaded
from the server.
This pack file will then be indexed to facilitate access to the objects stored
within.
If any objects in the pack file are stored in deltified form, all deltas will
be fully resolved in order to compute the ID of such objects.
This can take some time.
More details about the pack file format are documented in
.Xr git-repository 5 .
.Pp
.Cm got clone
creates a remote repository entry in the
.Xr got.conf 5
and
.Pa config
files of the cloned repository to store the
.Ar repository-url
and any
.Ar branch
or
.Ar reference
arguments for future use by
.Cm got fetch
or
.Xr git-fetch 1 .
.Pp
The options for
.Cm got clone
are as follows:
.Bl -tag -width Ds
.It Fl a
Fetch all branches from the remote repository's
.Dq refs/heads/
reference namespace and set
.Cm fetch-all-branches
in the cloned repository's
.Xr got.conf 5
file for future use by
.Cm got fetch .
If this option is not specified, a branch resolved via the remote
repository's HEAD reference will be fetched.
Cannot be used together with the
.Fl b
option.
.It Fl b Ar branch
Fetch the specified
.Ar branch
from the remote repository's
.Dq refs/heads/
reference namespace.
This option may be specified multiple times to build a list of branches
to fetch.
If the branch corresponding to the remote repository's HEAD reference is not
in this list, the cloned repository's HEAD reference will be set to the first
branch which was fetched.
If this option is not specified, a branch resolved via the remote
repository's HEAD reference will be fetched.
Cannot be used together with the
.Fl a
option.
.It Fl l
List branches and tags available for fetching from the remote repository
and exit immediately.
Cannot be used together with any of the other options except
.Fl q
and
.Fl v .
.It Fl m
Create the cloned repository as a mirror of the original repository.
This is useful if the cloned repository will not be used to store
locally created commits.
.Pp
The repository's
.Xr got.conf 5
and
.Pa config
files will be set up with the
.Dq mirror
option enabled, such that
.Cm got fetch
or
.Xr git-fetch 1
will write incoming changes directly to branches in the
.Dq refs/heads/
reference namespace, rather than to branches in the
.Dq refs/remotes/
namespace.
This avoids the usual requirement of having to run
.Cm got rebase
after
.Cm got fetch
in order to make incoming changes appear on branches in the
.Dq refs/heads/
namespace.
But maintaining custom changes in the cloned repository becomes difficult
since such changes will be at risk of being discarded whenever incoming
changes are fetched.
.It Fl q
Suppress progress reporting output.
The same option will be passed to
.Xr ssh 1
if applicable.
.It Fl v
Verbose mode.
Causes
.Cm got clone
to print debugging messages to standard error output.
This option will be passed to
.Xr ssh 1
if applicable.
Multiple -v options increase the verbosity.
The maximum is 3.
.It Fl R Ar reference
In addition to the branches and tags that will be fetched, fetch an arbitrary
.Ar reference
from the remote repository's
.Dq refs/
namespace.
This option may be specified multiple times to build a list of additional
references to fetch.
The specified
.Ar reference
may either be a path to a specific reference, or a reference namespace
which will cause all references in this namespace to be fetched.
.Pp
Each reference will be mapped into the cloned repository's
.Dq refs/remotes/
namespace, unless the
.Fl m
option is used to mirror references directly into the cloned repository's
.Dq refs/
namespace.
.Pp
.Cm got clone
will refuse to fetch references from the remote repository's
.Dq refs/remotes/
or
.Dq refs/got/
namespace.
.El
.Tg fe
.It Cm fetch Oo Fl a Oc Oo Fl b Ar branch Oc Oo Fl d Oc Oo Fl l Oc Oo Fl r Ar repository-path Oc Oo Fl t Oc Oo Fl q Oc Oo Fl v Oc Oo Fl R Ar reference Oc Oo Fl X Oc Op Ar remote-repository
.Dl Pq alias: Cm fe
Fetch new changes from a remote repository.
If no
.Ar remote-repository
is specified,
.Dq origin
will be used.
The remote repository's URL is obtained from the corresponding entry in
.Xr got.conf 5
or Git's
.Pa config
file of the local repository, as created by
.Cm got clone .
.Pp
New changes will be stored in a separate pack file downloaded from the server.
Optionally, separate pack files stored in the repository can be combined with
.Xr git-repack 1 .
.Pp
By default, branch references in the
.Dq refs/remotes/
reference namespace will be updated to point at the newly fetched commits.
The
.Cm got rebase
command can then be used to make new changes visible on branches in the
.Dq refs/heads/
namespace, merging incoming changes with the changes on those branches
as necessary.
.Pp
If the repository was created as a mirror with
.Cm got clone -m
then all branches in the
.Dq refs/heads/
namespace will be updated directly to match the corresponding branches in
the remote repository.
If those branches contained local commits, these commits will no longer be
reachable via a reference and will therefore be at risk of being discarded
by Git's garbage collector or
.Cm gotadmin cleanup .
Maintaining custom changes in a mirror repository is therefore discouraged.
.Pp
In any case, references in the
.Dq refs/tags/
namespace will always be fetched and mapped directly to local references
in the same namespace.
.Pp
The options for
.Cm got fetch
are as follows:
.Bl -tag -width Ds
.It Fl a
Fetch all branches from the remote repository's
.Dq refs/heads/
reference namespace.
This option can be enabled by default for specific repositories in
.Xr got.conf 5 .
If this option is not specified, a branch resolved via the remote
repository's HEAD reference will be fetched.
Cannot be used together with the
.Fl b
option.
.It Fl b Ar branch
Fetch the specified
.Ar branch
from the remote repository's
.Dq refs/heads/
reference namespace.
This option may be specified multiple times to build a list of branches
to fetch.
If this option is not specified, a branch resolved via the remote
repository's HEAD reference will be fetched.
Cannot be used together with the
.Fl a
option.
.It Fl d
Delete branches and tags from the local repository which are no longer
present in the remote repository.
Only references are deleted.
Any commit, tree, tag, and blob objects belonging to deleted branches or
tags remain in the repository and may be removed separately with
Git's garbage collector or
.Cm gotadmin cleanup .
.It Fl l
List branches and tags available for fetching from the remote repository
and exit immediately.
Cannot be used together with any of the other options except
.Fl v ,
.Fl q ,
and
.Fl r .
.It Fl t
Allow existing references in the
.Dq refs/tags
namespace to be updated if they have changed on the server.
If not specified, only new tag references will be created.
.It Fl r Ar repository-path
Use the repository at the specified path.
If not specified, assume the repository is located at or above the current
working directory.
If this directory is a
.Nm
work tree, use the repository path associated with this work tree.
.It Fl q
Suppress progress reporting output.
The same option will be passed to
.Xr ssh 1
if applicable.
.It Fl v
Verbose mode.
Causes
.Cm got fetch
to print debugging messages to standard error output.
The same option will be passed to
.Xr ssh 1
if applicable.
Multiple -v options increase the verbosity.
The maximum is 3.
.It Fl R Ar reference
In addition to the branches and tags that will be fetched, fetch an arbitrary
.Ar reference
from the remote repository's
.Dq refs/
namespace.
This option may be specified multiple times to build a list of additional
references to fetch.
The specified
.Ar reference
may either be a path to a specific reference, or a reference namespace
which will cause all references in this namespace to be fetched.
.Pp
Each reference will be mapped into the local repository's
.Dq refs/remotes/
namespace, unless the local repository was created as a mirror with
.Cm got clone -m
in which case references will be mapped directly into the local repository's
.Dq refs/
namespace.
.Pp
Once a reference has been fetched, a branch based on it can be created with
.Cm got branch
if needed.
.Pp
.Cm got fetch
will refuse to fetch references from the remote repository's
.Dq refs/remotes/
or
.Dq refs/got/
namespace.
.It Fl X
Delete all references which correspond to a particular
.Ar remote-repository
instead of fetching new changes.
This can be useful when a remote repository is being removed from
.Xr got.conf 5 .
.Pp
With
.Fl X ,
the
.Ar remote-repository
argument is mandatory and no other options except
.Fl r ,
.Fl v ,
and
.Fl q
are allowed.
.Pp
Only references are deleted.
Any commit, tree, tag, and blob objects fetched from a remote repository
will generally be stored in pack files and may be removed separately with
.Xr git-repack 1
and Git's garbage collector.
.El
.Tg co
.It Cm checkout Oo Fl E Oc Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Oo Fl p Ar path-prefix Oc Oo Fl q Oc Ar repository-path Op Ar work-tree-path
.Dl Pq alias: Cm co
Copy files from a repository into a new work tree.
Show the status of each affected file, using the following status codes:
.Bl -column YXZ description
.It A Ta new file was added
.It E Ta file already exists in work tree's meta-data
.El
.Pp
If the
.Ar work tree path
is not specified, either use the last component of
.Ar repository path ,
or if a
.Ar path prefix
was specified use the last component of
.Ar path prefix .
.Pp
The options for
.Cm got checkout
are as follows:
.Bl -tag -width Ds
.It Fl E
Proceed with the checkout operation even if the directory at
.Ar work-tree-path
is not empty.
Existing files will be left intact.
.It Fl b Ar branch
Check out files from a commit on the specified
.Ar branch .
If this option is not specified, a branch resolved via the repository's HEAD
reference will be used.
.It Fl c Ar commit
Check out files from the specified
.Ar commit
on the selected branch.
The expected argument is a commit ID SHA1 hash or an existing reference
or tag name which will be resolved to a commit ID.
An abbreviated hash argument will be expanded to a full SHA1 hash
automatically, provided the abbreviation is unique.
If this option is not specified, the most recent commit on the selected
branch will be used.
.Pp
If the specified
.Ar commit
is not contained in the selected branch, a different branch which contains
this commit must be specified with the
.Fl b
option.
If no such branch is known a new branch must be created for this
commit with
.Cm got branch
before
.Cm got checkout
can be used.
Checking out work trees with an unknown branch is intentionally not supported.
.It Fl p Ar path-prefix
Restrict the work tree to a subset of the repository's tree hierarchy.
Only files beneath the specified
.Ar path-prefix
will be checked out.
.It Fl q
Silence progress output.
.El
.Tg up
.It Cm update Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Oo Fl q Oc Op Ar path ...
.Dl Pq alias: Cm up
Update an existing work tree to a different
.Ar commit .
Change existing files in the work tree as necessary to match file contents
of this commit.
Preserve any local changes in the work tree and merge them with the
incoming changes.
.Pp
Files which already contain merge conflicts will not be updated to avoid
further complications.
Such files will be updated when
.Cm got update
is run again after merge conflicts have been resolved.
If the conflicting changes are no longer needed affected files can be
reverted with
.Cm got revert
before running
.Cm got update
again.
.Pp
Show the status of each affected file, using the following status codes:
.Bl -column YXZ description
.It U Ta file was updated and contained no local changes
.It G Ta file was updated and local changes were merged cleanly
.It C Ta file was updated and conflicts occurred during merge
.It D Ta file was deleted
.It A Ta new file was added
.It \(a~ Ta versioned file is obstructed by a non-regular file
.It ! Ta a missing versioned file was restored
.It # Ta file was not updated because it contains merge conflicts
.It ? Ta changes destined for an unversioned file were not merged
.El
.Pp
If no
.Ar path
is specified, update the entire work tree.
Otherwise, restrict the update operation to files at or within the
specified paths.
Each path is required to exist in the update operation's target commit.
Files in the work tree outside specified paths will remain unchanged and
will retain their previously recorded base commit.
Some
.Nm
commands may refuse to run while the work tree contains files from
multiple base commits.
The base commit of such a work tree can be made consistent by running
.Cm got update
across the entire work tree.
Specifying a
.Ar path
is incompatible with the
.Fl b
option.
.Pp
.Cm got update
cannot update paths with staged changes.
If changes have been staged with
.Cm got stage ,
these changes must first be committed with
.Cm got commit
or unstaged with
.Cm got unstage .
.Pp
The options for
.Cm got update
are as follows:
.Bl -tag -width Ds
.It Fl b Ar branch
Switch the work tree's branch reference to the specified
.Ar branch
before updating the work tree.
This option requires that all paths in the work tree are updated.
.Pp
As usual, any local changes in the work tree will be preserved.
This can be useful when switching to a newly created branch in order
to commit existing local changes to this branch.
.Pp
Any local changes must be dealt with separately in order to obtain a
work tree with pristine file contents corresponding exactly to the specified
.Ar branch .
Such changes could first be committed to a different branch with
.Cm got commit ,
or could be discarded with
.Cm got revert .
.It Fl c Ar commit
Update the work tree to the specified
.Ar commit .
The expected argument is a commit ID SHA1 hash or an existing reference
or tag name which will be resolved to a commit ID.
An abbreviated hash argument will be expanded to a full SHA1 hash
automatically, provided the abbreviation is unique.
If this option is not specified, the most recent commit on the work tree's
branch will be used.
.It Fl q
Silence progress output.
.El
.Tg st
.It Cm status Oo Fl I Oc Oo Fl s Ar status-codes Oc Oo Fl S Ar status-codes Oc Op Ar path ...
.Dl Pq alias: Cm st
Show the current modification status of files in a work tree,
using the following status codes:
.Bl -column YXZ description
.It M Ta modified file
.It A Ta file scheduled for addition in next commit
.It D Ta file scheduled for deletion in next commit
.It C Ta modified or added file which contains merge conflicts
.It ! Ta versioned file was expected on disk but is missing
.It \(a~ Ta versioned file is obstructed by a non-regular file
.It ? Ta unversioned item not tracked by
.Nm
.It m Ta modified file modes (executable bit only)
.It N Ta non-existent
.Ar path
specified on the command line
.El
.Pp
If no
.Ar path
is specified, show modifications in the entire work tree.
Otherwise, show modifications at or within the specified paths.
.Pp
If changes have been staged with
.Cm got stage ,
staged changes are shown in the second output column, using the following
status codes:
.Bl -column YXZ description
.It M Ta file modification is staged
.It A Ta file addition is staged
.It D Ta file deletion is staged
.El
.Pp
Changes created on top of staged changes are indicated in the first column:
.Bl -column YXZ description
.It MM Ta file was modified after earlier changes have been staged
.It MA Ta file was modified after having been staged for addition
.El
.Pp
The options for
.Cm got status
are as follows:
.Bl -tag -width Ds
.It Fl I
Show unversioned files even if they match an ignore pattern.
.It Fl s Ar status-codes
Only show files with a modification status matching any of the
single-character status codes contained in the
.Ar status-codes
argument.
Any combination of codes from the above list of possible status codes
may be specified.
For staged files, status codes displayed in either column will be matched.
Cannot be used together with the
.Fl S
option.
.It Fl S Ar status-codes
Suppress the output of files with a modification status matching any of the
single-character status codes contained in the
.Ar status-codes
argument.
Any combination of codes from the above list of possible status codes
may be specified.
For staged files, status codes displayed in either column will be matched.
Cannot be used together with the
.Fl s
option.
.El
.Pp
For compatibility with
.Xr cvs 1
and
.Xr git 1 ,
.Cm got status
reads
.Xr glob 7
patterns from
.Pa .cvsignore
and
.Pa .gitignore
files in each traversed directory and will not display unversioned files
which match these patterns.
As an extension to
.Xr glob 7
matching rules,
.Cm got status
supports consecutive asterisks,
.Dq ** ,
which will match an arbitrary amount of directories.
Unlike
.Xr cvs 1 ,
.Cm got status
only supports a single ignore pattern per line.
Unlike
.Xr git 1 ,
.Cm got status
does not support negated ignore patterns prefixed with
.Dq \&! ,
and gives no special significance to the location of path component separators,
.Dq / ,
in a pattern.
.It Cm log Oo Fl b Oc Oo Fl c Ar commit Oc Oo Fl C Ar number Oc Oo Fl l Ar N Oc Oo Fl p Oc Oo Fl P Oc Oo Fl s Ar search-pattern Oc Oo Fl r Ar repository-path Oc Oo Fl R Oc Oo Fl x Ar commit Oc Op Ar path
Display history of a repository.
If a
.Ar path
is specified, show only commits which modified this path.
If invoked in a work tree, the
.Ar path
is interpreted relative to the current working directory,
and the work tree's path prefix is implicitly prepended.
Otherwise, the path is interpreted relative to the repository root.
.Pp
The options for
.Cm got log
are as follows:
.Bl -tag -width Ds
.It Fl b
Display individual commits which were merged into the current branch
from other branches.
By default,
.Cm got log
shows the linear history of the current branch only.
.It Fl c Ar commit
Start traversing history at the specified
.Ar commit .
The expected argument is a commit ID SHA1 hash or an existing reference
or tag name which will be resolved to a commit ID.
An abbreviated hash argument will be expanded to a full SHA1 hash
automatically, provided the abbreviation is unique.
If this option is not specified, default to the work tree's current branch
if invoked in a work tree, or to the repository's HEAD reference.
.It Fl C Ar number
Set the number of context lines shown in diffs with
.Fl p .
By default, 3 lines of context are shown.
.It Fl l Ar N
Limit history traversal to a given number of commits.
If this option is not specified, a default limit value of zero is used,
which is treated as an unbounded limit.
The
.Ev GOT_LOG_DEFAULT_LIMIT
environment variable may be set to change this default value.
.It Fl p
Display the patch of modifications made in each commit.
If a
.Ar path
is specified, only show the patch of modifications at or within this path.
.It Fl P
Display the list of file paths changed in each commit, using the following
status codes:
.Bl -column YXZ description
.It M Ta modified file
.It D Ta file was deleted
.It A Ta new file was added
.It m Ta modified file modes (executable bit only)
.El
.It Fl s Ar search-pattern
If specified, show only commits with a log message matched by the extended
regular expression
.Ar search-pattern .
When used together with
.Fl P
then the file paths changed by a commit can be matched as well.
Regular expression syntax is documented in
.Xr re_format 7 .
.It Fl r Ar repository-path
Use the repository at the specified path.
If not specified, assume the repository is located at or above the current
working directory.
If this directory is a
.Nm
work tree, use the repository path associated with this work tree.
.It Fl R
Determine a set of commits to display as usual, but display these commits
in reverse order.
.It Fl x Ar commit
Stop traversing commit history immediately after the specified
.Ar commit
has been traversed.
This option has no effect if the specified
.Ar commit
is never traversed.
.El
.Tg di
.It Cm diff Oo Fl a Oc Oo Fl c Ar commit Oc Oo Fl C Ar number Oc Oo Fl r Ar repository-path Oc Oo Fl s Oc Oo Fl P Oc Oo Fl w Oc Op Ar object1 Ar object2 | Ar path ...
.Dl Pq alias: Cm di
When invoked within a work tree without any arguments, display all
local changes in the work tree.
If one or more
.Ar path
arguments are specified, only show changes within the specified paths.
.Pp
If two arguments are provided, treat each argument as a reference, a tag
name, or an object ID SHA1 hash, and display differences between the
corresponding objects.
Both objects must be of the same type (blobs, trees, or commits).
An abbreviated hash argument will be expanded to a full SHA1 hash
automatically, provided the abbreviation is unique.
If none of these interpretations produce a valid result or if the
.Fl P
option is used,
and if
.Cm got diff
is running in a work tree, attempt to interpret the two arguments as paths.
.Pp
The options for
.Cm got diff
are as follows:
.Bl -tag -width Ds
.It Fl a
Treat file contents as ASCII text even if binary data is detected.
.It Fl c Ar commit
Show differences between commits in the repository.
This options may be used up to two times.
When used only once, show differences between the specified
.Ar commit
and its first parent commit.
When used twice, show differences between the two specified commits.
.Pp
The expected argument is a commit ID SHA1 hash or an existing reference
or tag name which will be resolved to a commit ID.
An abbreviated hash argument will be expanded to a full SHA1 hash
automatically, provided the abbreviation is unique.
.Pp
If the
.Fl c
option is used, all non-option arguments will be interpreted as paths.
If one or more such
.Ar path
arguments are provided, only show differences for the specified paths.
.Pp
Cannot be used together with the
.Fl P
option.
.It Fl C Ar number
Set the number of context lines shown in the diff.
By default, 3 lines of context are shown.
.It Fl r Ar repository-path
Use the repository at the specified path.
If not specified, assume the repository is located at or above the current
working directory.
If this directory is a
.Nm
work tree, use the repository path associated with this work tree.
.It Fl s
Show changes staged with
.Cm got stage
instead of showing local changes in the work tree.
This option is only valid when
.Cm got diff
is invoked in a work tree.
.It Fl P
Interpret all arguments as paths only.
This option can be used to resolve ambiguity in cases where paths
look like tag names, reference names, or object IDs.
This option is only valid when
.Cm got diff
is invoked in a work tree.
.It Fl w
Ignore whitespace-only changes.
.El
.Tg bl
.It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
.Dl Pq alias: Cm bl
Display line-by-line history of a file at the specified path.
.Pp
The options for
.Cm got blame
are as follows:
.Bl -tag -width Ds
.It Fl c Ar commit
Start traversing history at the specified
.Ar commit .
The expected argument is a commit ID SHA1 hash or an existing reference
or tag name which will be resolved to a commit ID.
An abbreviated hash argument will be expanded to a full SHA1 hash
automatically, provided the abbreviation is unique.
.It Fl r Ar repository-path
Use the repository at the specified path.
If not specified, assume the repository is located at or above the current
working directory.
If this directory is a
.Nm
work tree, use the repository path associated with this work tree.
.El
.Tg tr
.It Cm tree Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl i Oc Oo Fl R Oc Op Ar path
.Dl Pq alias: Cm tr
Display a listing of files and directories at the specified
directory path in the repository.
Entries shown in this listing may carry one of the following trailing
annotations:
.Bl -column YXZ description
.It @ Ta entry is a symbolic link
.It / Ta entry is a directory
.It * Ta entry is an executable file
.It $ Ta entry is a Git submodule
.El
.Pp
Symbolic link entries are also annotated with the target path of the link.
.Pp
If no
.Ar path
is specified, list the repository path corresponding to the current
directory of the work tree, or the root directory of the repository
if there is no work tree.
.Pp
The options for
.Cm got tree
are as follows:
.Bl -tag -width Ds
.It Fl c Ar commit
List files and directories as they appear in the specified
.Ar commit .
The expected argument is a commit ID SHA1 hash or an existing reference
or tag name which will be resolved to a commit ID.
An abbreviated hash argument will be expanded to a full SHA1 hash
automatically, provided the abbreviation is unique.
.It Fl r Ar repository-path
Use the repository at the specified path.
If not specified, assume the repository is located at or above the current
working directory.
If this directory is a
.Nm
work tree, use the repository path associated with this work tree.
.It Fl i
Show object IDs of files (blob objects) and directories (tree objects).
.It Fl R
Recurse into sub-directories in the repository.
.El
.It Cm ref Oo Fl r Ar repository-path Oc Oo Fl l Oc Oo Fl t Oc Oo Fl c Ar object Oc Oo Fl s Ar reference Oc Oo Fl d Oc Op Ar name
Manage references in a repository.
.Pp
References may be listed, created, deleted, and changed.
When creating, deleting, or changing a reference the specified
.Ar name
must be an absolute reference name, i.e. it must begin with
.Dq refs/ .
.Pp
The options for
.Cm got ref
are as follows:
.Bl -tag -width Ds
.It Fl r Ar repository-path
Use the repository at the specified path.
If not specified, assume the repository is located at or above the current
working directory.
If this directory is a
.Nm
work tree, use the repository path associated with this work tree.
.It Fl l
List references in the repository.
If no
.Ar name
is specified, list all existing references in the repository.
If
.Ar name
is a reference namespace, list all references in this namespace.
Otherwise, show only the reference with the given
.Ar name .
Cannot be used together with any other options except
.Fl r
and
.Fl t .
.It Fl t
Sort listed references by modification time (most recently modified first)
instead of sorting by lexicographical order.
Use of this option requires the
.Fl l
option to be used as well.
.It Fl c Ar object
Create a reference or change an existing reference.
The reference with the specified
.Ar name
will point at the specified
.Ar object .
The expected
.Ar object
argument is a ID SHA1 hash or an existing reference or tag name which will
be resolved to the ID of a corresponding commit, tree, tag, or blob object.
Cannot be used together with any other options except
.Fl r .
.It Fl s Ar reference
Create a symbolic reference, or change an existing symbolic reference.
The symbolic reference with the specified
.Ar name
will point at the specified
.Ar reference
which must already exist in the repository.
Care should be taken not to create loops between references when
this option is used.
Cannot be used together with any other options except
.Fl r .
.It Fl d
Delete the reference with the specified
.Ar name
from the repository.
Any commit, tree, tag, and blob objects belonging to deleted references
remain in the repository and may be removed separately with
Git's garbage collector or
.Cm gotadmin cleanup .
Cannot be used together with any other options except
.Fl r .
.El
.Tg br
.It Cm branch Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl l Oc Oo Fl t Oc Oo Fl d Ar name Oc Oo Fl n Oc Op Ar name
.Dl Pq alias: Cm br
Create, list, or delete branches.
.Pp
Local branches are managed via references which live in the
.Dq refs/heads/
reference namespace.
The
.Cm got branch
command creates references in this namespace only.
.Pp
When deleting branches the specified
.Ar name
is searched in the
.Dq refs/heads
reference namespace first.
If no corresponding branch is found the
.Dq refs/remotes
namespace will be searched next.
.Pp
If invoked in a work tree without any arguments, print the name of the
work tree's current branch.
.Pp
If a
.Ar name
argument is passed, attempt to create a branch reference with the given name.
By default the new branch reference will point at the latest commit on the
work tree's current branch if invoked in a work tree, and otherwise to a commit
resolved via the repository's HEAD reference.
.Pp
If invoked in a work tree, once the branch was created successfully
switch the work tree's head reference to the newly created branch and
update files across the entire work tree, just like
.Cm got update -b Ar name
would do.
Show the status of each affected file, using the following status codes:
.Bl -column YXZ description
.It U Ta file was updated and contained no local changes
.It G Ta file was updated and local changes were merged cleanly
.It C Ta file was updated and conflicts occurred during merge
.It D Ta file was deleted
.It A Ta new file was added
.It \(a~ Ta versioned file is obstructed by a non-regular file
.It ! Ta a missing versioned file was restored
.El
.Pp
The options for
.Cm got branch
are as follows:
.Bl -tag -width Ds
.It Fl c Ar commit
Make a newly created branch reference point at the specified
.Ar commit .
The expected
.Ar commit
argument is a commit ID SHA1 hash or an existing reference
or tag name which will be resolved to a commit ID.
.It Fl r Ar repository-path
Use the repository at the specified path.
If not specified, assume the repository is located at or above the current
working directory.
If this directory is a
.Nm
work tree, use the repository path associated with this work tree.
.It Fl l
List all existing branches in the repository, including copies of remote
repositories' branches in the
.Dq refs/remotes/
reference namespace.
.Pp
If invoked in a work tree, the work tree's current branch is shown
with one the following annotations:
.Bl -column YXZ description
.It * Ta work tree's base commit matches the branch tip
.It \(a~ Ta work tree's base commit is out-of-date
.El
.It Fl t
Sort listed branches by modification time (most recently modified first)
instead of sorting by lexicographical order.
Branches in the
.Dq refs/heads/
reference namespace are listed before branches in
.Dq refs/remotes/
regardless.
Use of this option requires the
.Fl l
option to be used as well.
.It Fl d Ar name
Delete the branch with the specified
.Ar name
from the
.Dq refs/heads
or
.Dq refs/remotes
reference namespace.
.Pp
Only the branch reference is deleted.
Any commit, tree, and blob objects belonging to the branch
remain in the repository and may be removed separately with
Git's garbage collector or
.Cm gotadmin cleanup .
.It Fl n
Do not switch and update the work tree after creating a new branch.
.El
.It Cm tag Oo Fl c Ar commit Oc Oo Fl m Ar message Oc Oo Fl r Ar repository-path Oc Oo Fl l Oc Ar name
Manage tags in a repository.
.Pp
Tags are managed via references which live in the
.Dq refs/tags/
reference namespace.
The
.Cm got tag
command operates on references in this namespace only.
References in this namespace point at tag objects which contain a pointer
to another object, a tag message, as well as author and timestamp information.
.Pp
Attempt to create a tag with the given
.Ar name ,
and make this tag point at the given
.Ar commit .
If no commit is specified, default to the latest commit on the work tree's
current branch if invoked in a work tree, and to a commit resolved via
the repository's HEAD reference otherwise.
.Pp
The options for
.Cm got tag
are as follows:
.Bl -tag -width Ds
.It Fl c Ar commit
Make the newly created tag reference point at the specified
.Ar commit .
The expected
.Ar commit
argument is a commit ID SHA1 hash or an existing reference or tag name which
will be resolved to a commit ID.
An abbreviated hash argument will be expanded to a full SHA1 hash
automatically, provided the abbreviation is unique.
.It Fl m Ar message
Use the specified tag message when creating the new tag.
Without the
.Fl m
option,
.Cm got tag
opens a temporary file in an editor where a tag message can be written.
.It Fl r Ar repository-path
Use the repository at the specified path.
If not specified, assume the repository is located at or above the current
working directory.
If this directory is a
.Nm
work tree, use the repository path associated with this work tree.
.It Fl l
List all existing tags in the repository instead of creating a new tag.
If this option is used, no other command-line arguments are allowed.
.El
.Pp
By design, the
.Cm got tag
command will not delete tags or change existing tags.
If a tag must be deleted, the
.Cm got ref
command may be used to delete a tag's reference.
This should only be done if the tag has not already been copied to
another repository.
.It Cm add Oo Fl R Oc Oo Fl I Oc Ar path ...
Schedule unversioned files in a work tree for addition to the
repository in the next commit.
By default, files which match a
.Cm got status
ignore pattern will not be added.
.Pp
The options for
.Cm got add
are as follows:
.Bl -tag -width Ds
.It Fl R
Permit recursion into directories.
If this option is not specified,
.Cm got add
will refuse to run if a specified
.Ar path
is a directory.
.It Fl I
Add files even if they match a
.Cm got status
ignore pattern.
.El
.Tg rm
.It Cm remove Oo Fl f Oc Oo Fl k Oc Oo Fl R Oc Oo Fl s Ar status-codes Oc Ar path ...
.Dl Pq alias: Cm rm
Remove versioned files from a work tree and schedule them for deletion
from the repository in the next commit.
.Pp
The options for
.Cm got remove
are as follows:
.Bl -tag -width Ds
.It Fl f
Perform the operation even if a file contains local modifications,
and do not raise an error if a specified
.Ar path
does not exist on disk.
.It Fl k
Keep affected files on disk.
.It Fl R
Permit recursion into directories.
If this option is not specified,
.Cm got remove
will refuse to run if a specified
.Ar path
is a directory.
.It Fl s Ar status-codes
Only delete files with a modification status matching one of the
single-character status codes contained in the
.Ar status-codes
argument.
The following status codes may be specified:
.Bl -column YXZ description
.It M Ta modified file (this implies the
.Fl f
option)
.It ! Ta versioned file expected on disk but missing
.El
.El
.Tg pa
.It Cm patch Oo Fl n Oc Op Ar patchfile
.Dl Pq alias: Cm pa
Apply changes from
.Ar patchfile
to files in a work tree.
Files added or removed by a patch will be scheduled for addition or removal in
the work tree.
.Pp
The patch must be in the unified diff format as produced by
.Cm got diff ,
or by
.Xr diff 1
when invoked with the
.Fl u
option.
If no
.Ar patchfile
argument is provided, read unified diff data from standard input instead.
.Pp
If the
.Ar patchfile
contains multiple patches then attempt to apply each of them in sequence.
.Pp
Show the status of each affected file, using the following status codes:
.Bl -column XYZ description
.It M Ta file was modified
.It D Ta file was deleted
.It A Ta file was added
.It # Ta failed to patch the file
.El
.Pp
If a change does not match at its exact line number, attempt to
apply it somewhere else in the file if a good spot can be found.
Otherwise, the patch will fail to apply.
.Pp
.Nm
.Cm patch
will refuse to apply a patch if certain preconditions are not met.
Files to be deleted must already be under version control, and must
not have been scheduled for deletion already.
Files to be added must not yet be under version control and must not
already be present on disk.
Files to be modified must already be under version control and may not
contain conflict markers.
.Pp
If an error occurs, the
.Cm patch
operation will be aborted.
Any changes made to the work tree up to this point will be left behind.
Such changes can be viewed with
.Cm got diff
and can be reverted with
.Cm got revert
if needed.
.Pp
The options for
.Cm got patch
are as follows:
.Bl -tag -width Ds
.It Fl n
Do not make any modifications to the work tree.
This can be used to check whether a patch would apply without issues.
If the
.Ar patchfile
contains diffs that affect the same file multiple times the results
displayed may be incorrect.
.El
.Tg rv
.It Cm revert Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl R Oc Ar path ...
.Dl Pq alias: Cm rv
Revert any local changes in files at the specified paths in a work tree.
File contents will be overwritten with those contained in the
work tree's base commit.
There is no way to bring discarded changes back after
.Cm got revert !
.Pp
If a file was added with
.Cm got add
it will become an unversioned file again.
If a file was deleted with
.Cm got remove
it will be restored.
.Pp
The options for
.Cm got revert
are as follows:
.Bl -tag -width Ds
.It Fl p
Instead of reverting all changes in files, interactively select or reject
changes to revert based on
.Dq y
(revert change),
.Dq n
(keep change), and
.Dq q
(quit reverting this file) responses.
If a file is in modified status, individual patches derived from the
modified file content can be reverted.
Files in added or deleted status may only be reverted in their entirety.
.It Fl F Ar response-script
With the
.Fl p
option, read
.Dq y ,
.Dq n ,
and
.Dq q
responses line-by-line from the specified
.Ar response-script
file instead of prompting interactively.
.It Fl R
Permit recursion into directories.
If this option is not specified,
.Cm got revert
will refuse to run if a specified
.Ar path
is a directory.
.El
.Tg ci
.It Cm commit Oo Fl F Ar path Oc Oo Fl m Ar message Oc Oo Fl N Oc Oo Fl S Oc Op Ar path ...
.Dl Pq alias: Cm ci
Create a new commit in the repository from changes in a work tree
and use this commit as the new base commit for the work tree.
If no
.Ar path
is specified, commit all changes in the work tree.
Otherwise, commit changes at or within the specified paths.
.Pp
If changes have been explicitly staged for commit with
.Cm got stage ,
only commit staged changes and reject any specified paths which
have not been staged.
.Pp
.Cm got commit
opens a temporary file in an editor where a log message can be written
unless the
.Fl m
option is used
or the
.Fl F
and
.Fl N
options are used together.
.Pp
Show the status of each affected file, using the following status codes:
.Bl -column YXZ description
.It M Ta modified file
.It D Ta file was deleted
.It A Ta new file was added
.It m Ta modified file modes (executable bit only)
.El
.Pp
Files which are not part of the new commit will retain their previously
recorded base commit.
Some
.Nm
commands may refuse to run while the work tree contains files from
multiple base commits.
The base commit of such a work tree can be made consistent by running
.Cm got update
across the entire work tree.
.Pp
The
.Cm got commit
command requires the
.Ev GOT_AUTHOR
environment variable to be set,
unless an author has been configured in
.Xr got.conf 5
or Git's
.Dv user.name
and
.Dv user.email
configuration settings can be
obtained from the repository's
.Pa .git/config
file or from Git's global
.Pa ~/.gitconfig
configuration file.
.Pp
The options for
.Cm got commit
are as follows:
.Bl -tag -width Ds
.It Fl F Ar path
Use the prepared log message stored in the file found at
.Ar path
when creating the new commit.
.Cm got commit
opens a temporary file in an editor where the prepared log message can be
reviewed and edited further if needed.
Cannot be used together with the
.Fl m
option.
.It Fl m Ar message
Use the specified log message when creating the new commit.
Cannot be used together with the
.Fl F
option.
.It Fl N
This option prevents
.Cm got commit
from opening the commit message in an editor.
It has no effect unless it is used together with the
.Fl F
option and is intended for non-interactive use such as scripting.
.It Fl S
Allow the addition of symbolic links which point outside of the path space
that is under version control.
By default,
.Cm got commit
will reject such symbolic links due to safety concerns.
As a precaution,
.Nm
may decide to represent such a symbolic link as a regular file which contains
the link's target path, rather than creating an actual symbolic link which
points outside of the work tree.
Use of this option is discouraged because external mechanisms such as
.Dq make obj
are better suited for managing symbolic links to paths not under
version control.
.El
.Pp
.Cm got commit
will refuse to run if certain preconditions are not met.
If the work tree's current branch is not in the
.Dq refs/heads/
reference namespace, new commits may not be created on this branch.
Local changes may only be committed if they are based on file content
found in the most recent commit on the work tree's branch.
If a path is found to be out of date,
.Cm got update
must be used first in order to merge local changes with changes made
in the repository.
.Tg se
.It Cm send Oo Fl a Oc Oo Fl b Ar branch Oc Oo Fl d Ar branch Oc Oo Fl f Oc Oo Fl r Ar repository-path Oc Oo Fl t Ar tag Oc Oo Fl T Oc Oo Fl q Oc Oo Fl v Oc Op Ar remote-repository
.Dl Pq alias: Cm se
Send new changes to a remote repository.
If no
.Ar remote-repository
is specified,
.Dq origin
will be used.
The remote repository's URL is obtained from the corresponding entry in
.Xr got.conf 5
or Git's
.Pa config
file of the local repository, as created by
.Cm got clone .
.Pp
All objects corresponding to new changes will be written to a temporary
pack file which is then uploaded to the server.
Upon success, references in the
.Dq refs/remotes/
reference namespace of the local repository will be updated to point at
the commits which have been sent.
.Pp
By default, changes will only be sent if they are based on up-to-date
copies of relevant branches in the remote repository.
If any changes to be sent are based on out-of-date copies or would
otherwise break linear history of existing branches, new changes must
be fetched from the server with
.Cm got fetch
and local branches must be rebased with
.Cm got rebase
before
.Cm got send
can succeed.
The
.Fl f
option can be used to make exceptions to these requirements.
.Pp
The options for
.Cm got send
are as follows:
.Bl -tag -width Ds
.It Fl a
Send all branches from the local repository's
.Dq refs/heads/
reference namespace.
The
.Fl a
option is equivalent to listing all branches with multiple
.Fl b
options.
Cannot be used together with the
.Fl b
option.
.It Fl b Ar branch
Send the specified
.Ar branch
from the local repository's
.Dq refs/heads/
reference namespace.
This option may be specified multiple times to build a list of branches
to send.
If this option is not specified, default to the work tree's current branch
if invoked in a work tree, or to the repository's HEAD reference.
Cannot be used together with the
.Fl a
option.
.It Fl d Ar branch
Delete the specified
.Ar branch
from the remote repository's
.Dq refs/heads/
reference namespace.
This option may be specified multiple times to build a list of branches
to delete.
.Pp
Only references are deleted.
Any commit, tree, tag, and blob objects belonging to deleted branches
may become subject to deletion by Git's garbage collector running on
the server.
.Pp
Requesting deletion of branches results in an error if the server
does not support this feature or disallows the deletion of branches
based on its configuration.
.It Fl f
Attempt to force the server to overwrite existing branches or tags
in the remote repository, even when
.Cm got fetch
and
.Cm got rebase
would usually be required before changes can be sent.
The server may reject forced requests regardless, depending on its
configuration.
.Pp
Any commit, tree, tag, and blob objects belonging to overwritten branches
or tags may become subject to deletion by Git's garbage collector running
on the server.
.Pp
The
.Dq refs/tags
reference namespace is globally shared between all repositories.
Use of the
.Fl f
option to overwrite tags is discouraged because it can lead to
inconsistencies between the tags present in different repositories.
In general, creating a new tag with a different name is recommended
instead of overwriting an existing tag.
.Pp
Use of the
.Fl f
option is particularly discouraged if changes being sent are based
on an out-of-date copy of a branch in the remote repository.
Instead of using the
.Fl f
option, new changes should
be fetched with
.Cm got fetch
and local branches should be rebased with
.Cm got rebase ,
followed by another attempt to send the changes.
.Pp
The
.Fl f
option should only be needed in situations where the remote repository's
copy of a branch or tag is known to be out-of-date and is considered
disposable.
The risks of creating inconsistencies between different repositories
should also be taken into account.
.It Fl r Ar repository-path
Use the repository at the specified path.
If not specified, assume the repository is located at or above the current
working directory.
If this directory is a
.Nm
work tree, use the repository path associated with this work tree.
.It Fl t Ar tag
Send the specified
.Ar tag
from the local repository's
.Dq refs/tags/
reference namespace, in addition to any branches that are being sent.
The
.Fl t
option may be specified multiple times to build a list of tags to send.
No tags will be sent if the
.Fl t
option is not used.
.Pp
Raise an error if the specified
.Ar tag
already exists in the remote repository, unless the
.Fl f
option is used to overwrite the server's copy of the tag.
In general, creating a new tag with a different name is recommended
instead of overwriting an existing tag.
.Pp
Cannot be used together with the
.Fl T
option.
.It Fl T
Attempt to send all tags from the local repository's
.Dq refs/tags/
reference namespace.
The
.Fl T
option is equivalent to listing all tags with multiple
.Fl t
options.
Cannot be used together with the
.Fl t
option.
.It Fl q
Suppress progress reporting output.
The same option will be passed to
.Xr ssh 1
if applicable.
.It Fl v
Verbose mode.
Causes
.Cm got send
to print debugging messages to standard error output.
The same option will be passed to
.Xr ssh 1
if applicable.
Multiple -v options increase the verbosity.
The maximum is 3.
.El
.Tg cy
.It Cm cherrypick Ar commit
.Dl Pq alias: Cm cy
Merge changes from a single
.Ar commit
into the work tree.
The specified
.Ar commit
should be on a different branch than the work tree's base commit.
The expected argument is a reference or a commit ID SHA1 hash.
An abbreviated hash argument will be expanded to a full SHA1 hash
automatically, provided the abbreviation is unique.
.Pp
Show the status of each affected file, using the following status codes:
.Bl -column YXZ description
.It G Ta file was merged
.It C Ta file was merged and conflicts occurred during merge
.It ! Ta changes destined for a missing file were not merged
.It D Ta file was deleted
.It d Ta file's deletion was prevented by local modifications
.It A Ta new file was added
.It \(a~ Ta changes destined for a non-regular file were not merged
.It ? Ta changes destined for an unversioned file were not merged
.El
.Pp
The merged changes will appear as local changes in the work tree, which
may be viewed with
.Cm got diff ,
amended manually or with further
.Cm got cherrypick
commands,
committed with
.Cm got commit ,
or discarded again with
.Cm got revert .
.Pp
.Cm got cherrypick
will refuse to run if certain preconditions are not met.
If the work tree contains multiple base commits it must first be updated
to a single base commit with
.Cm got update .
If any relevant files already contain merge conflicts, these
conflicts must be resolved first.
.Tg bo
.It Cm backout Ar commit
.Dl Pq alias: Cm bo
Reverse-merge changes from a single
.Ar commit
into the work tree.
The specified
.Ar commit
should be on the same branch as the work tree's base commit.
The expected argument is a reference or a commit ID SHA1 hash.
An abbreviated hash argument will be expanded to a full SHA1 hash
automatically, provided the abbreviation is unique.
.Pp
Show the status of each affected file, using the following status codes:
.Bl -column YXZ description
.It G Ta file was merged
.It C Ta file was merged and conflicts occurred during merge
.It ! Ta changes destined for a missing file were not merged
.It D Ta file was deleted
.It d Ta file's deletion was prevented by local modifications
.It A Ta new file was added
.It \(a~ Ta changes destined for a non-regular file were not merged
.It ? Ta changes destined for an unversioned file were not merged
.El
.Pp
The reverse-merged changes will appear as local changes in the work tree,
which may be viewed with
.Cm got diff ,
amended manually or with further
.Cm got backout
commands,
committed with
.Cm got commit ,
or discarded again with
.Cm got revert .
.Pp
.Cm got backout
will refuse to run if certain preconditions are not met.
If the work tree contains multiple base commits it must first be updated
to a single base commit with
.Cm got update .
If any relevant files already contain merge conflicts, these
conflicts must be resolved first.
.Tg rb
.It Cm rebase Oo Fl a Oc Oo Fl c Oc Oo Fl l Oc Oo Fl X Oc Op Ar branch
.Dl Pq alias: Cm rb
Rebase commits on the specified
.Ar branch
onto the tip of the current branch of the work tree.
The
.Ar branch
must share common ancestry with the work tree's current branch.
Rebasing begins with the first descendant commit of the youngest
common ancestor commit shared by the specified
.Ar branch
and the work tree's current branch, and stops once the tip commit
of the specified
.Ar branch
has been rebased.
.Pp
When
.Cm got rebase
is used as intended, the specified
.Ar branch
represents a local commit history and may already contain changes
that are not yet visible in any other repositories.
The work tree's current branch, which must be set with
.Cm got update -b
before starting the
.Cm rebase
operation, represents a branch from a remote repository which shares
a common history with the specified
.Ar branch
but has progressed, and perhaps diverged, due to commits added to the
remote repository.
.Pp
Rebased commits are accumulated on a temporary branch which the work tree
will remain switched to throughout the entire rebase operation.
Commits on this branch represent the same changes with the same log
messages as their counterparts on the original
.Ar branch ,
but with different commit IDs.
Once rebasing has completed successfully, the temporary branch becomes
the new version of the specified
.Ar branch
and the work tree is automatically switched to it.
.Pp
Old commits in their pre-rebase state are automatically backed up in the
.Dq refs/got/backup/rebase
reference namespace.
As long as these references are not removed older versions of rebased
commits will remain in the repository and can be viewed with the
.Cm got rebase -l
command.
Removal of these references makes objects which become unreachable via
any reference subject to removal by Git's garbage collector or
.Cm gotadmin cleanup .
.Pp
While rebasing commits, show the status of each affected file,
using the following status codes:
.Bl -column YXZ description
.It G Ta file was merged
.It C Ta file was merged and conflicts occurred during merge
.It ! Ta changes destined for a missing file were not merged
.It D Ta file was deleted
.It d Ta file's deletion was prevented by local modifications
.It A Ta new file was added
.It \(a~ Ta changes destined for a non-regular file were not merged
.It ? Ta changes destined for an unversioned file were not merged
.El
.Pp
If merge conflicts occur the rebase operation is interrupted and may
be continued once conflicts have been resolved.
If any files with destined changes are found to be missing or unversioned,
or if files could not be deleted due to differences in deleted content,
the rebase operation will be interrupted to prevent potentially incomplete
changes from being committed to the repository without user intervention.
The work tree may be modified as desired and the rebase operation can be
continued once the changes present in the work tree are considered complete.
Alternatively, the rebase operation may be aborted which will leave
.Ar branch
unmodified and the work tree switched back to its original branch.
.Pp
If a merge conflict is resolved in a way which renders the merged
change into a no-op change, the corresponding commit will be elided
when the rebase operation continues.
.Pp
.Cm got rebase
will refuse to run if certain preconditions are not met.
If the work tree is not yet fully updated to the tip commit of its
branch then the work tree must first be updated with
.Cm got update .
If changes have been staged with
.Cm got stage ,
these changes must first be committed with
.Cm got commit
or unstaged with
.Cm got unstage .
If the work tree contains local changes, these changes must first be
committed with
.Cm got commit
or reverted with
.Cm got revert .
If the
.Ar branch
contains changes to files outside of the work tree's path prefix,
the work tree cannot be used to rebase this branch.
.Pp
The
.Cm got update
and
.Cm got commit
commands will refuse to run while a rebase operation is in progress.
Other commands which manipulate the work tree may be used for
conflict resolution purposes.
.Pp
If the specified
.Ar branch
is already based on the work tree's current branch then no commits
need to be rebased and
.Cm got rebase
will simply switch the work tree to the specified
.Ar branch
and update files in the work tree accordingly.
.Pp
The options for
.Cm got rebase
are as follows:
.Bl -tag -width Ds
.It Fl a
Abort an interrupted rebase operation.
If this option is used, no other command-line arguments are allowed.
.It Fl c
Continue an interrupted rebase operation.
If this option is used, no other command-line arguments are allowed.
.It Fl l
Show a list of past rebase operations, represented by references in the
.Dq refs/got/backup/rebase
reference namespace.
.Pp
Display the author, date, and log message of each backed up commit,
the object ID of the corresponding post-rebase commit, and
the object ID of their common ancestor commit.
Given these object IDs,
the
.Cm got log
command with the
.Fl c
and
.Fl x
options can be used to examine the history of either version of the branch,
and the
.Cm got branch
command with the
.Fl c
option can be used to create a new branch from a pre-rebase state if desired.
.Pp
If a
.Ar branch
is specified, only show commits which at some point in time represented this
branch.
Otherwise, list all backed up commits for any branches.
.Pp
If this option is used,
.Cm got rebase
does not require a work tree.
None of the other options can be used together with
.Fl l .
.It Fl X
Delete backups created by past rebase operations, represented by references
in the
.Dq refs/got/backup/rebase
reference namespace.
.Pp
If a
.Ar branch
is specified, only delete backups which at some point in time represented
this branch.
Otherwise, delete all references found within
.Dq refs/got/backup/rebase .
.Pp
Any commit, tree, tag, and blob objects belonging to deleted backups
remain in the repository and may be removed separately with
Git's garbage collector or
.Cm gotadmin cleanup .
.Pp
If this option is used,
.Cm got rebase
does not require a work tree.
None of the other options can be used together with
.Fl X .
.El
.Tg he
.It Cm histedit Oo Fl a Oc Oo Fl c Oc Oo Fl e Oc Oo Fl f Oc Oo Fl F Ar histedit-script Oc Oo Fl m Oc Oo Fl l Oc Oo Fl X Oc Op Ar branch
.Dl Pq alias: Cm he
Edit commit history between the work tree's current base commit and
the tip commit of the work tree's current branch.
.Pp
Before starting a
.Cm histedit
operation the work tree's current branch must be set with
.Cm got update -b
to the branch which should be edited, unless this branch is already the
current branch of the work tree.
The tip of this branch represents the upper bound (inclusive) of commits
touched by the
.Cm histedit
operation.
.Pp
Furthermore, the work tree's base commit
must be set with
.Cm got update -c
to a point in this branch's commit history where editing should begin.
This commit represents the lower bound (non-inclusive) of commits touched
by the
.Cm histedit
operation.
.Pp
Editing of commit history is controlled via a
.Ar histedit script
which can be written in an editor based on a template, passed on the
command line, or generated with the
.Fl f
or
.Fl m
options.
.Pp
The format of the histedit script is line-based.
Each line in the script begins with a command name, followed by
whitespace and an argument.
For most commands, the expected argument is a commit ID SHA1 hash.
Any remaining text on the line is ignored.
Lines which begin with the
.Sq #
character are ignored entirely.
.Pp
The available commands are as follows:
.Bl -column YXZ pick-commit
.It pick Ar commit Ta Use the specified commit as it is.
.It edit Ar commit Ta Use the specified commit but once changes have been
merged into the work tree interrupt the histedit operation for amending.
.It fold Ar commit Ta Combine the specified commit with the next commit
listed further below that will be used.
.It drop Ar commit Ta Remove this commit from the edited history.
.It mesg Ar log-message Ta Use the specified single-line log message for
the commit on the previous line.
If the log message argument is left empty, open an editor where a new
log message can be written.
.El
.Pp
Every commit in the history being edited must be mentioned in the script.
Lines may be re-ordered to change the order of commits in the edited history.
No commit may be listed more than once.
.Pp
Edited commits are accumulated on a temporary branch which the work tree
will remain switched to throughout the entire histedit operation.
Once history editing has completed successfully, the temporary branch becomes
the new version of the work tree's branch and the work tree is automatically
switched to it.
.Pp
Old commits in their pre-histedit state are automatically backed up in the
.Dq refs/got/backup/histedit
reference namespace.
As long as these references are not removed older versions of edited
commits will remain in the repository and can be viewed with the
.Cm got histedit -l
command.
Removal of these references makes objects which become unreachable via
any reference subject to removal by Git's garbage collector or
.Cm gotadmin cleanup .
.Pp
While merging commits, show the status of each affected file,
using the following status codes:
.Bl -column YXZ description
.It G Ta file was merged
.It C Ta file was merged and conflicts occurred during merge
.It ! Ta changes destined for a missing file were not merged
.It D Ta file was deleted
.It d Ta file's deletion was prevented by local modifications
.It A Ta new file was added
.It \(a~ Ta changes destined for a non-regular file were not merged
.It ? Ta changes destined for an unversioned file were not merged
.El
.Pp
If merge conflicts occur the histedit operation is interrupted and may
be continued once conflicts have been resolved.
If any files with destined changes are found to be missing or unversioned,
or if files could not be deleted due to differences in deleted content,
the histedit operation will be interrupted to prevent potentially incomplete
changes from being committed to the repository without user intervention.
The work tree may be modified as desired and the histedit operation can be
continued once the changes present in the work tree are considered complete.
Alternatively, the histedit operation may be aborted which will leave
the work tree switched back to its original branch.
.Pp
If a merge conflict is resolved in a way which renders the merged
change into a no-op change, the corresponding commit will be elided
when the histedit operation continues.
.Pp
.Cm got histedit
will refuse to run if certain preconditions are not met.
If the work tree's current branch is not in the
.Dq refs/heads/
reference namespace, the history of the branch may not be edited.
If the work tree contains multiple base commits it must first be updated
to a single base commit with
.Cm got update .
If changes have been staged with
.Cm got stage ,
these changes must first be committed with
.Cm got commit
or unstaged with
.Cm got unstage .
If the work tree contains local changes, these changes must first be
committed with
.Cm got commit
or reverted with
.Cm got revert .
If the edited history contains changes to files outside of the work tree's
path prefix, the work tree cannot be used to edit the history of this branch.
.Pp
The
.Cm got update ,
.Cm got rebase ,
and
.Cm got integrate
commands will refuse to run while a histedit operation is in progress.
Other commands which manipulate the work tree may be used, and the
.Cm got commit
command may be used to commit arbitrary changes to the temporary branch
while the histedit operation is interrupted.
.Pp
The options for
.Cm got histedit
are as follows:
.Bl -tag -width Ds
.It Fl a
Abort an interrupted histedit operation.
If this option is used, no other command-line arguments are allowed.
.It Fl c
Continue an interrupted histedit operation.
If this option is used, no other command-line arguments are allowed.
.It Fl e
Interrupt the histedit operation for editing after merging each commit.
This option is a quick equivalent to a histedit script which uses the
.Cm edit
command for all commits.
The
.Fl e
option can only be used when starting a new histedit operation.
If this option is used, no other command-line arguments are allowed.
.It Fl f
Fold all commits into a single commit.
This option is a quick equivalent to a histedit script which folds all
commits, combining them all into one commit.
The
.Fl f
option can only be used when starting a new histedit operation.
If this option is used, no other command-line arguments are allowed.
.It Fl F Ar histedit-script
Use the specified
.Ar histedit-script
instead of opening a temporary file in an editor where a histedit script
can be written.
.It Fl m
Edit log messages only.
This option is a quick equivalent to a histedit script which edits
only log messages but otherwise leaves every picked commit as-is.
The
.Fl m
option can only be used when starting a new histedit operation.
If this option is used, no other command-line arguments are allowed.
.It Fl l
Show a list of past histedit operations, represented by references in the
.Dq refs/got/backup/histedit
reference namespace.
.Pp
Display the author, date, and log message of each backed up commit,
the object ID of the corresponding post-histedit commit, and
the object ID of their common ancestor commit.
Given these object IDs,
the
.Cm got log
command with the
.Fl c
and
.Fl x
options can be used to examine the history of either version of the branch,
and the
.Cm got branch
command with the
.Fl c
option can be used to create a new branch from a pre-histedit state if desired.
.Pp
If a
.Ar branch
is specified, only show commits which at some point in time represented this
branch.
Otherwise, list all backed up commits for any branches.
.Pp
If this option is used,
.Cm got histedit
does not require a work tree.
None of the other options can be used together with
.Fl l .
.It Fl X
Delete backups created by past histedit operations, represented by references
in the
.Dq refs/got/backup/histedit
reference namespace.
.Pp
If a
.Ar branch
is specified, only delete backups which at some point in time represented
this branch.
Otherwise, delete all references found within
.Dq refs/got/backup/histedit .
.Pp
Any commit, tree, tag, and blob objects belonging to deleted backups
remain in the repository and may be removed separately with
Git's garbage collector or
.Cm gotadmin cleanup .
.Pp
If this option is used,
.Cm got histedit
does not require a work tree.
None of the other options can be used together with
.Fl X .
.El
.Tg ig
.It Cm integrate Ar branch
.Dl Pq alias: Cm ig
Integrate the specified
.Ar branch
into the work tree's current branch.
Files in the work tree are updated to match the contents on the integrated
.Ar branch ,
and the reference of the work tree's branch is changed to point at the
head commit of the integrated
.Ar branch .
.Pp
Both branches can be considered equivalent after integration since they
will be pointing at the same commit.
Both branches remain available for future work, if desired.
In case the integrated
.Ar branch
is no longer needed it may be deleted with
.Cm got branch -d .
.Pp
Show the status of each affected file, using the following status codes:
.Bl -column YXZ description
.It U Ta file was updated
.It D Ta file was deleted
.It A Ta new file was added
.It \(a~ Ta versioned file is obstructed by a non-regular file
.It ! Ta a missing versioned file was restored
.El
.Pp
.Cm got integrate
will refuse to run if certain preconditions are not met.
Most importantly, the
.Ar branch
must have been rebased onto the work tree's current branch with
.Cm got rebase
before it can be integrated, in order to linearize commit history and
resolve merge conflicts.
If the work tree contains multiple base commits it must first be updated
to a single base commit with
.Cm got update .
If changes have been staged with
.Cm got stage ,
these changes must first be committed with
.Cm got commit
or unstaged with
.Cm got unstage .
If the work tree contains local changes, these changes must first be
committed with
.Cm got commit
or reverted with
.Cm got revert .
.Tg mg
.It Cm merge Oo Fl a Oc Oo Fl c Oc Oo Fl n Oc Op Ar branch
.Dl Pq alias: Cm mg
Create a merge commit based on the current branch of the work tree and
the specified
.Ar branch .
If a linear project history is desired, then use of
.Cm got rebase
should be preferred over
.Cm got merge .
However, even strictly linear projects may require merge commits in order
to merge in new versions of third-party code stored on vendor branches
created with
.Cm got import .
.Pp
Merge commits are commits based on multiple parent commits.
The tip commit of the work tree's current branch, which must be set with
.Cm got update -b
before starting the
.Cm merge
operation, will be used as the first parent.
The tip commit of the specified
.Ar branch
will be used as the second parent.
.Pp
No ancestral relationship between the two branches is required.
If the two branches have already been merged previously, only new changes
will be merged.
.Pp
It is not possible to create merge commits with more than two parents.
If more than one branch needs to be merged, then multiple merge commits
with two parents each can be created in sequence.
.Pp
While merging changes found on the
.Ar branch
into the work tree, show the status of each affected file,
using the following status codes:
.Bl -column YXZ description
.It G Ta file was merged
.It C Ta file was merged and conflicts occurred during merge
.It ! Ta changes destined for a missing file were not merged
.It D Ta file was deleted
.It d Ta file's deletion was prevented by local modifications
.It A Ta new file was added
.It \(a~ Ta changes destined for a non-regular file were not merged
.It ? Ta changes destined for an unversioned file were not merged
.El
.Pp
If merge conflicts occur, the merge operation is interrupted and conflicts
must be resolved before the merge operation can continue.
If any files with destined changes are found to be missing or unversioned,
or if files could not be deleted due to differences in deleted content,
the merge operation will be interrupted to prevent potentially incomplete
changes from being committed to the repository without user intervention.
The work tree may be modified as desired and the merge can be continued
once the changes present in the work tree are considered complete.
Alternatively, the merge operation may be aborted which will leave
the work tree's current branch unmodified.
.Pp
If a merge conflict is resolved in a way which renders all merged
changes into no-op changes, the merge operation cannot continue
and must be aborted.
.Pp
.Cm got merge
will refuse to run if certain preconditions are not met.
If history of the
.Ar branch
is based on the work tree's current branch, then no merge commit can
be created and
.Cm got integrate
may be used to integrate the
.Ar branch
instead.
If the work tree is not yet fully updated to the tip commit of its
branch, then the work tree must first be updated with
.Cm got update .
If the work tree contains multiple base commits it must first be updated
to a single base commit with
.Cm got update .
If changes have been staged with
.Cm got stage ,
these changes must first be committed with
.Cm got commit
or unstaged with
.Cm got unstage .
If the work tree contains local changes, these changes must first be
committed with
.Cm got commit
or reverted with
.Cm got revert .
If the
.Ar branch
contains changes to files outside of the work tree's path prefix,
the work tree cannot be used to merge this branch.
.Pp
The
.Cm got update ,
.Cm got commit ,
.Cm got rebase ,
.Cm got histedit ,
.Cm got integrate ,
and
.Cm got stage
commands will refuse to run while a merge operation is in progress.
Other commands which manipulate the work tree may be used for
conflict resolution purposes.
.Pp
The options for
.Cm got merge
are as follows:
.Bl -tag -width Ds
.It Fl a
Abort an interrupted merge operation.
If this option is used, no other command-line arguments are allowed.
.It Fl c
Continue an interrupted merge operation.
If this option is used, no other command-line arguments are allowed.
.It Fl n
Merge changes into the work tree as usual but do not create a merge
commit immediately.
The merge result can be adjusted as desired before a merge commit is
created with
.Cm got merge -c .
Alternatively, the merge may be aborted with
.Cm got merge -a .
.El
.Tg sg
.It Cm stage Oo Fl l Oc Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl S Oc Op Ar path ...
.Dl Pq alias: Cm sg
Stage local changes for inclusion in the next commit.
If no
.Ar path
is specified, stage all changes in the work tree.
Otherwise, stage changes at or within the specified paths.
Paths may be staged if they are added, modified, or deleted according to
.Cm got status .
.Pp
Show the status of each affected file, using the following status codes:
.Bl -column YXZ description
.It A Ta file addition has been staged
.It M Ta file modification has been staged
.It D Ta file deletion has been staged
.El
.Pp
Staged file contents are saved in newly created blob objects in the repository.
These blobs will be referred to by tree objects once staged changes have been
committed.
.Pp
Staged changes affect the behaviour of
.Cm got commit ,
.Cm got status ,
and
.Cm got diff .
While paths with staged changes exist, the
.Cm got commit
command will refuse to commit any paths which do not have staged changes.
Local changes created on top of staged changes can only be committed if
the path is staged again, or if the staged changes are committed first.
The
.Cm got status
command will show both local changes and staged changes.
The
.Cm got diff
command is able to display local changes relative to staged changes,
and to display staged changes relative to the repository.
The
.Cm got revert
command cannot revert staged changes but may be used to revert
local changes created on top of staged changes.
.Pp
The options for
.Cm got stage
are as follows:
.Bl -tag -width Ds
.It Fl l
Instead of staging new changes, list paths which are already staged,
along with the IDs of staged blob objects and stage status codes.
If paths were provided in the command line show the staged paths
among the specified paths.
Otherwise, show all staged paths.
.It Fl p
Instead of staging the entire content of a changed file, interactively
select or reject changes for staging based on
.Dq y
(stage change),
.Dq n
(reject change), and
.Dq q
(quit staging this file) responses.
If a file is in modified status, individual patches derived from the
modified file content can be staged.
Files in added or deleted status may only be staged or rejected in
their entirety.
.It Fl F Ar response-script
With the
.Fl p
option, read
.Dq y ,
.Dq n ,
and
.Dq q
responses line-by-line from the specified
.Ar response-script
file instead of prompting interactively.
.It Fl S
Allow staging of symbolic links which point outside of the path space
that is under version control.
By default,
.Cm got stage
will reject such symbolic links due to safety concerns.
As a precaution,
.Nm
may decide to represent such a symbolic link as a regular file which contains
the link's target path, rather than creating an actual symbolic link which
points outside of the work tree.
Use of this option is discouraged because external mechanisms such as
.Dq make obj
are better suited for managing symbolic links to paths not under
version control.
.El
.Pp
.Cm got stage
will refuse to run if certain preconditions are not met.
If a file contains merge conflicts, these conflicts must be resolved first.
If a file is found to be out of date relative to the head commit on the
work tree's current branch, the file must be updated with
.Cm got update
before it can be staged (however, this does not prevent the file from
becoming out-of-date at some point after having been staged).
.Pp
The
.Cm got update ,
.Cm got rebase ,
and
.Cm got histedit
commands will refuse to run while staged changes exist.
If staged changes cannot be committed because a staged path
is out of date, the path must be unstaged with
.Cm got unstage
before it can be updated with
.Cm got update ,
and may then be staged again if necessary.
.Tg ug
.It Cm unstage Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
.Dl Pq alias: Cm ug
Merge staged changes back into the work tree and put affected paths
back into non-staged status.
If no
.Ar path
is specified, unstage all staged changes across the entire work tree.
Otherwise, unstage changes at or within the specified paths.
.Pp
Show the status of each affected file, using the following status codes:
.Bl -column YXZ description
.It G Ta file was unstaged
.It C Ta file was unstaged and conflicts occurred during merge
.It ! Ta changes destined for a missing file were not merged
.It D Ta file was staged as deleted and still is deleted
.It d Ta file's deletion was prevented by local modifications
.It \(a~ Ta changes destined for a non-regular file were not merged
.El
.Pp
The options for
.Cm got unstage
are as follows:
.Bl -tag -width Ds
.It Fl p
Instead of unstaging the entire content of a changed file, interactively
select or reject changes for unstaging based on
.Dq y
(unstage change),
.Dq n
(keep change staged), and
.Dq q
(quit unstaging this file) responses.
If a file is staged in modified status, individual patches derived from the
staged file content can be unstaged.
Files staged in added or deleted status may only be unstaged in their entirety.
.It Fl F Ar response-script
With the
.Fl p
option, read
.Dq y ,
.Dq n ,
and
.Dq q
responses line-by-line from the specified
.Ar response-script
file instead of prompting interactively.
.El
.It Cm cat Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl P Oc Ar arg ...
Parse and print contents of objects to standard output in a line-based
text format.
Content of commit, tree, and tag objects is printed in a way similar
to the actual content stored in such objects.
Blob object contents are printed as they would appear in files on disk.
.Pp
Attempt to interpret each argument as a reference, a tag name, or
an object ID SHA1 hash.
References will be resolved to an object ID.
Tag names will resolved to a tag object.
An abbreviated hash argument will be expanded to a full SHA1 hash
automatically, provided the abbreviation is unique.
.Pp
If none of the above interpretations produce a valid result, or if the
.Fl P
option is used, attempt to interpret the argument as a path which will
be resolved to the ID of an object found at this path in the repository.
.Pp
The options for
.Cm got cat
are as follows:
.Bl -tag -width Ds
.It Fl c Ar commit
Look up paths in the specified
.Ar commit .
If this option is not used, paths are looked up in the commit resolved
via the repository's HEAD reference.
The expected argument is a commit ID SHA1 hash or an existing reference
or tag name which will be resolved to a commit ID.
An abbreviated hash argument will be expanded to a full SHA1 hash
automatically, provided the abbreviation is unique.
.It Fl r Ar repository-path
Use the repository at the specified path.
If not specified, assume the repository is located at or above the current
working directory.
If this directory is a
.Nm
work tree, use the repository path associated with this work tree.
.It Fl P
Interpret all arguments as paths only.
This option can be used to resolve ambiguity in cases where paths
look like tag names, reference names, or object IDs.
.El
.It Cm info Op Ar path ...
Display meta-data stored in a work tree.
See
.Xr got-worktree 5
for details.
.Pp
The work tree to use is resolved implicitly by walking upwards from the
current working directory.
.Pp
If one or more
.Ar path
arguments are specified, show additional per-file information for tracked
files located at or within these paths.
If a
.Ar path
argument corresponds to the work tree's root directory, display information
for all tracked files.
.El
.Sh ENVIRONMENT
.Bl -tag -width GOT_AUTHOR
.It Ev GOT_AUTHOR
The author's name and email address for
.Cm got commit
and
.Cm got import ,
for example:
.Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
Because
.Xr git 1
may fail to parse commits without an email address in author data,
.Nm
attempts to reject
.Ev GOT_AUTHOR
environment variables with a missing email address.
.Pp
.Ev GOT_AUTHOR will be overridden by configuration settings in
.Xr got.conf 5
or by Git's
.Dv user.name
and
.Dv user.email
configuration settings in the repository's
.Pa .git/config
file.
The
.Dv user.name
and
.Dv user.email
configuration settings contained in Git's global
.Pa ~/.gitconfig
configuration file will only be used if neither
.Xr got.conf 5
nor the
.Ev GOT_AUTHOR
environment variable provide author information.
.It Ev VISUAL , EDITOR
The editor spawned by
.Cm got commit ,
.Cm got histedit ,
.Cm got import ,
or
.Cm got tag .
If not set, the
.Xr ed 1
text editor will be spawned in order to give
.Xr ed 1
the attention it deserves.
.It Ev GOT_LOG_DEFAULT_LIMIT
The default limit on the number of commits traversed by
.Cm got log .
If set to zero, the limit is unbounded.
This variable will be silently ignored if it is set to a non-numeric value.
.El
.Sh FILES
.Bl -tag -width packed-refs -compact
.It Pa got.conf
Repository-wide configuration settings for
.Nm .
If present, a
.Xr got.conf 5
configuration file located in the root directory of a Git repository
supersedes any relevant settings in Git's
.Pa config
file.
.Pp
.It Pa .got/got.conf
Worktree-specific configuration settings for
.Nm .
If present, a
.Xr got.conf 5
configuration file in the
.Pa .got
meta-data directory of a work tree supersedes any relevant settings in
the repository's
.Xr got.conf 5
configuration file and Git's
.Pa config
file.
.El
.Sh EXIT STATUS
.Ex -std got
.Sh EXAMPLES
Enable tab-completion of
.Nm
command names in
.Xr ksh 1 :
.Pp
.Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
.Pp
Clone an existing Git repository for use with
.Nm .
.Pp
.Dl $ cd /var/git/
.Dl $ got clone ssh://git@github.com/openbsd/src.git
.Pp
Use of HTTP URLs currently requires
.Xr git 1 :
.Pp
.Dl $ cd /var/git/
.Dl $ git clone --bare https://github.com/openbsd/src.git
.Pp
Alternatively, for quick and dirty local testing of
.Nm
a new Git repository could be created and populated with files,
e.g. from a temporary CVS checkout located at
.Pa /tmp/src :
.Pp
.Dl $ got init /var/git/src.git
.Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
.Pp
Check out a work tree from the Git repository to /usr/src:
.Pp
.Dl $ got checkout /var/git/src.git /usr/src
.Pp
View local changes in a work tree directory:
.Pp
.Dl $ got diff | less
.Pp
In a work tree, display files in a potentially problematic state:
.Pp
.Dl $ got status -s 'C!~?'
.Pp
Interactively revert selected local changes in a work tree directory:
.Pp
.Dl $ got revert -p -R\ .
.Pp
In a work tree or a git repository directory, list all branch references:
.Pp
.Dl $ got branch -l
.Pp
In a work tree or a git repository directory, create a new branch called
.Dq unified-buffer-cache
which is forked off the
.Dq master
branch:
.Pp
.Dl $ got branch -c master unified-buffer-cache
.Pp
Switch an existing work tree to the branch
.Dq unified-buffer-cache .
Local changes in the work tree will be preserved and merged if necessary:
.Pp
.Dl $ got update -b unified-buffer-cache
.Pp
Create a new commit from local changes in a work tree directory.
This new commit will become the head commit of the work tree's current branch:
.Pp
.Dl $ got commit
.Pp
In a work tree or a git repository directory, view changes committed in
the 3 most recent commits to the work tree's branch, or the branch resolved
via the repository's HEAD reference, respectively:
.Pp
.Dl $ got log -p -l 3
.Pp
As above, but display changes in the order in which
.Xr patch 1
could apply them in sequence:
.Pp
.Dl $ got log -p -l 3 -R
.Pp
In a work tree or a git repository directory, log the history of a subdirectory:
.Pp
.Dl $ got log sys/uvm
.Pp
While operating inside a work tree, paths are specified relative to the current
working directory, so this command will log the subdirectory
.Pa sys/uvm :
.Pp
.Dl $ cd sys/uvm && got log\ .
.Pp
And this command has the same effect:
.Pp
.Dl $ cd sys/dev/usb && got log ../../uvm
.Pp
And this command displays work tree meta-data about all tracked files:
.Pp
.Dl $ cd /usr/src
.Dl $ got info\ . | less
.Pp
Add new files and remove obsolete files in a work tree directory:
.Pp
.Dl $ got add sys/uvm/uvm_ubc.c
.Dl $ got remove sys/uvm/uvm_vnode.c
.Pp
Create a new commit from local changes in a work tree directory
with a pre-defined log message.
.Pp
.Dl $ got commit -m 'unify the buffer cache'
.Pp
Alternatively, create a new commit from local changes in a work tree
directory with a log message that has been prepared in the file
.Pa /tmp/msg :
.Pp
.Dl $ got commit -F /tmp/msg
.Pp
Update any work tree checked out from the
.Dq unified-buffer-cache
branch to the latest commit on this branch:
.Pp
.Dl $ got update
.Pp
Roll file content on the unified-buffer-cache branch back by one commit,
and then fetch the rolled-back change into the work tree as a local change
to be amended and perhaps committed again:
.Pp
.Dl $ got backout unified-buffer-cache
.Dl $ got commit -m 'roll back previous'
.Dl $ # now back out the previous backout :-)
.Dl $ got backout unified-buffer-cache
.Pp
Fetch new changes on the remote repository's
.Dq master
branch, making them visible on the local repository's
.Dq origin/master
branch:
.Pp
.Dl $ cd /usr/src
.Dl $ got fetch
.Pp
In a repository created with a HTTP URL and
.Cm git clone --bare
the
.Xr git-fetch 1
command must be used instead:
.Pp
.Dl $ cd /var/git/src.git
.Dl $ git fetch origin master:refs/remotes/origin/master
.Pp
Rebase the local
.Dq master
branch to merge the new changes that are now visible on the
.Dq origin/master
branch:
.Pp
.Dl $ cd /usr/src
.Dl $ got update -b origin/master
.Dl $ got rebase master
.Pp
Rebase the
.Dq unified-buffer-cache
branch on top of the new head commit of the
.Dq master
branch.
.Pp
.Dl $ got update -b master
.Dl $ got rebase unified-buffer-cache
.Pp
Create a patch from all changes on the unified-buffer-cache branch.
The patch can be mailed out for review and applied to
.Ox Ns 's
CVS tree:
.Pp
.Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
.Pp
Edit the entire commit history of the
.Dq unified-buffer-cache
branch:
.Pp
.Dl $ got update -b unified-buffer-cache
.Dl $ got update -c master
.Dl $ got histedit
.Pp
Before working against existing branches in a repository cloned with
.Cm git clone --bare
instead of
.Cm got clone ,
a Git
.Dq refspec
must be configured to map all references in the remote repository
into the
.Dq refs/remotes
namespace of the local repository.
This can be achieved by setting Git's
.Pa remote.origin.fetch
configuration variable to the value
.Dq +refs/heads/*:refs/remotes/origin/*
with the
.Cm git config
command:
.Pp
.Dl $ cd /var/git/repo
.Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
.Pp
Additionally, the
.Dq mirror
option must be disabled:
.Pp
.Dl $ cd /var/git/repo
.Dl $ git config remote.origin.mirror false
.Pp
Alternatively, the following
.Xr git-fetch 1
configuration item can be added manually to the Git repository's
.Pa config
file:
.Pp
.Dl [remote \&"origin\&"]
.Dl url = ...
.Dl fetch = +refs/heads/*:refs/remotes/origin/*
.Dl mirror = false
.Pp
This configuration leaves the local repository's
.Dq refs/heads
namespace free for use by local branches checked out with
.Cm got checkout
and, if needed, created with
.Cm got branch .
Branches in the
.Dq refs/remotes/origin
namespace can now be updated with incoming changes from the remote
repository with
.Cm got fetch
or
.Xr git-fetch 1
without extra command line arguments.
Newly fetched changes can be examined with
.Cm got log .
.Pp
Display changes on the remote repository's version of the
.Dq master
branch, as of the last time
.Cm got fetch
was run:
.Pp
.Dl $ got log -c origin/master | less
.Pp
As shown here, most commands accept abbreviated reference names such as
.Dq origin/master
instead of
.Dq refs/remotes/origin/master .
The latter is only needed in case of ambiguity.
.Pp
.Cm got rebase
must be used to merge changes which are visible on the
.Dq origin/master
branch into the
.Dq master
branch.
This will also merge local changes, if any, with the incoming changes:
.Pp
.Dl $ got update -b origin/master
.Dl $ got rebase master
.Pp
In order to make changes committed to the
.Dq unified-buffer-cache
visible on the
.Dq master
branch, the
.Dq unified-buffer-cache
branch must first be rebased onto the
.Dq master
branch:
.Pp
.Dl $ got update -b master
.Dl $ got rebase unified-buffer-cache
.Pp
Changes on the
.Dq unified-buffer-cache
branch can now be made visible on the
.Dq master
branch with
.Cm got integrate .
Because the rebase operation switched the work tree to the
.Dq unified-buffer-cache
branch the work tree must be switched back to the
.Dq master
branch first:
.Pp
.Dl $ got update -b master
.Dl $ got integrate unified-buffer-cache
.Pp
On the
.Dq master
branch, log messages for local changes can now be amended with
.Dq OK
by other developers and any other important new information:
.Pp
.Dl $ got update -c origin/master
.Dl $ got histedit -m
.Pp
If the remote repository offers write access local changes on the
.Dq master
branch can be sent to the remote repository with
.Cm got send .
Usually,
.Cm got send
can be run without further arguments.
The arguments shown here match defaults, provided the work tree's
current branch is the
.Dq master
branch:
.Pp
.Dl $ got send -b master origin
.Pp
If the remote repository requires the HTTPS protocol the
.Xr git-push 1
command must be used instead:
.Pp
.Dl $ cd /var/git/src.git
.Dl $ git push origin master
.Sh SEE ALSO
.Xr gotadmin 1 ,
.Xr tog 1 ,
.Xr git-repository 5 ,
.Xr got-worktree 5 ,
.Xr got.conf 5
.Sh AUTHORS
.An Stefan Sperling Aq Mt stsp@openbsd.org
.An Martin Pieuchot Aq Mt mpi@openbsd.org
.An Joshua Stein Aq Mt jcs@openbsd.org
.An Ori Bernstein Aq Mt ori@openbsd.org
.Sh CAVEATS
.Nm
is a work-in-progress and some features remain to be implemented.
.Pp
At present, the user has to fall back on
.Xr git 1
to perform some tasks.
In particular:
.Bl -bullet
.It
Reading from remote repositories over HTTP or HTTPS protocols requires
.Xr git-clone 1
and
.Xr git-fetch 1 .
.It
Writing to remote repositories over HTTP or HTTPS protocols requires
.Xr git-push 1 .
.It
The creation of merge commits with more than two parent commits requires
.Xr git-merge 1 .
.It
In situations where files or directories were moved around
.Cm got
will not automatically merge changes to new locations and
.Xr git 1
will usually produce better results.
.El