Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub: What does checkout do?

Tags:

github

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

like image 950
Greg G Avatar asked Mar 24 '13 06:03

Greg G


People also ask

How does Github actions checkout work?

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...

What happens when you checkout a commit?

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.

What does it mean to checkout commit?

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.


1 Answers

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.

like image 97
manojlds Avatar answered Oct 05 '22 11:10

manojlds