branch

Using Git, how could I search for a string across all branches?

╄→гoц情女王★ 提交于 2019-12-03 01:34:38
问题 Using Git, how could I search within all files in all local branches for a given string? GitHub specific: is it possible to perform the above search across all GitHub branches? (There are several remote branches on my remote GitHub repository that ideally I wouldn't have to bring down for this search...) 回答1: You can do this on a Git repository: git grep "string/regexp" $(git rev-list --all) GitHub advanced search has code search capability: The code search will look through all of the code

Why can't Git resolve remote branches when --single-branch is used?

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: So, we frequently optimize clones by effectively cloning with --single-branch. However, we are then unable to get additional branches later. What is the difference, plumbing-wise, between a git clone with and without --single-branch? How can we fetch down additional branches later? A standard clone: $ git clone -b branch-name https://repo.url standard $ cd standard $ git checkout remote-branch Branch 'remote-branch' set up to track remote branch 'remote-branch' from 'origin'. Switched to a new branch 'remote-branch' A single-branch clone: $

You asked me to pull without telling me which branch you want to merge with

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: TL;DR: I have a "tracked" branch that I can't pull. So here I am in "bucket-4": $ git branch -v bucket-1 410f7b5 * gh-53 * gh-48 * "Share App" bucket-2 7ed70a2 * upgrade to SOLR 3.3.0 bucket-3 400ffe4 * emergency fix prod issue * bucket-4 64c2414 Merge branch 'bucket-3' into bucket-4 master 8dc4854 [ahead 1] * gh-73 I'd like to pull in changes from my remote: $ git pull You asked me to pull without telling me which branch you want to merge with, and 'branch.bucket-4.merge' in your configuration file does not tell me, either. Please specify

Git branch overwrites master when merging without offering conflicts

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have master project and one branch made from it. When I merge master with branch, code in branch overwrites the one in master, and I would like to insert only different code from branch in master, or at least to be asked which code I want to keep. Here is one simple example of how I set up everything: mkdir project cd project git init inside project directory I have one file called index.php with this code: <?php /** * This is master code. */ class ClassName extends AnotherClass { function __construct(argument) { // this is from master } }

Get commit where merged branch forked from (with intermediate merge)

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Lets use the latest available git 2.16.2 and tig 2.3.3. cd / tmp && mkdir fit && cd fit git init touch m1 && git add m1 && git commit - m "master 1" touch m2 && git add m2 && git commit - m "master 2" git checkout - b develop touch d1 && git add d1 && git commit - m "develop 1" git checkout master touch m3 && git add m3 && git commit - m "master 3" git checkout develop git merge master -- no - edit touch d2 && git add d2 && git commit - m "develop 2" touch d3 && git add d3 && git commit - m "develop 3" git checkout master git merge

How to parse a JSON string in Delphi?

匿名 (未验证) 提交于 2019-12-03 01:32:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How can I parse the JSON string {"data":{"results":[{"Branch":"ACCT590003"}]}} using the TJSONObject object? I want to get the ACCT590003 value from this string. 回答1: uses SysUtils, DBXJSON; type TProcessJSONString = TProc ; procedure DoJSONObject(o: TJSONObject; Process: TProcessJSONString); forward; procedure DoJSONArray(o: TJSONArray; Process: TProcessJSONString); var i: integer; v: TJSONValue; begin for i := 0 to o.Size - 1 do begin v := o.Get(i); if v is TJSONObject then DoJSONObject(v as TJSONObject, Process); end; end; procedure

How do I tell git-svn about a remote branch created after I fetched the repo?

匿名 (未验证) 提交于 2019-12-03 01:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using git-svn to work against my company's central svn repository. We've recently created a new feature branch in the central repo. How do I tell git about it? When I run git branch -r I can only see the branches that existed when I ran fetch against the svn repo to initialize my git repo? 回答1: You can manually add the remote branch, git config --add svn-remote.newbranch.url https://svn/path_to_newbranch/ git config --add svn-remote.newbranch.fetch :refs/remotes/newbranch git svn fetch newbranch [-r ] git checkout -b local-newbranch -t

git rebase: “error: cannot stat &#039;file&#039;: Permission denied”

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using git, and made a small commit followed by a large one. I decided to use git rebase to squash the two commits together before pushing them. (I've never done this before.) So I did: git rebase -i HEAD~2 This gave me my editor, where I chose to pick the earlier commit and squash the later one. When I saved, git said: error: cannot stat ' filename ': Permission denied Could not apply sha1 for later commit ... initial line of text for that commit Now: Neither commit appears when I do git log . git status tells me I'm "Not currently on

Github: Mirroring gh-pages to master

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm developing a jQuery plugin that's being hosting on GitHub. It has a demo included of which I'm manually copying and pushing to the branch gh-pages , what I'd like to do is have it so when I push a change to master it is automatically pushed to gh-pages , or at least a setup where they are mirrored. I've already seen this question but not sure if it really answers my question with regard to these requirements: I use Tower , I don't mind using the terminal (Mac) to make changes to config, so long as the solution works with this GUI. I only

Why does git fast-forward merges by default?

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Coming from mercurial, I use branches to organize features. Naturally, I want to see this work-flow in my history as well. I started my new project using git and finished my first feature. When merging the feature, I realized git uses fast-forward, i.e. it applies my changes directly to the master branch if possible and forgets about my branch. So to think into the future: I'm the only one working on this project. If I use git's default approach (fast-forward merging), my history would result in one giant master branch. Nobody knows I used a