Home > database >  What does "git checkout dev" mean?
What does "git checkout dev" mean?

Time:09-17

I'm working on a project and the instructions state:

Get the latest changes from the dev branch:

git checkout dev

git fetch && git pull

What exactly am I supposed to do? Where do I enter these? Please help.

CodePudding user response:

This bit, that you added later in a comment, is missing from your question:

So I downloaded the zip of the project from github ...

If you use GitHub's "download a zip file" clicky web button, you do not get a repository. You cannot run git operations on the result as it is not a repository. You just get one commit from the repository.

Whether the project you're using can be used in this way depends on the project you're using. If it can be used this way, get a zip file of the commit that is the latest commit on the dev branch.

If this project can't be used this way, don't use GitHub's "download a zip file" button. Instead, get the repository URL and use git clone on the command line, in your command line interpreter, likely in a Terminal window, on your computer:

$ cd projects
$ git clone <url>
$ cd this-project

assuming the GitHub URL was something like ssh://[email protected]/user/projects/this-project.git, for instance.

in a bash-like shell on a Linux-like system, for instance.

  • Related