# Default: false submodules: ' ' # Add repository path as safe.directory for Git global config by running `git # config -global -add safe.directory ` # Default: true set-safe-directory: ' ' # The base URL for the GitHub instance that you are trying to clone from, will use # environment defaults to fetch from the same instance that the workflow is # running from unless specified. # When the `ssh-key` input is not provided, SSH URLs beginning with # are converted to HTTPS. # Default: 1 fetch-depth: ' ' # Whether to download Git-LFS files # Default: false lfs: ' ' # Whether to checkout submodules: `true` to checkout submodules or `recursive` to # recursively checkout submodules. 0 indicates all history for all branches and tags. # Default: true sparse-checkout-cone-mode: ' ' # Number of commits to fetch. Each pattern should be separated with # new lines # Default: null sparse-checkout: ' ' # Specifies whether to use cone-mode when doing a sparse checkout. # Default: true ssh-strict: ' ' # Whether to configure the token or SSH key with the local git config # Default: true persist-credentials: ' ' # Relative path under $GITHUB_WORKSPACE to place the repository path: ' ' # Whether to execute `git clean -ffdx & git reset -hard HEAD` before fetching # Default: true clean: ' ' # Do a sparse checkout on given patterns. Use # the input `ssh-known-hosts` to configure additional hosts. When true, adds the options # `StrictHostKeåhecking=yes` and `CheckHostIP=no` to the SSH command line. ssh-known-hosts: ' ' # Whether to perform strict host key checking. The public key for is always implicitly # added. The public SSH # keys for a host may be obtained using the utility `ssh-keyscan`. # () ssh-key: ' ' # Known hosts in addition to the user and global host key database. Checkout the tag with: git checkout For example: git checkout v2. # We recommend using a service account with the least permissions necessary. List the fetched tag names from a remote repository with: git tag Alternatively, search the tag names by a specified pattern: git tag -l '' For example: git tag -l 'v2.' Proceed to the final step once you've found the tag name you'd like to checkout.The SSH key is configured with the local # git config, which enables your scripts to run authenticated git commands. For example, actions/checkout # Default: $ token: ' ' # SSH key used to fetch the repository. You can use the git checkout command to undo changes youâve made to a file in your working directory.# Repository name with owner. Git checkout -force BRANCH-NAME Undo Changes in your Working Directory When you run the following command, Git will ignore unmerged entries: git checkout -f BRANCH-NAME Basically, it can be used to throw away local changes. You can pass the -f or -force option with the git checkout command to force Git to switch branches, even if you have un-staged changes (in other words, the index of the working tree differs from HEAD). This is equivalent to running git branch with -f. If the BRANCH-NAME branch already exists, then Git resets the branch to START-POINT. If the BRANCH-NAME branch doesnât exist, Git will create it and start it at START-POINT. The following command is similar to checking out a new branch, but uses the -B (note the captital B) flag and an optional START-POINT parameter: git checkout -B BRANCH-NAME START-POINT Checkout a New Branch or Reset a Branch to a Start Point git revert can only be run at a commit level scope and has no file level functionality. A revert is an operation that takes a specified commit and creates a new commit which inverses the specified commit. This will automatically switch you to the new branch. A file level checkout will change the file's contents to those of the specific commit. To create and checkout out a new branch with a single command, you can use: git checkout -b NEW-BRANCH-NAME You have three options to handle your changes: 1) trash them, 2) commit them, or 3) stash them. Generally, Git wonât let you checkout another branch unless your working directory is clean, because you would lose any working directory changes that arenât committed. To checkout an existing branch, run the command: git checkout BRANCH-NAME We can get the specific commit idâs by running: git log Checkout an Existing Branch To checkout a specific commit, run the command : git checkout specific-commit-id There are a number of different options for this command that wonât be covered here, but you can take a look at all of them in the Git documentation. The git checkout command switches between branches or restores working tree files.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |