Sometimes you need to get the code for a remote branch from a remote git server, and the command is GIT fetch Origin remote-branch:local-branch, which is easier to forget, especially recorded.
1. View Remote repositories
We sometimes encounter such problems when using Git clones or other commands, as shown in the figure:
Fatal:could not read from remote repository.
Please make sure your have the correct access rights
and the repository exists.
Fatal:could not read from remote repository. Please make sure your have the correct access rights and the repository exists.
This proble
1, create a new branch from an existing branch (such as from the Master branch), create a dev branchgit checkout-b Dev2, can be viewed once created, branch has switched to DevGit branch* DevMaster3, submit the branch to the remote repositoryGit push Origin Dev4, test from remote get devGit pull Origin Dev or: If you run git fetch with the command line, you can g
branches, otherwise the code how to manage. 3. Create a new branch on top of some basics Git checkout–b D96 Create a branch and switch to the new branch at the same time. 4. Sync to the server, associate the new branch with the parent branch and make it easy for colleagues to enter together (he is also the same, download the warehouse, just switch branches, not switch h28, and D96, and do not need to create a new branch)
Sometimes you need to get the code for a remote branch from a remote git server, and the command is git fetch Origin remote-branch:local-branch, which is easier to forget, especially recorded.1. View Remote repositoriesGit
Run the following command on ubuntu10.04:
Git clone git: // xxx
XXX is the source code path. Copy the code on git and execute the GIT commit and git push commands respectively. After git push is executed, the terminal directly
Git is really a magic tool. Today it took an hour to solve the problem of synchronization of this branch, and it has also improved a lot in understanding of the branch.
"Git GC" is a good command, which can be optimized and run without any problems.
The error message is as follows:
Git push origin xxxx
....
[Remote
1. Use clone command to clone remote code to local git clone xxx (remote_url) 2, use branch to view branch git branch-a View all branches on remote git 3, switch branch git checkout-b Push local Branch modification to a
-lib.git and then O, huh.
However, the following errors may occur:
Initialized empty git repository in/home/Norton/work/test/box_client/. Git/Fatal: 'repositories/box_client.git 'does not appear to be a git RepositoryFatal: the remote end hung up unexpectedly
Conclusion: The pure repository created by servera cannot b
One, view remote branch
Use the following git command to view all remote branches:
Git branch-r1
Two, pull remote branch and create local branch
Method One
Use the following command:
git checkout-b local branch name x origin/
Git's tag function is very convenient for us to find a version, but often sometimes the wrong tag, and upload to remote, then how to delete it.
What we used to do in Windows is tortoisegit, he can delete the local tag, but I'm sorry I didn't find him removing the remote tag again, and it seems to be only for Gitbash.
Gitbash does have the delete local/remote ta
1. delete a local branch:Git branch-D branchname2. delete a remote Branch:// Method 1: Push the local branch to a remote location (the remote branch to be deleted has a ing locally) git push origin: branchname // Method 2: delete a remote branch directly (the
git clone can clone only the master branch of the remote library and cannot clone all branches, the workaround is as follows:
1. Find a clean directory, assuming it is git_work2. CD Git_work3. Git clone http://myrepo.xxx.com/project/.git, so you get a project subdirectory in the Git_work directory4. CD Project5.
Http://zhidao.baidu.com/link?url=cuqJsL9skJJn5c556zXfP1dgCAOUK37CDXkNIw_ Ss0ykmvoroti0hp7-pbkjgs6lv4xrgleg2fjg5aangaslxgmt00c7rsc5gpprykr_d_ggit clone can clone only the master branch of the remote library and cannot clone all branches, the workaround is as follows:1. Find a clean directory, assuming it is git_work2. CD Git_work3. Git clone http://myrepo.xxx.com/project/.
This error is caused by git clone and git push when you compile and install git because there is no Curl-devel installed (Lib)If you install (Lib) curl-devel, and then recompile and install Git, there is no such error:$ yum Install curl-devel$ # CD to wherever the source for git
If you want to fetch a branch on GitHub to the local machine, directly enter the following command:
Git checkout origin/
Result error:
Error: pathspec 'origin/feature_renrendai_tongji 'did not match any file (s) known to git.
See http://stackoverflow.com/questions/5989592/git-cannot-checkout-branch-error-pathspec-did-not-match-any-files-kn,
The fo
I used Google search how to delete git tags batch, found that the foreigner's saying is probably, bulk delete, haha, English not ah.
Nothing more than the shell of some practice, feel the actual use of enough.
The first is to find the remote to delete tags list, the key is to use the instructions.
Git show-ref--tag
This command lists all the
1, in the development process, everyone in the remote creation of many branches, some are useless, how to delete, you can refer to the following methods.If you no longer need a remote branch, such as taking a feature and merging it into a remote master branch (or any other storageStable code place), you can use this very unreasonable syntax to delete it:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.