I'm coming from a perforce background, trying to understand gitHub.
In Perforce when I "checkout" something it lets other users know I am working on that file. Does checkout work the same way in Git?
It seams like you don't check out files but branches?
Thanks
This action checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it. By default, it clones your current repository ( {{ github. repository }} ) but you can also use this action to clone a different repository, and specify additionnal parameters like token , branch , path etc...
Checking out a commit hash will put you into "detached head" state. A commit (hash) can belong to many branches, and many branch HEADs can point to the same commit hash. Checking out a commit (regardless if it is the HEAD of any branch) will put you to the detached HEAD state.
git checkout <commit> is the basic mechanism for moving around in the commit tree, moving your focus ( HEAD ) to the specified commit. The commit can be specified by any of a number of ways, commit hash, branch name, tag name, the relative syntax ( HEAD^ , HEAD~1 , etc.) and so on.
checkout
in Perforce would roughly equate to clone
in git, but in VCS like git ( and even SVN ), the checkout doesn't signal lock to others that you are working on it. Anyone can clone a git repo and work on it without thinking about who else is working on it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With