@@ -1690,10 +1690,12 @@ public Branches branches() {
16901690
16911691 /**
16921692 * Create a branch at a specified version. The returned Dataset points to the created branch's
1693- * initial version.
1693+ * initial version. The branch name {@code "main"} is reserved for the default branch and cannot
1694+ * be used as a new branch name.
16941695 *
16951696 * @param branch the branch name to create
1696- * @param ref the reference to create branch from
1697+ * @param ref the reference to create branch from. In reference contexts, {@code "main"} is an
1698+ * alias for the default branch.
16971699 * @return a new Dataset of the branch
16981700 */
16991701 public Dataset createBranch (String branch , Ref ref ) {
@@ -1703,10 +1705,12 @@ public Dataset createBranch(String branch, Ref ref) {
17031705
17041706 /**
17051707 * Create a branch at a specified version. The returned Dataset points to the created branch's
1706- * initial version.
1708+ * initial version. The branch name {@code "main"} is reserved for the default branch and cannot
1709+ * be used as a new branch name.
17071710 *
17081711 * @param branch the branch name to create
1709- * @param ref the reference to create branch from
1712+ * @param ref the reference to create branch from. In reference contexts, {@code "main"} is an
1713+ * alias for the default branch.
17101714 * @param storageOptions the storage options to create branch with
17111715 * @return a new Dataset of the branch
17121716 */
@@ -1727,8 +1731,9 @@ private Dataset innerCreateBranch(
17271731 }
17281732
17291733 /**
1730- * Checkout using a unified {@link Ref} which can be a tag, the latest version on main/branch or a
1731- * specified (branch_name, version_number).
1734+ * Checkout using a unified {@link Ref} which can be a tag, the latest version on the default
1735+ * branch or a named branch, or a specified (branch_name, version_number). In reference contexts,
1736+ * {@code "main"} is an alias for the default branch.
17321737 *
17331738 * @param ref the checkout reference
17341739 * @return a new Dataset instance checked out to the specified reference
@@ -1765,7 +1770,7 @@ public Map<String, String> getTableMetadata() {
17651770 public class Tags {
17661771
17671772 /**
1768- * Create a new tag on main branch. This is left for compatibility. We should use {@link
1773+ * Create a new tag on the default branch. This is left for compatibility. We should use {@link
17691774 * #create(String, Ref)} instead.
17701775 *
17711776 * @param tag the tag name
@@ -1780,7 +1785,8 @@ public void create(String tag, long versionNumber) {
17801785 * Create a new tag on a specified branch.
17811786 *
17821787 * @param tag the tag name
1783- * @param ref the referenced version to tag
1788+ * @param ref the referenced version to tag. In reference contexts, {@code "main"} is an alias
1789+ * for the default branch.
17841790 */
17851791 public void create (String tag , Ref ref ) {
17861792 Preconditions .checkArgument (tag != null , "Tag name cannot be null" );
@@ -1797,6 +1803,8 @@ public void create(String tag, Ref ref) {
17971803 *
17981804 * @param tag the name of the tag to create
17991805 * @param versionNumber the version number (or commit reference) to associate with the tag
1806+ * @param targetBranch the branch to tag. In reference contexts, {@code "main"} is an alias for
1807+ * the default branch.
18001808 */
18011809 @ Deprecated
18021810 public void create (String tag , long versionNumber , String targetBranch ) {
@@ -1816,11 +1824,11 @@ public void delete(String tag) {
18161824 }
18171825
18181826 /**
1819- * Update a tag to a new version_number on main . This is left for compatibility. We should use
1820- * {@link #update(String, Ref)} instead.
1827+ * Update a tag to a new version_number on the default branch . This is left for compatibility.
1828+ * We should use {@link #update(String, Ref)} instead.
18211829 *
18221830 * @param tag the tag name
1823- * @param versionNumber the versionNumber on main .
1831+ * @param versionNumber the versionNumber on the default branch .
18241832 */
18251833 public void update (String tag , long versionNumber ) {
18261834 Preconditions .checkArgument (versionNumber > 0 , "version_number must be greater than 0" );
@@ -1831,7 +1839,8 @@ public void update(String tag, long versionNumber) {
18311839 * Update a tag to a new reference.
18321840 *
18331841 * @param tag the tag name
1834- * @param ref the referenced version to tag
1842+ * @param ref the referenced version to tag. In reference contexts, {@code "main"} is an alias
1843+ * for the default branch.
18351844 */
18361845 public void update (String tag , Ref ref ) {
18371846 Preconditions .checkArgument (tag != null , "tag cannot be null" );
@@ -1883,7 +1892,8 @@ public class Branches {
18831892 /**
18841893 * Delete a branch and its metadata.
18851894 *
1886- * @param branchName the branch to delete
1895+ * @param branchName the branch to delete. {@code "main"} is reserved for the default branch and
1896+ * cannot be deleted as a named branch.
18871897 */
18881898 public void delete (String branchName ) {
18891899 try (LockManager .WriteLock writeLock = lockManager .acquireWriteLock ()) {
0 commit comments