Linux can check out branches under git, but many users don't know that git can check out a single branch. The method of checking out branches using git does not apply to separate branches. Check out, how does Linux git check out a single branch?
Sometimes, just want to clone a separate branch to (for example, the site posted the code) from the repository, other branches do not need to check out.
At this point, using git clone directly out of the entire repository is not appropriate.
git clone "url" --branch "branch" --single-branch ["folder"]
But this is slightly different from my actual situation, my code was used before Svn managed, has been published on the server using the svn method, using this command prompts an error:
git clone -b qinghaihu --single-branch .
Because there is already a corresponding file on the current directory, there is no such problem if it is published to a new directory.
Another answer:
Clone a specific Git branch [duplicate]
ie:
cd $BRANCH
git init< Br>
git remote add -t $BRANCH -f origin $REMOTE_REPO
git checkout -f $BRANCH
Note that the last checkout command adds a -f parameter so that Forcing an existing file to be overwritten
The above is a description of how git checks out a separate branch. If you use git to check out the entire repository, you will get an error message. You should use the correct command to check out the individual branch.
In the Ubuntu system, there are users who have encountered garbled problems after setting up the Dem
Ubuntu sometimes need to modify the command prompt PS1 when using the command, but many people do no
Because Linux software installation requires the use of commands, many people encountered a lot of p
Linux system files, including folders, will have some permissions. These Linux perm
Ubuntu install vim plugin steps
Linux system prompts mount unknown when mounting U disk
Linux svn error Cant convert string from how to do?
Linux command line in the network speed test method detailed
Linux uses node.js to execute commands.
What is the command to specify the line in the Linux view file?
How to develop JNDI in Linux Jetty environment
How Linux implements remote control of shell commands
What commands are used for Linux system monitoring?
What should I do if the Win10 app store won't open?
Win8.1 Upgrade Preview 13 Features
How to remove viruses hidden in Win7 system services?
Ntscan metamorphosis scanner usage and FAQ
Sina live plug-in installation can not see live solution
What is the format of .BOV, what player to open with
Windows Server 2003 Simplified Chinese Enterprise Edition download
How to repair the XP system Recycle Bin size through the registry can not be adjusted?
Experts have a trick to deal with Win8 network connection problems