OpenBSD got Cheatsheet
#
OpenBSD’s got
is a tool for managing and interacting with Git repositories, providing functionalities for version control and repository management.
General Commands
#
Command/Option | Example | Description |
---|
got clone <repo_url> | got clone https://example.com/repo.git | Clone a repository from a URL |
got status | got status | Show the working tree status |
got fetch | got fetch | Fetch changes from the remote repository |
got pull | got pull | Pull changes from the remote repository and merge |
Branch Management
#
Command/Option | Example | Description |
---|
got branch | got branch | List all branches in the repository |
got branch <branch_name> | got branch feature-branch | Create a new branch |
got checkout <branch_name> | got checkout feature-branch | Switch to a different branch |
got merge <branch_name> | got merge feature-branch | Merge a branch into the current branch |
got branch -d <branch_name> | got branch -d feature-branch | Delete a branch |
Commit Management
#
Command/Option | Example | Description |
---|
got add <file> | got add . | Add files to the staging area |
got commit -m "message" | got commit -m "Add new feature" | Commit changes with a message |
got push | got push origin main | Push changes to the remote repository |
Tag Management
#
Command/Option | Example | Description |
---|
got tag | got tag | List all tags in the repository |
got tag <tag_name> | got tag v1.0 | Create a new tag |
got tag -d <tag_name> | got tag -d v1.0 | Delete a tag |
Repository Management
#
Command/Option | Example | Description |
---|
got init | got init | Initialize a new Git repository |
got remote add <name> <url> | got remote add origin https://example.com/repo.git | Add a new remote repository |
got remote remove <name> | got remote remove origin | Remove a remote repository |
Log Management
#
Command/Option | Example | Description |
---|
got log | got log | Show the commit logs |
got log -p | got log -p | Show the commit logs with diffs |
Rebase and Reset
#
Command/Option | Example | Description |
---|
got rebase <branch_name> | got rebase feature-branch | Rebase the current branch onto another branch |
got reset <commit> | got reset --hard HEAD~1 | Reset the current branch to a specific commit |
This cheatsheet covers the most commonly used got
commands and options for managing and interacting with Git repositories on OpenBSD.