branch

How can I specify which branch should be checked out in a fresh clone?

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In Git Extensions, the user can, when cloning a repository, specify which branch (possibly other than master ) should be checked out in the resulting clone. How can I do that at the command line? 回答1: The answer, as often, is in the man pages (in the git-clone man page, here): --branch <name>, -b <name> Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository's HEAD, point to <name> branch instead. In a non-bare repository, this is the branch that will be checked out. --branch can also take tags and

Merging two remote repositories in Git

匿名 (未验证) 提交于 2019-12-03 02:35:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to merge two remote repositories in Git. One is mainstream repository, which I do not have write permission. I want to track its master branch. The other is maintained by us, I have full rights on it. I want to track the mainstream code. At the same time, our modification would be recorded in my remote repository. How do I do this? 回答1: I would recommend: cloning yourRemoteRepo (that way, you can easily pull/push from that repo) adding mainstreamRepo as a remote and fetch its branch, then track the one which interest you git clone git

svn switch , what does --relocate do?

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When one does svn switch <source> <target> , I understand that it switches the working directory to target path. I would like to understand what --relocate is used for. I thought this was only used when the url of repository had changed and one wanted to update working copy url to point to new svn server location. But it seems Relocate can only change the repository part of an URL . So my question is, what does the --relocate switch do? In particular, can it be used to integrate to user branch a vendor branch that has many differences since

Depend on a branch or tag using a git URL in a package.json?

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Say I've forked a node module with a bugfix and I want to use my fixed version, on a feature branch of course, until the bugfix is merged and released. What would I scribble into the dependencies of my package.json ? 回答1: From the npm docs : git : //github.com/ / .git# git : //github.com/ / .git#feature\/ 回答 2 : per @dantheta's comment: As of npm 1.1.65, Github URL can be more concise user/project. npmjs.org/doc/files/package.json.html You can attach the branch like user/project#branch So "babel-eslint" : "babel/babel-eslint" , Or

Primefaces 3.5 + OmniFaces 1.3 SelectItemsIndexConverter issue with SelectOneMenu

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using Primefaces 3.5 5th December 2012 SNAPSHOT, with Mojarra 2.1.14 and Tomcat 7.0.33. When using the in-cell editing mode (not in-row) for POJO objects with a model/entity class that are represented in a h:selectOneMenu, with 'click' as the celleditevent value, whenever you click on an object and then 'click away' by clicking on some other object, the previous object is displaying its value instead of its label. This is only 'cosmetic' as when you reload the page, it will show the label value. <p:dataTable id="insurancepolicyTable" var

Differences between “git pull” commands when pulling from origin?

匿名 (未验证) 提交于 2019-12-03 02:30:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What are the differences between these commands?: # 1 git pull # 2 git pull origin # 3 git pull origin master # 4 git pull origin/master # 5 git pull origin HEAD:master 回答1: git pull is a convenience command, which is doing different things at the same time. Basically it is just a combination of git fetch , which connects to the remote repository and fetches new commits, and git merge (or git rebase ) which incorporates the new commits into your local branch. Because of the two different commands involved the meaning of git pull is not

Git Cherry-pick vs Merge Workflow

匿名 (未验证) 提交于 2019-12-03 02:30:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Assuming I am the maintainer of a repo, and I want to pull in changes from a contributor, there are a few possible workflows: I cherry-pick each commit from the remote (in order). In this case git records the commit as unrelated to the remote branch. I merge the branch, pulling in all changes, and adding a new "conflict" commit (if needed). I merge each commit from the remote branch individually (again in order), allowing conflicts to be recorded for each commit, instead of grouped all together as one. For completeness, you could do a rebase

Get error message &#039;&#039;fatal: sha1 information is lacking or useless“ when apply a patch using ”git am -3\&quot;

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to apply a series of patches from 1 git repository to another git repository using git am -3 "path to a patch". I apply them in order, from patch 1-4, it works fine. But when I come to 5th patch,I get the error saying "fatal: sha1 information is lacking or useless". I go the to git repository where I apply the patch, I do see the file 'dev/afile'. So I wonder why git is complaining about "sha1 information is lacking or useless (dev/afile.c)" and how can I fix my problem? $ git am -3 ~/Tmp/mypatches/0005-fifth.patch Applying:

Git rebase: no tracking information

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using git version 2.9.0.windows.1 and I want to rebase a local repository (no remote). But I always get There is no tracking information for the current branch. Please specify which branch you want to rebase against. See git-rebase(1) for details. git rebase If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=/ master I tried git rebase -i HEAD~3 as suggested in this solution , but it doesn't work in my case. If I simply copy the repository to my Linux machine, git rebase works fine.

Git checkout: “@{-N}” syntax

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I found this section in the git manpage, but it's kind of an obfuscated explaination: As a special case, the "@{-N}" syntax for the N-th last branch checks out the branch (instead of detaching). You may also specify - which is synonymous with "@{-1}". What does it mean? 回答1: It's saying that if you do: git checkout @{-1} You'll check out the branch you were on before the current branch you have checked out. In addition, it checks it out by name , so you'll actually be on that branch, rather than just checking out that commit in a detached