diff --git a/docs/git/fetch.md b/docs/git/fetch.md index 97479c3..8e18ffa 100644 --- a/docs/git/fetch.md +++ b/docs/git/fetch.md @@ -1,6 +1,5 @@ --- icon: material/clipboard-arrow-left-outline -status: new title: Fetching the latest changes from a remote description: Fetch all changes from a remote without integrating them into the current working directory --- diff --git a/docs/git/pull.md b/docs/git/pull.md index cf2d986..f329803 100644 --- a/docs/git/pull.md +++ b/docs/git/pull.md @@ -1,6 +1,5 @@ --- icon: material/arrow-left-bold-box-outline -status: new title: Pulling the latest changes from a remote description: Pull all changes from a remote and integrate them into the current working directory --- @@ -58,7 +57,7 @@ Fast-forward create mode 100644 folder/c.txt ``` -## Configuring fetch behavior :material-new-box:{.new-feature title="Feature added on the 21st of August 2023"} +## Configuring fetch behavior When pulling changes from a remote repository, a fetch happens before merging any changes. Configuring the behavior of this fetch is possible using the supported `WithFetch...` [options](./fetch.md). diff --git a/docs/git/tag.md b/docs/git/tag.md index 5ce09cc..1ed943f 100644 --- a/docs/git/tag.md +++ b/docs/git/tag.md @@ -84,10 +84,43 @@ created tag 0.1.0 associated commit message ``` -### Creating a local tag :material-new-box:{.new-feature title="Feature added on the 21st of August 2023"} +### Creating a local tag Use the `WithLocalOnly` option to prevent a tag from being pushed back to the remote. +### Tagging a specific commit :material-new-box:{.new-feature title="Feature added on the 19th of September 2023"} + +Use the `WithCommitRef` option to ensure a specific commit within the history is tagged. + +### Batch tagging :material-new-box:{.new-feature title="Feature added on the 19th of September 2023"} + +By calling `TagBatch`, a batch of tags can be created. `gitz` will enforce the `WithLocalOnly` option before pushing them to the remote in one transaction. + +```{ .go .select linenums="1" } +package main + +import ( + "log" + + git "github.com/purpleclay/gitz" +) + +func main() { + client, _ := git.NewClient() + + _, err := client.TagBatch([]string{"1.0.0", "1.0", "1"}) + if err != nil { + log.Fatal("failed to batch tag repository") + } +} +``` + +A batch of tags that target specific commits can also be created by calling `TagBatchAt`. `gitz` will enforce the `WithLocalOnly` and `WithCommitRef` options before pushing them back to the remote in one transaction. + +```{ .go .no-select linenums="1" } +client.TagBatchAt([]string{"0.1.0", "740a8b9", "0.2.0", "9e7dfbb"}) +``` + ## Retrieving all tags Calling `Tags` will retrieve all tags from the current repository in ascending lexicographic order: diff --git a/docs/testing/git-test.md b/docs/testing/git-test.md index 226935c..add2822 100644 --- a/docs/testing/git-test.md +++ b/docs/testing/git-test.md @@ -2,7 +2,6 @@ icon: material/test-tube title: Testing your interactions with git description: A dedicated package for testing your interactions with git -status: new --- # Testing your interactions with git @@ -165,7 +164,7 @@ func TestInitRepositoryWithStagedFiles(t *testing.T) { } ``` -### With committed files :material-new-box:{.new-feature title="Feature added on the 21st of August 2023"} +### With committed files Create a set of files that will be committed to the repository using the `WithCommittedFiles` option. A single commit of `include test files` will be created. @@ -188,7 +187,7 @@ func TestInitRepositoryWithCommittedFiles(t *testing.T) { } ``` -### With file content :material-new-box:{.new-feature title="Feature added on the 21st of August 2023"} +### With file content Allows files created with the `WithFiles`, `WithStagedFiles` or `WithCommittedFiles` options to be overwritten with user-defined content. Key value pairs must be provided to the `WithFileContent` option when overriding existing files.