Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between `go get` and `git clone`?

I had a problem with go-modbus in an issue in Github.
Author suggested me to use:

$ go get github.com/goburrow/modbus  

instead of

$ git clone https://github.com/goburrow/modbus.git

What is the difference between that two commands?

like image 913
Benyamin Jafari Avatar asked Jul 01 '18 08:07

Benyamin Jafari


People also ask

What is the difference between git clone and git checkout?

The git checkout command may occasionally be confused with git clone . The difference between the two commands is that clone works to fetch code from a remote repository, alternatively checkout works to switch between versions of code already on the local system.

What is the difference between clone and download?

When you download the repo it just gives you all the source files with no . git so you dont have the repo. When you clone you get a copy of the history and it is a functional git repo.

Is git clone same as SVN checkout?

To sum it up, clone is for fetching repositories you don't have, checkout is for switching between branches in a repository you already have. Note: for those who have a SVN/CVS background and new to Git, the equivalent of git clone in SVN/CVS is checkout . The same wording of different terms is often confusing.


1 Answers

The git clone command will clone a repo into a newly created directory, while go get downloads and installs the packages named by the import paths, along with their dependencies.

like image 68
Jere Avatar answered Sep 21 '22 14:09

Jere