Using Git to manage code engineering is a lot more convenient, but when you're done feature branch or finish hotfix, always forget to delete these useless branches, one by one delete really troublesome, repetitive manual labor is not in line with the programmer's style, so write a simple script. One-click
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-
There are two ways of creating a new remote branch:Mode one: command line git push Origin Branch-name is the name of the remote branch you want to create. You can use Git bash or terminal in Android studio to hit the command line.
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/
The command is as follows:1: Locally created branch dev[Email protected]/d/home/myself/symfony (master) $ git branch dev2: The following is the submission of the local branch to the remote repository[Email protected]/d/home/myself/symfony (master) $
--global user.email "[Email protected]"7. Submit ChangesUse the command git add * to commit all changes to the cache (local), waiting to be sentUse the command git commit-m "Modify information" to submit the changes to head (local) and describe what modifications were made8. Commit changes to the remote serverUse the command
This post consists of: http://xinpure.com/?p=15Bulk Delete Git branchWhen you use git , you often find that you create a large number of branches unconsciously. So, the trouble is coming, so many abandoned branches, what to do?You can't always do git branch-d branchname
git branch-d branchname Deleting a branch requires the following conditions:1 if the branch to be deleted does not have upstream branch, the branch to be removed needs to be merged into the head, otherwise you will need to use-D t
Git exception: Cannot delete the branch 'test1' when you are currently on, gittest1
GitHub practice series summary:Http://www.cnblogs.com/dunitian/p/5038719.html
------------------------------------------------------
Many people ask, can git gui and github be directly visualized? What are all commands ???
Er (⊙ o
commit, the next man document, found this option.
-fis to ignore the backup. Without this option, the second time you run this command, you'll get an error, meaning that git did the last backup, and now you have to run it to get rid of the last backup.
--allis for all branches.
Try running a few times, see more than 40 commits are rewritten, and then check to see that the files to be deleted are indeed deleted. So happily to GitHub to bu
the servers and branches that the current branch is tracking, fetches the data from the server, and then attempts to merge into that remote branch.
Because git pull the magic is often confusing, it fetch is usually better to use the merge command explicitly alone.
5)
, with the git status view workspace, it's clean (unless you have a file that's not managed by git), so you can safely create a branch to fix the bug.First determine which branch to fix the bug on, assuming that you need to master fix it on the branch, from master creating a
master -> origin/master
The above information "0205aab .. febd8ed master-> origin/master" indicates that the master Branch has been updated. We can use the following command to synchronize updates to the local machine:
$ git merge origin/masterUpdating 0205aab..febd8edFast-forward README.md | 1 + 1 file changed, 1 insertion(+)
View the content of the README. md file:
$ Cat README. md # cainiao tutoria
Git branch management and Git branch managementGit branch management overview
Almost every version control system supports branches in some form. Using a branch means you can separate it from the Development Main Line and continue
the actual use is enough.
First, find the tags list to be deleted from the remote end. The key is to use the command.
Git show-ref -- tag
This command can list all the remote tag lists, and then the general processing method under shell.
Git push origin:
The preceding command will
.
With git checkout test, we can switch to the test branch.
#git checkout testSwitched to branch 'test'#git branch master*test
Through the git checkout-B xx command, we can create xx
branch is relatively simple, you can use the "Git branch-d" command, in order to not affect the later content, here is the demo new, delete Dev branch.Merging of branchesBranch is created to facilitate development, fix bugs, and keep master stable. But eventually the content on the
relationship is roughly as follows" iss53 " 'finished the new footer [issue]'1 file1 insertion (+)Then start merging.' Master ' 'recursive'| 1 +1file1 insertion (+)There is no fast-forward word for merging here, because it is not simple to move the branch pointer. Git merges with the three-way merge (Three-way merge) and creates a commit (C6) that contains the merged results. The three-way merging me
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.