InterviewSolution
| 1. |
What is the difference between git checkout and git clone? |
|
Answer» git clone is to fetch your repositories from the remote git server.we clone a remote repository with below command git clone [url] For example, Let’s say if we want to clone the Open Framework Git library called open_framework, we can easily do so like this: $ git clone git://github.com/SU-SWS/open_framework.git That will create a directory named open_framework (at our local file system location), and initializes a .git directory inside it, extract all the data for that repository, and CHECKS out a working copy of the LATEST version. If we go into the newly created open_framework directory, we can see the project files in there, READY to be worked on or used. Cloning a Repository Into a Specific Local Folder If we want to clone the repo into a particular directory named something other than open_framework, we can specify that as the next command-line option: $ git clone git:github.com/SU-SWS/open_framework.git mynewtheme The above command does the same thing as the previous one, but the clone gets created in the target directory called my new THEME. git CHECKOUT is to check out the desired status of your repository (like branches or particular files). E.g., you are currently on the master branch and you want to switch into the develop branch. git checkout develop_branch |
|