QuestionId stringlengths 3 8 | QuestionTitle stringlengths 15 149 | QuestionScore int64 1 27.2k | QuestionCreatedUtc stringdate 2008-08-01 18:33:08 2025-06-16 04:59:48 | QuestionBodyHtml stringlengths 40 28.2k | QuestionViewCount int64 78 16.5M | QuestionOwnerUserId float64 4 25.2M ⌀ | QuestionLastActivityUtc stringdate 2008-09-08 19:26:01 2026-01-24 22:40:25 | AcceptedAnswerId int64 266 79.7M | AnswerScore int64 2 30.1k | AnswerCreatedUtc stringdate 2008-08-01 23:40:28 2025-06-16 05:23:39 | AnswerOwnerUserId float64 1 29.5M ⌀ | AnswerLastActivityUtc stringdate 2008-08-01 23:40:28 2026-01-23 17:46:09 | QuestionLink stringlengths 31 36 | AnswerLink stringlengths 31 36 | AnswerBodyHtml stringlengths 35 33k | AnswerBodyPreview stringlengths 35 400 | AllTagIdsCsv stringlengths 2 37 | AllTagNamesCsv stringlengths 2 106 | MergedQuestion stringlengths 74 28.4k | quality_filter stringclasses 10
values | unique_id int64 0 29k | tag_major_lang stringclasses 10
values | MergedQuestion_md stringlengths 60 28.1k | AnswerBodyHtml_md stringlengths 14 29.2k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
50388717 | IntelliJ Terminal CTRL+C does not work | 14 | 2018-05-17 10:04:38 | <p>When using IntelliJs integrated terminal - for example with git - sometimes my CTRL + C keystrokes don't make to the terminal. For example the current line is not aborted.</p>
<p>What can I do as this behaviour is very annoying.</p>
| 7,757 | 808,723 | 2022-02-27 02:49:01 | 50,388,718 | 13 | 2018-05-17 10:04:38 | 808,723 | 2020-09-30 16:29:53 | https://stackoverflow.com/q/50388717 | https://stackoverflow.com/a/50388718 | <p>As I had <code>git for Windows</code> installed anyway I just replaced the terminal used by IntelliJ from <code>cmd.exe</code> (which is the default on windows) to <code>bash.exe</code> supplied by <code>git for Windows</code> (which is <code>cygwin</code> btw)</p>
<p>To change it for all projects go to <code>File &... | <p>As I had <code>git for Windows</code> installed anyway I just replaced the terminal used by IntelliJ from <code>cmd.exe</code> (which is the default on windows) to <code>bash.exe</code> supplied by <code>git for Windows</code> (which is <code>cygwin</code> btw)</p> <p>To change it for all projects go to <code>File &... | 64, 119, 391, 8945 | git, intellij-idea, terminal, windows | <h1>IntelliJ Terminal CTRL+C does not work</h1>
<p>When using IntelliJs integrated terminal - for example with git - sometimes my CTRL + C keystrokes don't make to the terminal. For example the current line is not aborted.</p>
<p>What can I do as this behaviour is very annoying.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,574 | git | # IntelliJ Terminal CTRL+C does not work
When using IntelliJs integrated terminal - for example with git - sometimes my CTRL + C keystrokes don't make to the terminal. For example the current line is not aborted.
What can I do as this behaviour is very annoying. | As I had `git for Windows` installed anyway I just replaced the terminal used by IntelliJ from `cmd.exe` (which is the default on windows) to `bash.exe` supplied by `git for Windows` (which is `cygwin` btw)
To change it for all projects go to `File >> Other Settings >> Default Settings` and then `Tools >> Terminal`. (... |
48293820 | What does "No remote for the current branch" mean? | 14 | 2018-01-17 04:53:09 | <p>What does "remote" mean here? What does "No remote for the current branch" mean?</p>
<p>I am trying to merge my changes to my code in Git and I get this
message.</p>
| 40,088 | 7,714,404 | 2022-02-04 14:59:12 | 48,294,117 | 13 | 2018-01-17 05:24:55 | 6,309 | 2018-01-17 12:22:37 | https://stackoverflow.com/q/48293820 | https://stackoverflow.com/a/48294117 | <p>A merge between two local branches of your local repo should not require any "remote" (which is a reference to an upstream repo URL)</p>
<p>But: As mentioned in <a href="https://git-scm.com/docs/git-merge#_configuration" rel="noreferrer"><code>git merge</code> man page, section CONFIGURATION</a>:</p>
<bloc... | <p>A merge between two local branches of your local repo should not require any "remote" (which is a reference to an upstream repo URL)</p> <p>But: As mentioned in <a href="https://git-scm.com/docs/git-merge#_configuration" rel="noreferrer"><code>git merge</code> man page, section CONFIGURATION</a>:</p> <bloc... | 119 | git | <h1>What does "No remote for the current branch" mean?</h1>
<p>What does "remote" mean here? What does "No remote for the current branch" mean?</p>
<p>I am trying to merge my changes to my code in Git and I get this
message.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,575 | git | # What does "No remote for the current branch" mean?
What does "remote" mean here? What does "No remote for the current branch" mean?
I am trying to merge my changes to my code in Git and I get this
message. | A merge between two local branches of your local repo should not require any "remote" (which is a reference to an upstream repo URL)
But: As mentioned in [`git merge` man page, section CONFIGURATION](https://git-scm.com/docs/git-merge#_configuration):
> If `merge` is called without any commit argument, merge the upst... |
31764311 | How do I release file system locks after cloning repo via JGit | 14 | 2015-08-01 17:29:25 | <p>I am playing around with cloning a remote existing repo with jGit following the guide here:</p>
<p><a href="https://github.com/centic9/jgit-cookbook/blob/master/src/main/java/org/dstadler/jgit/porcelain/CloneRemoteRepository.java" rel="noreferrer">https://github.com/centic9/jgit-cookbook/blob/master/src/main/java/o... | 3,328 | 2,166,947 | 2021-04-18 14:35:17 | 31,764,312 | 13 | 2015-08-01 17:29:25 | 2,166,947 | 2015-08-01 17:29:25 | https://stackoverflow.com/q/31764311 | https://stackoverflow.com/a/31764312 | <p>So literally as I was clicking submit on this after a couple days of poking I stumbled across what I believe is the answer. </p>
<p>The cookbook example only calls the <code>.close()</code> method on the result of the <code>cloneRepository()</code>'s <code>call()</code> method (A <code>Git</code> instance). The A... | <p>So literally as I was clicking submit on this after a couple days of poking I stumbled across what I believe is the answer. </p> <p>The cookbook example only calls the <code>.close()</code> method on the result of the <code>cloneRepository()</code>'s <code>call()</code> method (A <code>Git</code> instance). The A... | 17, 11758, 61058 | filehandle, java, jgit | <h1>How do I release file system locks after cloning repo via JGit</h1>
<p>I am playing around with cloning a remote existing repo with jGit following the guide here:</p>
<p><a href="https://github.com/centic9/jgit-cookbook/blob/master/src/main/java/org/dstadler/jgit/porcelain/CloneRemoteRepository.java" rel="noreferr... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,577 | git | # How do I release file system locks after cloning repo via JGit
I am playing around with cloning a remote existing repo with jGit following the guide here:
<https://github.com/centic9/jgit-cookbook/blob/master/src/main/java/org/dstadler/jgit/porcelain/CloneRemoteRepository.java>
I'm using CFML for my example:
```
... | So literally as I was clicking submit on this after a couple days of poking I stumbled across what I believe is the answer.
The cookbook example only calls the `.close()` method on the result of the `cloneRepository()`'s `call()` method (A `Git` instance). The API docs state that method should also call the `.close` m... |
28048270 | How do I use vim as 'git show' editor? | 14 | 2015-01-20 14:49:34 | <p>all as described in <a href="https://stackoverflow.com/questions/16666009/how-do-i-use-vim-as-git-log-editor">How do I use vim as 'git log' editor?</a> doesn't work for git show .
I use often</p>
<pre><code>git show HEAD
ctrl+z
ps
PID TTY TIME CMD
7083 pts/8 00:00:06 bash
31758 pts/8 0... | 7,467 | 778,517 | 2021-02-05 22:49:17 | 28,057,170 | 13 | 2015-01-20 23:34:29 | 930,262 | 2015-01-20 23:34:29 | https://stackoverflow.com/q/28048270 | https://stackoverflow.com/a/28057170 | <p>You can use the following command:</p>
<pre><code>PAGER='vim -' git -c color.ui=false show
</code></pre>
| <p>You can use the following command:</p> <pre><code>PAGER='vim -' git -c color.ui=false show </code></pre> | 119, 370 | git, vim | <h1>How do I use vim as 'git show' editor?</h1>
<p>all as described in <a href="https://stackoverflow.com/questions/16666009/how-do-i-use-vim-as-git-log-editor">How do I use vim as 'git log' editor?</a> doesn't work for git show .
I use often</p>
<pre><code>git show HEAD
ctrl+z
ps
PID TTY TIME C... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,578 | git | # How do I use vim as 'git show' editor?
all as described in [How do I use vim as 'git log' editor?](https://stackoverflow.com/questions/16666009/how-do-i-use-vim-as-git-log-editor) doesn't work for git show .
I use often
```
git show HEAD
ctrl+z
ps
PID TTY TIME CMD
7083 pts/8 00:00:06 bash
31758 ... | You can use the following command:
```
PAGER='vim -' git -c color.ui=false show
``` |
24437652 | Do I have to commit my changes before pulling in Git? | 14 | 2014-06-26 18:28:15 | <p>It looks like I'm missing basic understanding of <code>git pull</code> and <code>git commit</code>, let's say I'm working on branch and it was updated by other developer while I was doing my job locally. Should I commit changes before issuing <code>git pull</code> or should I do <code>git pull</code> and then do <co... | 20,052 | 2,896,521 | 2021-12-10 05:06:25 | 24,437,707 | 13 | 2014-06-26 18:31:06 | 1,640,038 | 2018-10-07 16:45:23 | https://stackoverflow.com/q/24437652 | https://stackoverflow.com/a/24437707 | <p>You can do a commit anytime you want - all your commits are local.</p>
<p>It's only when you need to <code>push</code> to the server that you need to have its latest copy. So it's a good idea that you always <code>pull</code> from the remote repository before you <code>push</code> your changes.</p>
<p>So, I think ... | <p>You can do a commit anytime you want - all your commits are local.</p> <p>It's only when you need to <code>push</code> to the server that you need to have its latest copy. So it's a good idea that you always <code>pull</code> from the remote repository before you <code>push</code> your changes.</p> <p>So, I think ... | 119 | git | <h1>Do I have to commit my changes before pulling in Git?</h1>
<p>It looks like I'm missing basic understanding of <code>git pull</code> and <code>git commit</code>, let's say I'm working on branch and it was updated by other developer while I was doing my job locally. Should I commit changes before issuing <code>git p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,579 | git | # Do I have to commit my changes before pulling in Git?
It looks like I'm missing basic understanding of `git pull` and `git commit`, let's say I'm working on branch and it was updated by other developer while I was doing my job locally. Should I commit changes before issuing `git pull` or should I do `git pull` and t... | You can do a commit anytime you want - all your commits are local.
It's only when you need to `push` to the server that you need to have its latest copy. So it's a good idea that you always `pull` from the remote repository before you `push` your changes.
So, I think what you mean is "Should I *push* changes before i... |
6154233 | Does branching in git create a parent-child relationship? | 14 | 2011-05-27 15:12:54 | <p>If I do</p>
<pre><code>$ git branch a
$ git checkout a
Switched to branch 'a'
$ git branch b
$ git checkout b
Switched to branch 'b'
$ git branch c1
$ git branch c2
</code></pre>
<p>Is there any relationship between these branches, or are there all considered 'flat' because there weren't any commits in them? In SV... | 12,237 | 11,236 | 2013-06-21 10:36:07 | 6,154,268 | 13 | 2011-05-27 15:15:51 | 576,139 | 2011-05-27 15:21:57 | https://stackoverflow.com/q/6154233 | https://stackoverflow.com/a/6154268 | <p>git doesn't have a <em>strict</em> parent branch, it just has a particular commit path. In this case, they all have the same commit as their starting point, so they're all the same. As soon as they start having their own commits, they'll be their own "lines", but they won't really have a relationship to one-another.... | <p>git doesn't have a <em>strict</em> parent branch, it just has a particular commit path. In this case, they all have the same commit as their starting point, so they're all the same. As soon as they start having their own commits, they'll be their own "lines", but they won't really have a relationship to one-another.... | 119, 76220 | git, git-branch | <h1>Does branching in git create a parent-child relationship?</h1>
<p>If I do</p>
<pre><code>$ git branch a
$ git checkout a
Switched to branch 'a'
$ git branch b
$ git checkout b
Switched to branch 'b'
$ git branch c1
$ git branch c2
</code></pre>
<p>Is there any relationship between these branches, or are there all... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,582 | git | # Does branching in git create a parent-child relationship?
If I do
```
$ git branch a
$ git checkout a
Switched to branch 'a'
$ git branch b
$ git checkout b
Switched to branch 'b'
$ git branch c1
$ git branch c2
```
Is there any relationship between these branches, or are there all considered 'flat' because there ... | git doesn't have a *strict* parent branch, it just has a particular commit path. In this case, they all have the same commit as their starting point, so they're all the same. As soon as they start having their own commits, they'll be their own "lines", but they won't really have a relationship to one-another.
At any p... |
4761562 | With git, how do you search for a file pattern with `git log` instead of a file path? | 14 | 2011-01-21 17:02:42 | <p>You can limit your <code>git log</code> search to a file like so:</p>
<pre><code>git log [branch] -- foo.c
</code></pre>
<p>But how would you limit the search to a file pattern instead of a full path?</p>
<ul>
<li>Consider that you may run <code>git log</code>
on another branch, where shell
expansion of <code>*</... | 9,696 | 14,193 | 2025-09-05 16:19:02 | 4,762,017 | 13 | 2011-01-21 17:45:23 | 119,963 | 2011-01-21 18:55:03 | https://stackoverflow.com/q/4761562 | https://stackoverflow.com/a/4762017 | <p>I tend to do things like this:</p>
<pre><code>git ls-files [--with-tree=<branch>] [path] | grep '<pattern>' | xargs git log [branch]
</code></pre>
| <p>I tend to do things like this:</p> <pre><code>git ls-files [--with-tree=<branch>] [path] | grep '<pattern>' | xargs git log [branch] </code></pre> | 119, 456 | git, version-control | <h1>With git, how do you search for a file pattern with `git log` instead of a file path?</h1>
<p>You can limit your <code>git log</code> search to a file like so:</p>
<pre><code>git log [branch] -- foo.c
</code></pre>
<p>But how would you limit the search to a file pattern instead of a full path?</p>
<ul>
<li>Consi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,583 | git | # With git, how do you search for a file pattern with `git log` instead of a file path?
You can limit your `git log` search to a file like so:
```
git log [branch] -- foo.c
```
But how would you limit the search to a file pattern instead of a full path?
- Consider that you may run `git log`
on another branch, whe... | I tend to do things like this:
```
git ls-files [--with-tree=<branch>] [path] | grep '<pattern>' | xargs git log [branch]
``` |
3219713 | How to concatenate two git histories? | 14 | 2010-07-10 15:09:56 | <p>I have two git repositories that are tangentially related. Namely, content of one was a predecessor of the other. I would like to somehow prepend the full history of depository A to the depository B, so that tip of A would be a parent of the very first changeset of repository B? Histories in both are pretty linear. ... | 2,327 | 12,855 | 2025-07-03 15:33:24 | 3,219,820 | 13 | 2010-07-10 15:36:44 | 6,309 | 2017-01-24 10:19:44 | https://stackoverflow.com/q/3219713 | https://stackoverflow.com/a/3219820 | <p>You could try using the graft file (<code>.git/info/grafts</code>) where you could overwrite the parenthood of a commit (like the first of <code>projectB</code> having for parent the latest of <code>projectA</code>)</p>
<p>See also "<a href="https://stackoverflow.com/questions/161928/what-are-git-info-grafts-for">W... | <p>You could try using the graft file (<code>.git/info/grafts</code>) where you could overwrite the parenthood of a commit (like the first of <code>projectB</code> having for parent the latest of <code>projectA</code>)</p> <p>See also "<a href="https://stackoverflow.com/questions/161928/what-are-git-info-grafts-for">W... | 119, 1318, 7330, 91259 | git, git-rewrite-history, history, repository | <h1>How to concatenate two git histories?</h1>
<p>I have two git repositories that are tangentially related. Namely, content of one was a predecessor of the other. I would like to somehow prepend the full history of depository A to the depository B, so that tip of A would be a parent of the very first changeset of repo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,584 | git | # How to concatenate two git histories?
I have two git repositories that are tangentially related. Namely, content of one was a predecessor of the other. I would like to somehow prepend the full history of depository A to the depository B, so that tip of A would be a parent of the very first changeset of repository B?... | You could try using the graft file (`.git/info/grafts`) where you could overwrite the parenthood of a commit (like the first of `projectB` having for parent the latest of `projectA`)
See also "[What are .git/info/grafts for?](https://stackoverflow.com/questions/161928/what-are-git-info-grafts-for)" and "[How to prepen... |
2231214 | Git Tips and Tricks : Display Branch on Command Prompt not working and created side effects of git branch function not working and many others | 14 | 2010-02-09 17:53:19 | <p>Just trying to enchance my knowledge of git and use to tips and tricks, </p>
<p>I updated my .bashrc file as suggested in <a href="https://stackoverflow.com/questions/347901/what-are-your-favorite-git-features-or-tricks/583587#583587">Tip</a> <code>PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
</code> but to my surprise ... | 14,528 | 164,299 | 2015-09-08 09:51:19 | 2,231,259 | 13 | 2010-02-09 17:58:27 | 24,762 | 2012-10-18 20:22:57 | https://stackoverflow.com/q/2231214 | https://stackoverflow.com/a/2231259 | <p>Have you enabled the <a href="http://bash-completion.alioth.debian.org/" rel="noreferrer">git bash-completion</a> functions? You may find them on your system already, just not enabled.</p>
<p>To work out whether they're on or not, type <code>git</code><kbd>Space</kbd><kbd>Tab</kbd> -- If you get a list of files, y... | <p>Have you enabled the <a href="http://bash-completion.alioth.debian.org/" rel="noreferrer">git bash-completion</a> functions? You may find them on your system already, just not enabled.</p> <p>To work out whether they're on or not, type <code>git</code><kbd>Space</kbd><kbd>Tab</kbd> -- If you get a list of files, y... | 119 | git | <h1>Git Tips and Tricks : Display Branch on Command Prompt not working and created side effects of git branch function not working and many others</h1>
<p>Just trying to enchance my knowledge of git and use to tips and tricks, </p>
<p>I updated my .bashrc file as suggested in <a href="https://stackoverflow.com/questio... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,585 | git | # Git Tips and Tricks : Display Branch on Command Prompt not working and created side effects of git branch function not working and many others
Just trying to enchance my knowledge of git and use to tips and tricks,
I updated my .bashrc file as suggested in [Tip](https://stackoverflow.com/questions/347901/what-are-y... | Have you enabled the [git bash-completion](http://bash-completion.alioth.debian.org/) functions? You may find them on your system already, just not enabled.
To work out whether they're on or not, type `git``Space``Tab` -- If you get a list of files, you don't have completion, if you get a list of commands, you do (and... |
44509612 | If I cherry-pick a commit from a branch and then merge the whole branch later what happens to the git history? | 13 | 2017-06-12 22:24:25 | <p>So I've got a situation where I only want a particular commit from branchA because other commits in that branch aren't ready to be merged. So if I cherry-pick commitX from branchA into master, and then later merge branchA into master (with some commits in between let's say), what happens to commitX as far as the git... | 5,109 | null | 2020-03-17 17:26:41 | 44,509,753 | 13 | 2017-06-12 22:40:16 | 1,256,452 | 2017-06-12 23:42:48 | https://stackoverflow.com/q/44509612 | https://stackoverflow.com/a/44509753 | <p>The <code>git merge</code> operation does not look at the individual commits along the "merge path", as it were. Instead, it looks only at the start and end snapshots. Note, however, that there are <em>two</em> end snapshots (and one start):</p>
<pre><code>...--o--B--o--...--o--L
\
o--...--o--R... | <p>The <code>git merge</code> operation does not look at the individual commits along the "merge path", as it were. Instead, it looks only at the start and end snapshots. Note, however, that there are <em>two</em> end snapshots (and one start):</p> <pre><code>...--o--B--o--...--o--L \ o--...--o--R... | 119, 28897, 78810 | git, git-cherry-pick, git-merge | <h1>If I cherry-pick a commit from a branch and then merge the whole branch later what happens to the git history?</h1>
<p>So I've got a situation where I only want a particular commit from branchA because other commits in that branch aren't ready to be merged. So if I cherry-pick commitX from branchA into master, and ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,593 | git | # If I cherry-pick a commit from a branch and then merge the whole branch later what happens to the git history?
So I've got a situation where I only want a particular commit from branchA because other commits in that branch aren't ready to be merged. So if I cherry-pick commitX from branchA into master, and then late... | The `git merge` operation does not look at the individual commits along the "merge path", as it were. Instead, it looks only at the start and end snapshots. Note, however, that there are *two* end snapshots (and one start):
```
...--o--B--o--...--o--L
\
o--...--o--R
```
Here, `B` is the merge base ... |
43020933 | .gitignore - ignore file starting with ~ | 13 | 2017-03-25 19:26:16 | <p>To ignore any file starting with ~(tilde), I put following in gitignore file</p>
<pre><code>^~.*
</code></pre>
<p>But, it is not working for the file name starting with ~(eg. ~$ofession email.docx).</p>
<p>There is no issue with gitignore configuration setting as other patterns are working well. </p>
<p>What is ... | 11,332 | 4,399,423 | 2019-12-23 06:55:18 | 43,021,059 | 13 | 2017-03-25 19:36:32 | 1,233,686 | 2017-03-25 19:36:32 | https://stackoverflow.com/q/43020933 | https://stackoverflow.com/a/43021059 | <p>Regular expressions are not supported in <code>.gitignore</code>, you can use globs only. To fix it, use <code>~*</code>, that will ignore anything starts with tilde. </p>
| <p>Regular expressions are not supported in <code>.gitignore</code>, you can use globs only. To fix it, use <code>~*</code>, that will ignore anything starts with tilde. </p> | 18, 119, 25056 | git, gitignore, regex | <h1>.gitignore - ignore file starting with ~</h1>
<p>To ignore any file starting with ~(tilde), I put following in gitignore file</p>
<pre><code>^~.*
</code></pre>
<p>But, it is not working for the file name starting with ~(eg. ~$ofession email.docx).</p>
<p>There is no issue with gitignore configuration setting as ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,594 | git | # .gitignore - ignore file starting with ~
To ignore any file starting with ~(tilde), I put following in gitignore file
```
^~.*
```
But, it is not working for the file name starting with ~(eg. ~$ofession email.docx).
There is no issue with gitignore configuration setting as other patterns are working well.
What i... | Regular expressions are not supported in `.gitignore`, you can use globs only. To fix it, use `~*`, that will ignore anything starts with tilde. |
41745601 | Offline use of Git | 13 | 2017-01-19 15:26:57 | <p>How can we use git offline if we have many files and do not have an internet connection? Or can we store our files in just a committed state? And does git have capacity to store files? If yes, then how much?</p>
| 31,839 | 6,743,905 | 2023-09-25 09:11:01 | 41,745,675 | 13 | 2017-01-19 15:30:00 | 6,364,595 | 2019-02-16 11:03:15 | https://stackoverflow.com/q/41745601 | https://stackoverflow.com/a/41745675 | <p>If you want to use git offline just install git, go to the root directory for your files and run <code>git init</code> to initialize the repository. You can then run <code>git add file_path</code>, <code>git commit -m "First commit"</code> etc.</p>
<p>The repository is stored under the <code>.git</code> directory t... | <p>If you want to use git offline just install git, go to the root directory for your files and run <code>git init</code> to initialize the repository. You can then run <code>git add file_path</code>, <code>git commit -m "First commit"</code> etc.</p> <p>The repository is stored under the <code>.git</code> directory t... | 119 | git | <h1>Offline use of Git</h1>
<p>How can we use git offline if we have many files and do not have an internet connection? Or can we store our files in just a committed state? And does git have capacity to store files? If yes, then how much?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,595 | git | # Offline use of Git
How can we use git offline if we have many files and do not have an internet connection? Or can we store our files in just a committed state? And does git have capacity to store files? If yes, then how much? | If you want to use git offline just install git, go to the root directory for your files and run `git init` to initialize the repository. You can then run `git add file_path`, `git commit -m "First commit"` etc.
The repository is stored under the `.git` directory that is created under the directory in which you run `g... |
35522047 | PEP440 compliant AND git describe info available from deployed package | 13 | 2016-02-20 10:38:13 | <p>I would like to use use a <em>Version Identification</em> compliant with PEP440 but with a way to include the git information:</p>
<pre><code>$ git describe --long
4.1-202-gab0f789
</code></pre>
<p>In PEP 440 there is a chapter about <a href="http://legacy.python.org/dev/peps/pep-0440/#dvcs-based-version-labels" r... | 3,081 | 3,313,834 | 2021-04-12 20:19:39 | 35,522,080 | 13 | 2016-02-20 10:40:29 | 100,297 | 2021-04-12 20:19:39 | https://stackoverflow.com/q/35522047 | https://stackoverflow.com/a/35522080 | <p>That section tells you <strong>not</strong> to use the hash:</p>
<blockquote>
<p>As hashes cannot be ordered reliably <strong>such versions are not permitted in the public version field.</strong></p>
</blockquote>
<p>Emphasis mine.</p>
<p>They offer <code>.devN</code> as an alternative. If you are going to release d... | <p>That section tells you <strong>not</strong> to use the hash:</p> <blockquote> <p>As hashes cannot be ordered reliably <strong>such versions are not permitted in the public version field.</strong></p> </blockquote> <p>Emphasis mine.</p> <p>They offer <code>.devN</code> as an alternative. If you are going to release d... | 16, 119, 1066 | continuous-integration, git, python | <h1>PEP440 compliant AND git describe info available from deployed package</h1>
<p>I would like to use use a <em>Version Identification</em> compliant with PEP440 but with a way to include the git information:</p>
<pre><code>$ git describe --long
4.1-202-gab0f789
</code></pre>
<p>In PEP 440 there is a chapter about <... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,596 | git | # PEP440 compliant AND git describe info available from deployed package
I would like to use use a *Version Identification* compliant with PEP440 but with a way to include the git information:
```
$ git describe --long
4.1-202-gab0f789
```
In PEP 440 there is a chapter about [dvcs](http://legacy.python.org/dev/peps/... | That section tells you **not** to use the hash:
> As hashes cannot be ordered reliably **such versions are not permitted in the public version field.**
Emphasis mine.
They offer `.devN` as an alternative. If you are going to release developer versions from a git repository, number them, so `.dev0`, `.dev1`, etc. You... |
35356290 | How to change the message of an old (local) commit? | 13 | 2016-02-12 06:36:52 | <p>My commit is looking like this:</p>
<pre><code>alex@alex-M52AD-M12AD-A-F-K31AD:~/node/project$ git log
commit 050e4417634300e724b8e0c29bb8b7a240a9a996
Author: alexcheninfo <alexchen.info@gmail.com>
Date: Fri Feb 12 12:55:38 2016 +0800
Rename documents
commit 637bd5ac976118d7e0fb3bf5f2bab950ce0ebb66
Aut... | 8,639 | 5,815,147 | 2023-10-30 22:04:34 | 35,356,364 | 13 | 2016-02-12 06:42:21 | 69,755 | 2016-02-12 06:42:21 | https://stackoverflow.com/q/35356290 | https://stackoverflow.com/a/35356364 | <p>Interactive rebase is frequently the easiest way: <a href="https://git-scm.com/docs/git-rebase" rel="noreferrer"><code>git rebase -i 637bd5ac^</code></a></p>
<p>This will open up your editor with each commit since the commit mentioned on a line. For each commit, you can choose how you want to modify it; pick (keep ... | <p>Interactive rebase is frequently the easiest way: <a href="https://git-scm.com/docs/git-rebase" rel="noreferrer"><code>git rebase -i 637bd5ac^</code></a></p> <p>This will open up your editor with each commit since the commit mentioned on a line. For each commit, you can choose how you want to modify it; pick (keep ... | 119 | git | <h1>How to change the message of an old (local) commit?</h1>
<p>My commit is looking like this:</p>
<pre><code>alex@alex-M52AD-M12AD-A-F-K31AD:~/node/project$ git log
commit 050e4417634300e724b8e0c29bb8b7a240a9a996
Author: alexcheninfo <alexchen.info@gmail.com>
Date: Fri Feb 12 12:55:38 2016 +0800
Rename d... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,597 | git | # How to change the message of an old (local) commit?
My commit is looking like this:
```
alex@alex-M52AD-M12AD-A-F-K31AD:~/node/project$ git log
commit 050e4417634300e724b8e0c29bb8b7a240a9a996
Author: alexcheninfo <alexchen.info@gmail.com>
Date: Fri Feb 12 12:55:38 2016 +0800
Rename documents
commit 637bd5ac... | Interactive rebase is frequently the easiest way: [`git rebase -i 637bd5ac^`](https://git-scm.com/docs/git-rebase)
This will open up your editor with each commit since the commit mentioned on a line. For each commit, you can choose how you want to modify it; pick (keep it as is), edit, reword (edit just the commit mes... |
28244959 | Using git merge, how can I merge a bugfix into multiple long-term branches? | 13 | 2015-01-30 21:31:34 | <p>Recently at work, we've switched from using SVN to using git. We have to maintain multiple versions of our software, and we had them setup as branches before. So after using <code>git svn clone</code>, we ended up with 4 branches: master, 5.0, 5.1, and 5.2.</p>
<p>Note: We use master as our development branch. 5.0,... | 6,966 | 1,408,717 | 2015-02-02 17:51:58 | 28,245,160 | 13 | 2015-01-30 21:47:04 | 3,177,124 | 2015-01-30 21:52:20 | https://stackoverflow.com/q/28244959 | https://stackoverflow.com/a/28245160 | <p>We moved a very large project from SVN to git a few years ago. This is the question I kept coming up with.</p>
<p>First of all (this bit isn't an answer to your question, it's an answer to the question "why are you asking the question?"), read this:
<a href="http://nvie.com/posts/a-successful-git-branching-model/... | <p>We moved a very large project from SVN to git a few years ago. This is the question I kept coming up with.</p> <p>First of all (this bit isn't an answer to your question, it's an answer to the question "why are you asking the question?"), read this: <a href="http://nvie.com/posts/a-successful-git-branching-model/... | 119, 717 | git, merge | <h1>Using git merge, how can I merge a bugfix into multiple long-term branches?</h1>
<p>Recently at work, we've switched from using SVN to using git. We have to maintain multiple versions of our software, and we had them setup as branches before. So after using <code>git svn clone</code>, we ended up with 4 branches: m... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,598 | git | # Using git merge, how can I merge a bugfix into multiple long-term branches?
Recently at work, we've switched from using SVN to using git. We have to maintain multiple versions of our software, and we had them setup as branches before. So after using `git svn clone`, we ended up with 4 branches: master, 5.0, 5.1, and... | We moved a very large project from SVN to git a few years ago. This is the question I kept coming up with.
First of all (this bit isn't an answer to your question, it's an answer to the question "why are you asking the question?"), read this:
<http://nvie.com/posts/a-successful-git-branching-model/>
and accept for the... |
25384469 | When a git commit has multiple parents, what are the stats calculated against? | 13 | 2014-08-19 13:18:35 | <p>When a commit has multiple parents, like <a href="https://github.com/ginatrapani/ThinkUp/commit/4cd713e722827ea3c0858e3a2f609f6da2c31e25" rel="noreferrer">this one</a>, we see that it has <code>4 additions</code> and <code>4 deletions</code>. My question is compared to what? Are the additions and deletions compared ... | 10,007 | 239,879 | 2023-06-05 05:27:53 | 25,519,606 | 13 | 2014-08-27 05:35:12 | 6,309 | 2023-06-05 05:27:53 | https://stackoverflow.com/q/25384469 | https://stackoverflow.com/a/25519606 | <p>It is a three-way merge between:</p>
<ul>
<li>the common ancestor of both parents (<a href="http://git-scm.com/docs/git-merge-base" rel="nofollow noreferrer"><code>git merge-base @^1 @^2</code></a>, <code>^1</code> being the first parent, <code>^2</code> being the second parent of HEAD: see "<a href="http://git... | <p>It is a three-way merge between:</p> <ul> <li>the common ancestor of both parents (<a href="http://git-scm.com/docs/git-merge-base" rel="nofollow noreferrer"><code>git merge-base @^1 @^2</code></a>, <code>^1</code> being the first parent, <code>^2</code> being the second parent of HEAD: see "<a href="http://git... | 119 | git | <h1>When a git commit has multiple parents, what are the stats calculated against?</h1>
<p>When a commit has multiple parents, like <a href="https://github.com/ginatrapani/ThinkUp/commit/4cd713e722827ea3c0858e3a2f609f6da2c31e25" rel="noreferrer">this one</a>, we see that it has <code>4 additions</code> and <code>4 dele... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,599 | git | # When a git commit has multiple parents, what are the stats calculated against?
When a commit has multiple parents, like [this one](https://github.com/ginatrapani/ThinkUp/commit/4cd713e722827ea3c0858e3a2f609f6da2c31e25), we see that it has `4 additions` and `4 deletions`. My question is compared to what? Are the addi... | It is a three-way merge between:
- the common ancestor of both parents ([`git merge-base @^1 @^2`](http://git-scm.com/docs/git-merge-base), `^1` being the first parent, `^2` being the second parent of HEAD: see "[Ancestry Reference](http://git-scm.com/book/en/Git-Tools-Revision-Selection#Ancestry-References)".)
- the ... |
23431621 | Extending the Damm algorithm to base-32 | 13 | 2014-05-02 15:23:36 | <p>I'd like to use the <a href="https://en.wikipedia.org/wiki/Damm_algorithm">Damm algorithm</a> to generate check digits for codes with a 32-character alphabet. The algorithm itself is easily applied to any base (except 2 or 6). The difficulty is the necessary look-up table, which must be a totally anti-symmetric qu... | 2,847 | 8,355 | 2015-08-21 14:28:13 | 23,433,934 | 13 | 2014-05-02 17:41:14 | 411,022 | 2014-05-03 20:14:32 | https://stackoverflow.com/q/23431621 | https://stackoverflow.com/a/23433934 | <p>Inspired by David Eisenstat's answer (and the <a href="http://archiv.ub.uni-marburg.de/diss/z2004/0516/pdf/dhmd.pdf">original dissertation by Damm</a> that he cites), here's a simple Python routine to calculate / verify a Damm checksum for any base 2<sup><em>n</em></sup> for 2 ≤ <em>n</em> ≤ 32:</p>
<pre cl... | <p>Inspired by David Eisenstat's answer (and the <a href="http://archiv.ub.uni-marburg.de/diss/z2004/0516/pdf/dhmd.pdf">original dissertation by Damm</a> that he cites), here's a simple Python routine to calculate / verify a Damm checksum for any base 2<sup><em>n</em></sup> for 2 ≤ <em>n</em> ≤ 32:</p> <pre cl... | 248, 24792 | algorithm, check-digit | <h1>Extending the Damm algorithm to base-32</h1>
<p>I'd like to use the <a href="https://en.wikipedia.org/wiki/Damm_algorithm">Damm algorithm</a> to generate check digits for codes with a 32-character alphabet. The algorithm itself is easily applied to any base (except 2 or 6). The difficulty is the necessary look-up... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,600 | git | # Extending the Damm algorithm to base-32
I'd like to use the [Damm algorithm](https://en.wikipedia.org/wiki/Damm_algorithm) to generate check digits for codes with a 32-character alphabet. The algorithm itself is easily applied to any base (except 2 or 6). The difficulty is the necessary look-up table, which must be ... | Inspired by David Eisenstat's answer (and the [original dissertation by Damm](http://archiv.ub.uni-marburg.de/diss/z2004/0516/pdf/dhmd.pdf) that he cites), here's a simple Python routine to calculate / verify a Damm checksum for any base 2*n* for 2 ≤ *n* ≤ 32:
```
# reduction bitmasks for GF(2^n), 2 <= n <= 32
masks =... |
20222730 | Git: How to merge upstream changes without causing a merge commit? | 13 | 2013-11-26 16:35:49 | <p>I have (commits were created in alphabetical order)</p>
<pre class="lang-none prettyprint-override"><code>origin/topic A-B-C-D-W-X
topic A-B-C-D-Y-Z
</code></pre>
<p>Is there a way i can get my <code>topic</code> branch to look like</p>
<pre class="lang-none prettyprint-override"><code>A-B-C-D-W-X-Y-Z
<... | 5,261 | 633,183 | 2014-04-24 17:57:39 | 20,223,182 | 13 | 2013-11-26 16:54:36 | 421,089 | 2013-11-26 16:54:36 | https://stackoverflow.com/q/20222730 | https://stackoverflow.com/a/20223182 | <p>You can try with:</p>
<pre><code>git checkout topic
git pull --rebase origin topic
</code></pre>
<p>Check the <a href="http://git-scm.com/docs/git-pull" rel="noreferrer">fetch man page</a> notes about the rebase option.</p>
<p>I would recommend using something like <a href="https://github.com/geelen/git-smart" re... | <p>You can try with:</p> <pre><code>git checkout topic git pull --rebase origin topic </code></pre> <p>Check the <a href="http://git-scm.com/docs/git-pull" rel="noreferrer">fetch man page</a> notes about the rebase option.</p> <p>I would recommend using something like <a href="https://github.com/geelen/git-smart" re... | 119, 28897, 29934, 78810 | git, git-cherry-pick, git-merge, git-rebase | <h1>Git: How to merge upstream changes without causing a merge commit?</h1>
<p>I have (commits were created in alphabetical order)</p>
<pre class="lang-none prettyprint-override"><code>origin/topic A-B-C-D-W-X
topic A-B-C-D-Y-Z
</code></pre>
<p>Is there a way i can get my <code>topic</code> branch to look l... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,601 | git | # Git: How to merge upstream changes without causing a merge commit?
I have (commits were created in alphabetical order)
```
origin/topic A-B-C-D-W-X
topic A-B-C-D-Y-Z
```
Is there a way i can get my `topic` branch to look like
```
A-B-C-D-W-X-Y-Z
```
**without** introducing a merge commit?
---
Ordinar... | You can try with:
```
git checkout topic
git pull --rebase origin topic
```
Check the [fetch man page](http://git-scm.com/docs/git-pull) notes about the rebase option.
I would recommend using something like [git-smart](https://github.com/geelen/git-smart), which will do a fast forward (which is faster) when possible... |
19080093 | Why the combination of Maven with Git? | 13 | 2013-09-29 15:59:55 | <p>I started a job in a company where they use Maven in combination with Git. I haven't worked with Maven before and I hope my question isn't too stupid. Why should one use Maven in combination with Git? From what I read Maven has a local, a central and can have a remote repository where it can find it's dependencies. ... | 23,251 | 1,278,769 | 2015-09-10 09:53:41 | 19,080,624 | 13 | 2013-09-29 16:48:02 | 1,717,300 | 2013-09-29 16:48:02 | https://stackoverflow.com/q/19080093 | https://stackoverflow.com/a/19080624 | <p>I guess it would be <em>possible</em> to work with just Maven. It might even not be totally horrible. However, Maven is system for distributing <em>releases</em> (even if they are snapshots or whatever). It is a totally different tool, than what a version control software is. I guess you could say Maven is the just ... | <p>I guess it would be <em>possible</em> to work with just Maven. It might even not be totally horrible. However, Maven is system for distributing <em>releases</em> (even if they are snapshots or whatever). It is a totally different tool, than what a version control software is. I guess you could say Maven is the just ... | 17, 119, 41127 | git, java, maven | <h1>Why the combination of Maven with Git?</h1>
<p>I started a job in a company where they use Maven in combination with Git. I haven't worked with Maven before and I hope my question isn't too stupid. Why should one use Maven in combination with Git? From what I read Maven has a local, a central and can have a remote ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,602 | git | # Why the combination of Maven with Git?
I started a job in a company where they use Maven in combination with Git. I haven't worked with Maven before and I hope my question isn't too stupid. Why should one use Maven in combination with Git? From what I read Maven has a local, a central and can have a remote repositor... | I guess it would be *possible* to work with just Maven. It might even not be totally horrible. However, Maven is system for distributing *releases* (even if they are snapshots or whatever). It is a totally different tool, than what a version control software is. I guess you could say Maven is the just the "distributed"... |
14151775 | How do I set a pattern for git commit messages? | 13 | 2013-01-04 05:50:08 | <p>I want to restrict the people whoever commits to have a specific commit message format, how do I do that?</p>
<p>For example: <code>Pair_Name|Story_Number|Commit_Message</code></p>
| 13,949 | 1,052,480 | 2016-10-17 13:44:59 | 14,151,812 | 13 | 2013-01-04 05:53:27 | 89,391 | 2013-01-04 08:12:26 | https://stackoverflow.com/q/14151775 | https://stackoverflow.com/a/14151812 | <p>There is a <code>pre-commit-msg</code> or <code>commit-msg</code> hook, that you could use:</p>
<ul>
<li><a href="http://www.kernel.org/pub/software/scm/git/docs/githooks.html" rel="noreferrer">http://www.kernel.org/pub/software/scm/git/docs/githooks.html</a></li>
</ul>
<p>Git repos come with sample hooks, e.g. th... | <p>There is a <code>pre-commit-msg</code> or <code>commit-msg</code> hook, that you could use:</p> <ul> <li><a href="http://www.kernel.org/pub/software/scm/git/docs/githooks.html" rel="noreferrer">http://www.kernel.org/pub/software/scm/git/docs/githooks.html</a></li> </ul> <p>Git repos come with sample hooks, e.g. th... | 119 | git | <h1>How do I set a pattern for git commit messages?</h1>
<p>I want to restrict the people whoever commits to have a specific commit message format, how do I do that?</p>
<p>For example: <code>Pair_Name|Story_Number|Commit_Message</code></p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,603 | git | # How do I set a pattern for git commit messages?
I want to restrict the people whoever commits to have a specific commit message format, how do I do that?
For example: `Pair_Name|Story_Number|Commit_Message` | There is a `pre-commit-msg` or `commit-msg` hook, that you could use:
- <http://www.kernel.org/pub/software/scm/git/docs/githooks.html>
Git repos come with sample hooks, e.g. the sample `commit-msg` hook under `git/hooks/commit-msg.sample` catches duplicate Signed-off-by lines.
```
# This example catches duplicate S... |
6038829 | How to see what has been checked into git, but hasn't been committed to svn via dcommit? | 13 | 2011-05-18 01:06:13 | <p>I'm using git-svn. How can I get a list of what I've committed into git, but haven't yet committed to the SVN repository since the last <code>git svn dcommit</code>? That is, how can I verify what is about to be sent if I do a dcommit?</p>
| 1,972 | 147,937 | 2015-06-19 20:27:59 | 6,040,113 | 13 | 2011-05-18 05:05:39 | 223,092 | 2011-05-18 05:05:39 | https://stackoverflow.com/q/6038829 | https://stackoverflow.com/a/6040113 | <p>The <code>--dry-run</code> option for <code>git svn dcommit</code> is very useful for finding out exactly what will be committed to Subversion. In particular that has the properties that:</p>
<ul>
<li>It doesn't actually commit anything to Subversion</li>
<li>It tells you which diffs will be calculated to create n... | <p>The <code>--dry-run</code> option for <code>git svn dcommit</code> is very useful for finding out exactly what will be committed to Subversion. In particular that has the properties that:</p> <ul> <li>It doesn't actually commit anything to Subversion</li> <li>It tells you which diffs will be calculated to create n... | 63, 119, 5597, 6452 | commit, git, git-svn, svn | <h1>How to see what has been checked into git, but hasn't been committed to svn via dcommit?</h1>
<p>I'm using git-svn. How can I get a list of what I've committed into git, but haven't yet committed to the SVN repository since the last <code>git svn dcommit</code>? That is, how can I verify what is about to be sent if... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,605 | git | # How to see what has been checked into git, but hasn't been committed to svn via dcommit?
I'm using git-svn. How can I get a list of what I've committed into git, but haven't yet committed to the SVN repository since the last `git svn dcommit`? That is, how can I verify what is about to be sent if I do a dcommit? | The `--dry-run` option for `git svn dcommit` is very useful for finding out exactly what will be committed to Subversion. In particular that has the properties that:
- It doesn't actually commit anything to Subversion
- It tells you which diffs will be calculated to create new revisions in Subversion
- It tells you wh... |
1863393 | Using git to find first introduction of token on a specific line of a file | 13 | 2009-12-07 22:35:59 | <p>Let's say I have a file A.cpp, and I notice an error on line 15 of the file. Let's say the error is a "const" on a function that returns a pointer to a member variable, meaning using const on the function is technically correct but semantically wrong. I would like to discuss the semantics with the author who made th... | 3,870 | 14,069 | 2013-05-29 18:16:49 | 1,863,441 | 13 | 2009-12-07 22:43:09 | 225,540 | 2009-12-07 22:48:37 | https://stackoverflow.com/q/1863393 | https://stackoverflow.com/a/1863441 | <p><a href="http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html" rel="noreferrer">git bisect</a> is what you are looking for. With this command you can find quickly what commit introduced the const.</p>
<p>You start the process with <code>git bisect start</code>, then mark an old version without the const ... | <p><a href="http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html" rel="noreferrer">git bisect</a> is what you are looking for. With this command you can find quickly what commit introduced the const.</p> <p>You start the process with <code>git bisect start</code>, then mark an old version without the const ... | 119, 456, 21455 | blame, git, version-control | <h1>Using git to find first introduction of token on a specific line of a file</h1>
<p>Let's say I have a file A.cpp, and I notice an error on line 15 of the file. Let's say the error is a "const" on a function that returns a pointer to a member variable, meaning using const on the function is technically correct but s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,606 | git | # Using git to find first introduction of token on a specific line of a file
Let's say I have a file A.cpp, and I notice an error on line 15 of the file. Let's say the error is a "const" on a function that returns a pointer to a member variable, meaning using const on the function is technically correct but semantical... | [git bisect](http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html) is what you are looking for. With this command you can find quickly what commit introduced the const.
You start the process with `git bisect start`, then mark an old version without the const as good with git `bisect good` and and the curren... |
65731005 | Jgit throws java.io.IOException: Creating directories for /.config/jgit failed | 12 | 2021-01-15 05:35:35 | <p>Recently upgraded Jgit to 5.10.0.202012080955-r. After this, we are getting <code>IOException</code> after clone of a bare git repository. It doesn't seem to cause any visible functional impact so far, but its a cause of concern.
This issue is seen only in Kubernetes deployment not with Junit tests.
Is it a known is... | 9,542 | 1,441,374 | 2023-06-16 15:55:35 | 65,735,434 | 13 | 2021-01-15 11:38:35 | 1,441,374 | 2021-01-15 11:38:35 | https://stackoverflow.com/q/65731005 | https://stackoverflow.com/a/65735434 | <p>In this particular case Jgit is trying to create a configuration file at a path based on <code>XDG_CONFIG_HOME</code>.</p>
<p>If <code>XDG_CONFIG_HOME</code> is not set, it will be having default value <code>$HOME/.config</code>. This particular path is not accessible in my Kubernetes environment.</p>
<p>Changed <co... | <p>In this particular case Jgit is trying to create a configuration file at a path based on <code>XDG_CONFIG_HOME</code>.</p> <p>If <code>XDG_CONFIG_HOME</code> is not set, it will be having default value <code>$HOME/.config</code>. This particular path is not accessible in my Kubernetes environment.</p> <p>Changed <co... | 17, 119, 61058 | git, java, jgit | <h1>Jgit throws java.io.IOException: Creating directories for /.config/jgit failed</h1>
<p>Recently upgraded Jgit to 5.10.0.202012080955-r. After this, we are getting <code>IOException</code> after clone of a bare git repository. It doesn't seem to cause any visible functional impact so far, but its a cause of concern.... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,609 | git | # Jgit throws java.io.IOException: Creating directories for /.config/jgit failed
Recently upgraded Jgit to 5.10.0.202012080955-r. After this, we are getting `IOException` after clone of a bare git repository. It doesn't seem to cause any visible functional impact so far, but its a cause of concern.
This issue is seen ... | In this particular case Jgit is trying to create a configuration file at a path based on `XDG_CONFIG_HOME`.
If `XDG_CONFIG_HOME` is not set, it will be having default value `$HOME/.config`. This particular path is not accessible in my Kubernetes environment.
Changed `XDG_CONFIG_HOME` to point to appropriate path. Thu... |
56029523 | Git copy file from another branch without staging it | 12 | 2019-05-07 19:46:51 | <p>I've <a href="https://stackoverflow.com/questions/307579/how-do-i-copy-a-version-of-a-single-file-from-one-git-branch-to-another">found</a> how you can copy a file wholesale from one branch to another:</p>
<blockquote>
<p><strong>Edit</strong> please note, if you think this question is a duplicate of <a href="htt... | 4,036 | 151,841 | 2025-03-21 12:08:32 | 56,029,554 | 13 | 2019-05-07 19:48:38 | 2,437,508 | 2019-05-07 19:48:38 | https://stackoverflow.com/q/56029523 | https://stackoverflow.com/a/56029554 | <p>you could use git show and then redirect... it's not very elegant, though</p>
<pre><code>git show feature-B:directory/somefile.php > directory/somefile.php
</code></pre>
| <p>you could use git show and then redirect... it's not very elegant, though</p> <pre><code>git show feature-B:directory/somefile.php > directory/somefile.php </code></pre> | 119 | git | <h1>Git copy file from another branch without staging it</h1>
<p>I've <a href="https://stackoverflow.com/questions/307579/how-do-i-copy-a-version-of-a-single-file-from-one-git-branch-to-another">found</a> how you can copy a file wholesale from one branch to another:</p>
<blockquote>
<p><strong>Edit</strong> please n... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,610 | git | # Git copy file from another branch without staging it
I've [found](https://stackoverflow.com/questions/307579/how-do-i-copy-a-version-of-a-single-file-from-one-git-branch-to-another) how you can copy a file wholesale from one branch to another:
> **Edit** please note, if you think this question is a duplicate of [th... | you could use git show and then redirect... it's not very elegant, though
```
git show feature-B:directory/somefile.php > directory/somefile.php
``` |
54168977 | How to create a new branch from another repository? | 12 | 2019-01-13 12:41:49 | <p>I have a repository (<em>repo1</em>) with a master branch and another repository (<em>repo2</em>) with a master branch. Now I want to create a new branch in <em>repo1</em> from <em>repo2</em> with all commits history.</p>
<hr>
<p>My expected result:</p>
<pre><code>repo2
----
|
\
master
repo1
----------
| ... | 7,529 | 3,702,377 | 2019-01-13 13:31:27 | 54,169,350 | 13 | 2019-01-13 13:31:27 | 7,976,758 | 2019-01-13 13:31:27 | https://stackoverflow.com/q/54168977 | https://stackoverflow.com/a/54169350 | <pre><code>cd repo1
git fetch repo2 master:master-from-repo2
</code></pre>
<p>Remote branch <code>master</code> is fetched from <code>repo2</code> into local branch <code>master-from-repo2</code>.</p>
| <pre><code>cd repo1 git fetch repo2 master:master-from-repo2 </code></pre> <p>Remote branch <code>master</code> is fetched from <code>repo2</code> into local branch <code>master-from-repo2</code>.</p> | 119, 76220, 92175 | git, git-branch, git-repo | <h1>How to create a new branch from another repository?</h1>
<p>I have a repository (<em>repo1</em>) with a master branch and another repository (<em>repo2</em>) with a master branch. Now I want to create a new branch in <em>repo1</em> from <em>repo2</em> with all commits history.</p>
<hr>
<p>My expected result:</p>
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,611 | git | # How to create a new branch from another repository?
I have a repository (*repo1*) with a master branch and another repository (*repo2*) with a master branch. Now I want to create a new branch in *repo1* from *repo2* with all commits history.
---
My expected result:
```
repo2
----
|
\
master
repo1
----------
... | ```
cd repo1
git fetch repo2 master:master-from-repo2
```
Remote branch `master` is fetched from `repo2` into local branch `master-from-repo2`. |
49009212 | How to change TOC depth in R Bookdown (GitBook)? | 12 | 2018-02-27 12:53:38 | <p>I use <em>GitBook</em> format through <em>R</em> <em>bookdown</em>. I need to use at least four levels in the table of contents (TOC). The default is three. How can I change the depth of TOC?</p>
<hr>
<p>UPDATE</p>
<p>Now the toc-related contents of my <code>_output.yml</code> file look like this:</p>
<pre><code... | 3,804 | 4,783,029 | 2022-04-18 21:50:16 | 49,966,565 | 13 | 2018-04-22 13:40:51 | 3,612,030 | 2018-04-23 18:33:54 | https://stackoverflow.com/q/49009212 | https://stackoverflow.com/a/49966565 | <p>Try adding the following to your <code>_output.yml</code> file:</p>
<pre><code>bookdown::gitbook:
toc_depth: 2
</code></pre>
| <p>Try adding the following to your <code>_output.yml</code> file:</p> <pre><code>bookdown::gitbook: toc_depth: 2 </code></pre> | 4452, 105279, 119279 | bookdown, gitbook, r | <h1>How to change TOC depth in R Bookdown (GitBook)?</h1>
<p>I use <em>GitBook</em> format through <em>R</em> <em>bookdown</em>. I need to use at least four levels in the table of contents (TOC). The default is three. How can I change the depth of TOC?</p>
<hr>
<p>UPDATE</p>
<p>Now the toc-related contents of my <co... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,612 | git | # How to change TOC depth in R Bookdown (GitBook)?
I use *GitBook* format through *R* *bookdown*. I need to use at least four levels in the table of contents (TOC). The default is three. How can I change the depth of TOC?
---
UPDATE
Now the toc-related contents of my `_output.yml` file look like this:
```
bookdown... | Try adding the following to your `_output.yml` file:
```
bookdown::gitbook:
toc_depth: 2
``` |
48422349 | How to checkout git repo subdirectory into current directory? | 12 | 2018-01-24 12:20:09 | <p>There is a remote repo with directory structure:</p>
<pre><code>-directory1
-file1_1
-file1_2
...
-directory2
-file2_1
-file2_2
...
</code></pre>
<p>I have a folder on a web hosting with a custom name, say, "/path/public_html".</p>
<p>How do I set up git on the web hosting, so my "public_h... | 6,217 | 511,908 | 2018-02-07 16:30:28 | 48,547,390 | 13 | 2018-01-31 16:52:32 | 6,309 | 2018-01-31 16:52:32 | https://stackoverflow.com/q/48422349 | https://stackoverflow.com/a/48547390 | <p>You cannot clone directly <code>directory2</code> <em>content</em>, only <code>directory2</code> <em>and</em> its content, meaning you always have a <code>directory2/</code> folder on your disk.</p>
<p>If you want to see <code>directory2</code> content in <code>public_html</code> (meaning <em>not</em> <code>public_h... | <p>You cannot clone directly <code>directory2</code> <em>content</em>, only <code>directory2</code> <em>and</em> its content, meaning you always have a <code>directory2/</code> folder on your disk.</p> <p>If you want to see <code>directory2</code> content in <code>public_html</code> (meaning <em>not</em> <code>public_h... | 119 | git | <h1>How to checkout git repo subdirectory into current directory?</h1>
<p>There is a remote repo with directory structure:</p>
<pre><code>-directory1
-file1_1
-file1_2
...
-directory2
-file2_1
-file2_2
...
</code></pre>
<p>I have a folder on a web hosting with a custom name, say, "/path/public... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,613 | git | # How to checkout git repo subdirectory into current directory?
There is a remote repo with directory structure:
```
-directory1
-file1_1
-file1_2
...
-directory2
-file2_1
-file2_2
...
```
I have a folder on a web hosting with a custom name, say, "/path/public_html".
How do I set up git on t... | You cannot clone directly `directory2` *content*, only `directory2` *and* its content, meaning you always have a `directory2/` folder on your disk.
If you want to see `directory2` content in `public_html` (meaning *not* `public_html/directory2/...`), then you need a symlink.
That being said, you can still clone and c... |
38780693 | How can I git clone a repository with python, and get the progress of the clone process? | 12 | 2016-08-05 03:37:54 | <p>I'd like to be able to git clone a large repository using python, using some library, but importantly I'd like to be able to see the progress of the clone as it's happening. I tried pygit2 and GitPython, but they don't seem to show their progress. Is there another way? </p>
| 9,568 | 584,121 | 2020-09-17 12:46:39 | 38,780,917 | 13 | 2016-08-05 04:03:44 | 8,747 | 2016-08-05 04:12:29 | https://stackoverflow.com/q/38780693 | https://stackoverflow.com/a/38780917 | <p>You can use <a href="http://gitpython.readthedocs.io/en/stable/reference.html#git.remote.RemoteProgress" rel="noreferrer"><code>RemoteProgress</code></a> from <a href="http://gitpython.readthedocs.io/en/stable/" rel="noreferrer">GitPython</a>. Here is a crude example:</p>
<pre><code>import git
class Progress(git.r... | <p>You can use <a href="http://gitpython.readthedocs.io/en/stable/reference.html#git.remote.RemoteProgress" rel="noreferrer"><code>RemoteProgress</code></a> from <a href="http://gitpython.readthedocs.io/en/stable/" rel="noreferrer">GitPython</a>. Here is a crude example:</p> <pre><code>import git class Progress(git.r... | 16, 119 | git, python | <h1>How can I git clone a repository with python, and get the progress of the clone process?</h1>
<p>I'd like to be able to git clone a large repository using python, using some library, but importantly I'd like to be able to see the progress of the clone as it's happening. I tried pygit2 and GitPython, but they don't ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,615 | git | # How can I git clone a repository with python, and get the progress of the clone process?
I'd like to be able to git clone a large repository using python, using some library, but importantly I'd like to be able to see the progress of the clone as it's happening. I tried pygit2 and GitPython, but they don't seem to s... | You can use [`RemoteProgress`](http://gitpython.readthedocs.io/en/stable/reference.html#git.remote.RemoteProgress) from [GitPython](http://gitpython.readthedocs.io/en/stable/). Here is a crude example:
```
import git
class Progress(git.remote.RemoteProgress):
def update(self, op_code, cur_count, max_count=None, m... |
28237934 | Create private branch on remote repository in git | 12 | 2015-01-30 14:24:42 | <p>I would like to build specific flow on our company git. </p>
<ol>
<li>developer create a branch on his local machine and commit there some files.</li>
<li>dev push this branch to remote repo</li>
<li>Other devs cannot access to this branch</li>
<li>after few rounds off pushing dev decide to publish his changes.</li... | 20,261 | 182,393 | 2024-05-16 16:49:12 | 28,239,456 | 13 | 2015-01-30 15:41:37 | 4,511,455 | 2024-05-16 16:49:12 | https://stackoverflow.com/q/28237934 | https://stackoverflow.com/a/28239456 | <p>The flow that is used in my team is to have complete separate repositories for each team member in addition to origin on the main git server.</p>
<ol>
<li>Dev creates local branch on local machine and commits away</li>
<li>At the end of the day (or whenever is suitable) dev pushes to their private repo <code>git pus... | <p>The flow that is used in my team is to have complete separate repositories for each team member in addition to origin on the main git server.</p> <ol> <li>Dev creates local branch on local machine and commits away</li> <li>At the end of the day (or whenever is suitable) dev pushes to their private repo <code>git pus... | 119, 31678, 76220 | git, git-branch, remote-branch | <h1>Create private branch on remote repository in git</h1>
<p>I would like to build specific flow on our company git. </p>
<ol>
<li>developer create a branch on his local machine and commit there some files.</li>
<li>dev push this branch to remote repo</li>
<li>Other devs cannot access to this branch</li>
<li>after fe... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,619 | git | # Create private branch on remote repository in git
I would like to build specific flow on our company git.
1. developer create a branch on his local machine and commit there some files.
2. dev push this branch to remote repo
3. Other devs cannot access to this branch
4. after few rounds off pushing dev decide to pub... | The flow that is used in my team is to have complete separate repositories for each team member in addition to origin on the main git server.
1. Dev creates local branch on local machine and commits away
2. At the end of the day (or whenever is suitable) dev pushes to their private repo `git push jdoe-private my-cool-... |
9670302 | Commit directly to a bare repository | 12 | 2012-03-12 15:50:51 | <h2>Some Context</h2>
<h3>what this fits into</h3>
<p>A collaboration focused web application that offers git hosting (as <code>bare</code> repos)</p>
<h3>what we want to do</h3>
<p>Allow users to add a set of files directly to their existing repositories.</p>
<h2>My Question</h2>
<h3>Is there a tool or method to... | 7,694 | 101,855 | 2014-08-28 19:51:40 | 25,556,917 | 13 | 2014-08-28 19:51:40 | 622,060 | 2014-08-28 19:51:40 | https://stackoverflow.com/q/9670302 | https://stackoverflow.com/a/25556917 | <p>The <a href="http://git-scm.com/book/en/Git-Internals-Plumbing-and-Porcelain" rel="noreferrer">plumbing and porcelain</a> page sort of have an example of this, but I'll try to simplify it.</p>
<p>It seems bare repos still have an index, which can be manipulated and made into a commit. It's probably also possible to... | <p>The <a href="http://git-scm.com/book/en/Git-Internals-Plumbing-and-Porcelain" rel="noreferrer">plumbing and porcelain</a> page sort of have an example of this, but I'll try to simplify it.</p> <p>It seems bare repos still have an index, which can be manipulated and made into a commit. It's probably also possible to... | 119 | git | <h1>Commit directly to a bare repository</h1>
<h2>Some Context</h2>
<h3>what this fits into</h3>
<p>A collaboration focused web application that offers git hosting (as <code>bare</code> repos)</p>
<h3>what we want to do</h3>
<p>Allow users to add a set of files directly to their existing repositories.</p>
<h2>My Q... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,620 | git | # Commit directly to a bare repository
## Some Context
### what this fits into
A collaboration focused web application that offers git hosting (as `bare` repos)
### what we want to do
Allow users to add a set of files directly to their existing repositories.
## My Question
### Is there a tool or method to manual... | The [plumbing and porcelain](http://git-scm.com/book/en/Git-Internals-Plumbing-and-Porcelain) page sort of have an example of this, but I'll try to simplify it.
It seems bare repos still have an index, which can be manipulated and made into a commit. It's probably also possible to create tree object from scratch, but ... |
15973182 | Git - why are double dashes needed when running a command on a deleted file? | 12 | 2013-04-12 13:54:26 | <p>Consider a git repository, where a file was once deleted.</p>
<pre><code>git rm path/to/file
git commit -a -m"testing"
</code></pre>
<p>Ok, now I want to see the <code>git log</code> for the file, but I receive the classic error message:</p>
<pre><code>git log path/to/file
fatal: ambiguous argument 'path/to/file'... | 12,681 | 1,846,914 | 2013-04-12 15:39:02 | 15,974,961 | 13 | 2013-04-12 15:12:49 | 520,162 | 2013-04-12 15:12:49 | https://stackoverflow.com/q/15973182 | https://stackoverflow.com/a/15974961 | <p><code>git log</code> could be used on files as well as on branches, tags and so on.</p>
<p>Assume you have a folder called <code>a/b/c</code>, you'll get the commits for this <strong>folder</strong> using</p>
<pre><code>git log a/b/c
</code></pre>
<p>That's fine.</p>
<p>You could also have a branch called <code>... | <p><code>git log</code> could be used on files as well as on branches, tags and so on.</p> <p>Assume you have a folder called <code>a/b/c</code>, you'll get the commits for this <strong>folder</strong> using</p> <pre><code>git log a/b/c </code></pre> <p>That's fine.</p> <p>You could also have a branch called <code>... | 119, 47913 | git, git-log | <h1>Git - why are double dashes needed when running a command on a deleted file?</h1>
<p>Consider a git repository, where a file was once deleted.</p>
<pre><code>git rm path/to/file
git commit -a -m"testing"
</code></pre>
<p>Ok, now I want to see the <code>git log</code> for the file, but I receive the classic error ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,622 | git | # Git - why are double dashes needed when running a command on a deleted file?
Consider a git repository, where a file was once deleted.
```
git rm path/to/file
git commit -a -m"testing"
```
Ok, now I want to see the `git log` for the file, but I receive the classic error message:
```
git log path/to/file
fatal: am... | `git log` could be used on files as well as on branches, tags and so on.
Assume you have a folder called `a/b/c`, you'll get the commits for this **folder** using
```
git log a/b/c
```
That's fine.
You could also have a branch called `d/e/f`. You'll get the commits for this **branch** using
```
git log d/e/f
```
... |
14549415 | Difference between git clean and system rm | 12 | 2013-01-27 16:26:18 | <p>What is the difference between:</p>
<pre><code>git clean -f temp1.txt
</code></pre>
<p>and </p>
<pre><code>rm temp1.txt
</code></pre>
<p>Git doc says:</p>
<p><code>git-clean</code> - Remove untracked files from the working tree</p>
<p>So what is really the point of doing this instead of only the system command... | 2,649 | 1,686,113 | 2013-01-27 17:01:06 | 14,549,431 | 13 | 2013-01-27 16:28:33 | 50,079 | 2013-01-27 16:28:33 | https://stackoverflow.com/q/14549415 | https://stackoverflow.com/a/14549431 | <p><code>rm</code> will delete the file no matter what. <code>git-clean</code> will only delete it if it's actually untracked. And of course <code>git-clean</code> also accepts arguments that customize its behavior in a repo-aware manner (e.g. <code>-x</code>).</p>
| <p><code>rm</code> will delete the file no matter what. <code>git-clean</code> will only delete it if it's actually untracked. And of course <code>git-clean</code> also accepts arguments that customize its behavior in a repo-aware manner (e.g. <code>-x</code>).</p> | 119 | git | <h1>Difference between git clean and system rm</h1>
<p>What is the difference between:</p>
<pre><code>git clean -f temp1.txt
</code></pre>
<p>and </p>
<pre><code>rm temp1.txt
</code></pre>
<p>Git doc says:</p>
<p><code>git-clean</code> - Remove untracked files from the working tree</p>
<p>So what is really the po... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,623 | git | # Difference between git clean and system rm
What is the difference between:
```
git clean -f temp1.txt
```
and
```
rm temp1.txt
```
Git doc says:
`git-clean` - Remove untracked files from the working tree
So what is really the point of doing this instead of only the system command? | `rm` will delete the file no matter what. `git-clean` will only delete it if it's actually untracked. And of course `git-clean` also accepts arguments that customize its behavior in a repo-aware manner (e.g. `-x`). |
14243977 | Git: How to properly merge two functional and quite different branches? | 12 | 2013-01-09 18:28:47 | <p>Imagine a situation where you have two branches of the same project, with one part of the first branch dramatically refactored over the other one. But for a while you need to keep both branches functional, so you are doing bug fixes and crucial feature additions to both of them, sometimes in a not symmetrical way. A... | 5,737 | 189,673 | 2013-01-25 08:48:37 | 14,518,201 | 13 | 2013-01-25 08:42:39 | 189,673 | 2013-01-25 08:48:37 | https://stackoverflow.com/q/14243977 | https://stackoverflow.com/a/14518201 | <p>Since the task was to simply use another branch instead of <code>master</code>, you can simply remove <code>master</code> branch completely or rename it to let's say - <code>legacy</code>, then take another branch and rename it to <code>master</code>. That's it. Here are actual commands that you might need to execut... | <p>Since the task was to simply use another branch instead of <code>master</code>, you can simply remove <code>master</code> branch completely or rename it to let's say - <code>legacy</code>, then take another branch and rename it to <code>master</code>. That's it. Here are actual commands that you might need to execut... | 119, 28897, 29934 | git, git-merge, git-rebase | <h1>Git: How to properly merge two functional and quite different branches?</h1>
<p>Imagine a situation where you have two branches of the same project, with one part of the first branch dramatically refactored over the other one. But for a while you need to keep both branches functional, so you are doing bug fixes and... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,624 | git | # Git: How to properly merge two functional and quite different branches?
Imagine a situation where you have two branches of the same project, with one part of the first branch dramatically refactored over the other one. But for a while you need to keep both branches functional, so you are doing bug fixes and crucial ... | Since the task was to simply use another branch instead of `master`, you can simply remove `master` branch completely or rename it to let's say - `legacy`, then take another branch and rename it to `master`. That's it. Here are actual commands that you might need to execute to achieve the goal locally and on GitHub:
`... |
11382774 | Interactive Rebase of merged branch | 12 | 2012-07-08 11:28:19 | <p>I'm using git and I'm getting to this state:</p>
<pre><code> X --- Y --------- M1 -------- M2 (my-feature)
/ / /
/ / /
a --- b --- c --- d --- e --- f (stable)
</code></pre>
<p>This happen when we work on 'my-feature' branch for more than a day.
... | 6,920 | 355,401 | 2019-06-13 20:22:58 | 11,384,473 | 13 | 2012-07-08 15:51:06 | 877,115 | 2019-06-13 20:22:58 | https://stackoverflow.com/q/11382774 | https://stackoverflow.com/a/11384473 | <p>If the merge conflicts are identical, this is a perfect use case for <code>git rerere</code>, one of the most useful (albeit lesser-known) commands in git. From the man pages:</p>
<blockquote>
<p>In a workflow employing relatively long lived topic branches, the developer sometimes needs to resolve the same confli... | <p>If the merge conflicts are identical, this is a perfect use case for <code>git rerere</code>, one of the most useful (albeit lesser-known) commands in git. From the man pages:</p> <blockquote> <p>In a workflow employing relatively long lived topic branches, the developer sometimes needs to resolve the same confli... | 119, 29934 | git, git-rebase | <h1>Interactive Rebase of merged branch</h1>
<p>I'm using git and I'm getting to this state:</p>
<pre><code> X --- Y --------- M1 -------- M2 (my-feature)
/ / /
/ / /
a --- b --- c --- d --- e --- f (stable)
</code></pre>
<p>This happen when we work... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,625 | git | # Interactive Rebase of merged branch
I'm using git and I'm getting to this state:
```
X --- Y --------- M1 -------- M2 (my-feature)
/ / /
/ / /
a --- b --- c --- d --- e --- f (stable)
```
This happen when we work on 'my-feature' branch for more ... | If the merge conflicts are identical, this is a perfect use case for `git rerere`, one of the most useful (albeit lesser-known) commands in git. From the man pages:
> In a workflow employing relatively long lived topic branches, the developer sometimes needs to resolve the same conflicts over and over again until the
... |
11326301 | msysgit broken from 1.7.11? | 12 | 2012-07-04 09:32:00 | <p>After updating msysgit to 1.7.11, I get the following error when calling git-svn:</p>
<pre><code>$ git svn rebase
Can't locate Git/SVN/Editor.pm in @INC (@INC contains: /lib
/usr/lib/perl5/5.8.8/msys
/usr/lib/perl5/5.8.8
/usr/lib/perl5/site_perl/5.8.8/msys
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl .)... | 2,931 | 520,162 | 2012-09-18 13:27:22 | 11,326,520 | 13 | 2012-07-04 09:44:43 | 520,162 | 2012-09-18 13:27:22 | https://stackoverflow.com/q/11326301 | https://stackoverflow.com/a/11326520 | <p><strong>Update</strong></p>
<p>Seems like this issue is fixed in the meanwhile. Keeping original answer for reference.</p>
<hr>
<p><strong>Original answer:</strong></p>
<p>After doing a little research, I found this issue: <a href="https://github.com/msysgit/msysgit/issues/32" rel="nofollow noreferrer">https://g... | <p><strong>Update</strong></p> <p>Seems like this issue is fixed in the meanwhile. Keeping original answer for reference.</p> <hr> <p><strong>Original answer:</strong></p> <p>After doing a little research, I found this issue: <a href="https://github.com/msysgit/msysgit/issues/32" rel="nofollow noreferrer">https://g... | 6452, 21628 | git-svn, msysgit | <h1>msysgit broken from 1.7.11?</h1>
<p>After updating msysgit to 1.7.11, I get the following error when calling git-svn:</p>
<pre><code>$ git svn rebase
Can't locate Git/SVN/Editor.pm in @INC (@INC contains: /lib
/usr/lib/perl5/5.8.8/msys
/usr/lib/perl5/5.8.8
/usr/lib/perl5/site_perl/5.8.8/msys
/usr/lib/perl5/site_p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,626 | git | # msysgit broken from 1.7.11?
After updating msysgit to 1.7.11, I get the following error when calling git-svn:
```
$ git svn rebase
Can't locate Git/SVN/Editor.pm in @INC (@INC contains: /lib
/usr/lib/perl5/5.8.8/msys
/usr/lib/perl5/5.8.8
/usr/lib/perl5/site_perl/5.8.8/msys
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/p... | **Update**
Seems like this issue is fixed in the meanwhile. Keeping original answer for reference.
---
**Original answer:**
After doing a little research, I found this issue: <https://github.com/msysgit/msysgit/issues/32>
Obviously the bug is already known.
Meanwhile, I help myself by manually downloading the mis... |
312055 | How do I fix missing git remote details? | 12 | 2008-11-23 02:54:34 | <p>Some repository clones I have allow me to do this:</p>
<pre><code>% git pull
% git push
</code></pre>
<p>But other repositories require me to type:</p>
<pre><code>% git pull origin master
% git push origin master
</code></pre>
<p>I think I am missing something in the latter case - does anyone know what is (not) ... | 6,051 | 14,356 | 2008-12-28 02:44:03 | 312,061 | 13 | 2008-11-23 02:59:13 | 3,415 | 2008-11-23 18:25:40 | https://stackoverflow.com/q/312055 | https://stackoverflow.com/a/312061 | <p>If you cd into your repository directory and then open up your <strong>.git/config</strong> file in an editor.</p>
<p>Append this to the end of the file:</p>
<pre><code>[branch "master"]
remote = origin
merge = refs/heads/master
</code></pre>
<p>This is pretty much just an alias so git knows by default ... | <p>If you cd into your repository directory and then open up your <strong>.git/config</strong> file in an editor.</p> <p>Append this to the end of the file:</p> <pre><code>[branch "master"] remote = origin merge = refs/heads/master </code></pre> <p>This is pretty much just an alias so git knows by default ... | 119, 7330 | git, repository | <h1>How do I fix missing git remote details?</h1>
<p>Some repository clones I have allow me to do this:</p>
<pre><code>% git pull
% git push
</code></pre>
<p>But other repositories require me to type:</p>
<pre><code>% git pull origin master
% git push origin master
</code></pre>
<p>I think I am missing something in... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,628 | git | # How do I fix missing git remote details?
Some repository clones I have allow me to do this:
```
% git pull
% git push
```
But other repositories require me to type:
```
% git pull origin master
% git push origin master
```
I think I am missing something in the latter case - does anyone know what is (not) going o... | If you cd into your repository directory and then open up your **.git/config** file in an editor.
Append this to the end of the file:
```
[branch "master"]
remote = origin
merge = refs/heads/master
```
This is pretty much just an alias so git knows by default to pull from origin master. |
47345199 | Not able to start feature branch by selecting commit id option in SourceTree | 11 | 2017-11-17 07:13:53 | <p>I'm working on implementing Git Flow branching strategy in my company and for that I'm testing all possible options which is provided in SourceTree GitFlow.</p>
<p>Two problems I've faced till now:</p>
<ol>
<li><p>I'm trying to start a new feature branch by selecting a specified commit with value but its failing w... | 9,857 | 1,652,883 | 2023-08-01 07:30:06 | 50,485,027 | 13 | 2018-05-23 09:45:24 | 4,337,413 | 2019-05-21 10:11:09 | https://stackoverflow.com/q/47345199 | https://stackoverflow.com/a/50485027 | <p>Open terminal</p>
<pre><code>git branch release/yourReleaseName 43331988a3b86cc7ece4d323e8ec578c65437e8847
git flow finish yourReleaseName
</code></pre>
<p>If you're looking for the long string, you can get it in various ways, one is to open git flow, start release, check from specific commit, select your commit,... | <p>Open terminal</p> <pre><code>git branch release/yourReleaseName 43331988a3b86cc7ece4d323e8ec578c65437e8847 git flow finish yourReleaseName </code></pre> <p>If you're looking for the long string, you can get it in various ways, one is to open git flow, start release, check from specific commit, select your commit,... | 119, 40701, 64339, 90056 | atlassian-sourcetree, feature-branch, git, git-flow | <h1>Not able to start feature branch by selecting commit id option in SourceTree</h1>
<p>I'm working on implementing Git Flow branching strategy in my company and for that I'm testing all possible options which is provided in SourceTree GitFlow.</p>
<p>Two problems I've faced till now:</p>
<ol>
<li><p>I'm trying to s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,632 | git | # Not able to start feature branch by selecting commit id option in SourceTree
I'm working on implementing Git Flow branching strategy in my company and for that I'm testing all possible options which is provided in SourceTree GitFlow.
Two problems I've faced till now:
1. I'm trying to start a new feature branch by ... | Open terminal
```
git branch release/yourReleaseName 43331988a3b86cc7ece4d323e8ec578c65437e8847
git flow finish yourReleaseName
```
If you're looking for the long string, you can get it in various ways, one is to open git flow, start release, check from specific commit, select your commit, and copy and paste to note... |
48871669 | Git merge not merging all files | 11 | 2018-02-19 17:53:49 | <p>I am having a real tough time using git.</p>
<p>I have a branch <code>A</code> and a branch <code>B</code>. I want to merge branch <code>A</code> into branch <code>B</code>. I am currently on branch <code>B</code> and I used the following command:</p>
<p><code>git merge A</code>.</p>
<p>Now when I run <code>git s... | 20,470 | 9,328,545 | 2018-02-19 19:12:20 | 48,872,722 | 13 | 2018-02-19 19:12:20 | 1,256,452 | 2018-02-19 19:12:20 | https://stackoverflow.com/q/48871669 | https://stackoverflow.com/a/48872722 | <p>Comparing the two branch tip commits is the wrong thing to do, because that's not what <code>git merge</code> does.</p>
<p>To see what files each of you changed, you must first find the commit that branches <code>A</code> and <code>B</code> most recently <em>shared:</em></p>
<pre><code> o--o <-- b... | <p>Comparing the two branch tip commits is the wrong thing to do, because that's not what <code>git merge</code> does.</p> <p>To see what files each of you changed, you must first find the commit that branches <code>A</code> and <code>B</code> most recently <em>shared:</em></p> <pre><code> o--o <-- b... | 119 | git | <h1>Git merge not merging all files</h1>
<p>I am having a real tough time using git.</p>
<p>I have a branch <code>A</code> and a branch <code>B</code>. I want to merge branch <code>A</code> into branch <code>B</code>. I am currently on branch <code>B</code> and I used the following command:</p>
<p><code>git merge A</... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,633 | git | # Git merge not merging all files
I am having a real tough time using git.
I have a branch `A` and a branch `B`. I want to merge branch `A` into branch `B`. I am currently on branch `B` and I used the following command:
`git merge A`.
Now when I run `git status`, I see that I am ahead by two commits and when I look... | Comparing the two branch tip commits is the wrong thing to do, because that's not what `git merge` does.
To see what files each of you changed, you must first find the commit that branches `A` and `B` most recently *shared:*
```
o--o <-- branch-B
/
...--o--o--*
\
o-... |
37399028 | Can git status be made to mention the stash? | 11 | 2016-05-23 19:29:05 | <p>I tend to forget that I had stashed some changes. I'd like to see stash mentioned in <code>git status</code> output, when the stash is not empty. Is there a way to get <code>git status</code> do this?</p>
| 684 | 189,186 | 2017-12-30 20:17:39 | 48,037,539 | 13 | 2017-12-30 20:17:39 | 2,799,191 | 2017-12-30 20:17:39 | https://stackoverflow.com/q/37399028 | https://stackoverflow.com/a/48037539 | <p><a href="https://git-scm.com/docs/git-status#git-status---show-stash" rel="noreferrer">This is now a built-in option</a> in <code>git status</code>, so you can just do:</p>
<pre><code>[status]
showStash = true
</code></pre>
<p>If you're not comfortable editing your git config file, you can do </p>
<pre><code>gi... | <p><a href="https://git-scm.com/docs/git-status#git-status---show-stash" rel="noreferrer">This is now a built-in option</a> in <code>git status</code>, so you can just do:</p> <pre><code>[status] showStash = true </code></pre> <p>If you're not comfortable editing your git config file, you can do </p> <pre><code>gi... | 119 | git | <h1>Can git status be made to mention the stash?</h1>
<p>I tend to forget that I had stashed some changes. I'd like to see stash mentioned in <code>git status</code> output, when the stash is not empty. Is there a way to get <code>git status</code> do this?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,635 | git | # Can git status be made to mention the stash?
I tend to forget that I had stashed some changes. I'd like to see stash mentioned in `git status` output, when the stash is not empty. Is there a way to get `git status` do this? | [This is now a built-in option](https://git-scm.com/docs/git-status#git-status---show-stash) in `git status`, so you can just do:
```
[status]
showStash = true
```
If you're not comfortable editing your git config file, you can do
```
git config --global status.showStash true
``` |
47401615 | SCM URL of local GIT repo | 11 | 2017-11-20 21:43:48 | <p>I am trying to test mvn release plugin with my local git repo . I am getting error
<strong>No SCM URL was provided to perform the release from</strong> even though parent pom has following detail</p>
<pre><code><scm>
<url>scm:git:file://localhost/d/Research/Research.git</url>
<connecti... | 9,550 | 4,802,676 | 2023-05-12 07:40:05 | 47,418,020 | 13 | 2017-11-21 16:30:30 | 4,802,676 | 2023-05-12 07:40:05 | https://stackoverflow.com/q/47401615 | https://stackoverflow.com/a/47418020 | <p>Finally managed to get it working . As I am on windows I used below scm tag</p>
<pre><code><scm>
<url>scm:git:file://d:/Research/.git</url>
<connection>scm:git:file://d:/Research/.git</connection>
<developerConnection>scm:git:file://d:/Research/.git</developerConnection&g... | <p>Finally managed to get it working . As I am on windows I used below scm tag</p> <pre><code><scm> <url>scm:git:file://d:/Research/.git</url> <connection>scm:git:file://d:/Research/.git</connection> <developerConnection>scm:git:file://d:/Research/.git</developerConnection&g... | 119, 41127, 47850 | git, maven, maven-release-plugin | <h1>SCM URL of local GIT repo</h1>
<p>I am trying to test mvn release plugin with my local git repo . I am getting error
<strong>No SCM URL was provided to perform the release from</strong> even though parent pom has following detail</p>
<pre><code><scm>
<url>scm:git:file://localhost/d/Research/Resear... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,636 | git | # SCM URL of local GIT repo
I am trying to test mvn release plugin with my local git repo . I am getting error
**No SCM URL was provided to perform the release from** even though parent pom has following detail
```
<scm>
<url>scm:git:file://localhost/d/Research/Research.git</url>
<connection>scm:git:file://lo... | Finally managed to get it working . As I am on windows I used below scm tag
```
<scm>
<url>scm:git:file://d:/Research/.git</url>
<connection>scm:git:file://d:/Research/.git</connection>
<developerConnection>scm:git:file://d:/Research/.git</developerConnection>
</scm>
```
Thanks @wemu for your inputs. |
45067130 | Determine If Any File Changed In Directory For Latest Git Commit | 11 | 2017-07-12 20:40:51 | <p>I'm writing a <code>post-commit</code> hook for <code>git</code>. I would like to know if the latest commit changed any of the files in a particular directory. If there were any changes I can then proceed and call some expensive code, otherwise I can just skip it.</p>
<p>So, <a href="https://gist.github.com/dciccal... | 17,582 | 632,495 | 2020-07-06 10:15:29 | 45,067,330 | 13 | 2017-07-12 20:53:23 | 641,955 | 2017-07-12 21:30:28 | https://stackoverflow.com/q/45067130 | https://stackoverflow.com/a/45067330 | <p>You can get the added, modified, deleted and renamed files in the latest commit with:</p>
<pre><code>git diff --name-only --diff-filter=AMDR --cached @~..@
</code></pre>
<p>To get the changes affecting a specific directory, filter the output using <code>grep</code>. For example:</p>
<pre><code>changes() {
git d... | <p>You can get the added, modified, deleted and renamed files in the latest commit with:</p> <pre><code>git diff --name-only --diff-filter=AMDR --cached @~..@ </code></pre> <p>To get the changes affecting a specific directory, filter the output using <code>grep</code>. For example:</p> <pre><code>changes() { git d... | 119, 43087 | git, githooks | <h1>Determine If Any File Changed In Directory For Latest Git Commit</h1>
<p>I'm writing a <code>post-commit</code> hook for <code>git</code>. I would like to know if the latest commit changed any of the files in a particular directory. If there were any changes I can then proceed and call some expensive code, otherwis... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,637 | git | # Determine If Any File Changed In Directory For Latest Git Commit
I'm writing a `post-commit` hook for `git`. I would like to know if the latest commit changed any of the files in a particular directory. If there were any changes I can then proceed and call some expensive code, otherwise I can just skip it.
So, [far... | You can get the added, modified, deleted and renamed files in the latest commit with:
```
git diff --name-only --diff-filter=AMDR --cached @~..@
```
To get the changes affecting a specific directory, filter the output using `grep`. For example:
```
changes() {
git diff --name-only --diff-filter=AMDR --cached @~..@... |
40575696 | How to push a new branch non-existing on the remote server without --set-upstream? | 11 | 2016-11-13 15:47:09 | <p>The scenario is that I have no repos on the remote server, just an account. Then, I run locally the following commands, where <em>x</em> is the user name and <em>y</em> is the project name that only exists on my local system.</p>
<pre><code>git init
git remote add buckety https://x@bitbucket.org/x/y.git
git add... | 17,868 | 1,525,840 | 2025-06-18 22:28:58 | 40,575,748 | 13 | 2016-11-13 15:52:25 | 6,309 | 2023-09-20 21:00:38 | https://stackoverflow.com/q/40575696 | https://stackoverflow.com/a/40575748 | <p>The right command is:</p>
<pre><code>git push -u origin master
</code></pre>
<p>Or, for more recent (2021+) repositories:</p>
<pre><code>git push -u origin main
</code></pre>
<p>Then the next <code>git push</code> will be a simple: <code>git push</code>.</p>
<p>See "<a href="https://stackoverflow.com/a/17096880... | <p>The right command is:</p> <pre><code>git push -u origin master </code></pre> <p>Or, for more recent (2021+) repositories:</p> <pre><code>git push -u origin main </code></pre> <p>Then the next <code>git push</code> will be a simple: <code>git push</code>.</p> <p>See "<a href="https://stackoverflow.com/a/17096880... | 119, 456, 1879, 76220 | branch, git, git-branch, version-control | <h1>How to push a new branch non-existing on the remote server without --set-upstream?</h1>
<p>The scenario is that I have no repos on the remote server, just an account. Then, I run locally the following commands, where <em>x</em> is the user name and <em>y</em> is the project name that only exists on my local system.... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,639 | git | # How to push a new branch non-existing on the remote server without --set-upstream?
The scenario is that I have no repos on the remote server, just an account. Then, I run locally the following commands, where *x* is the user name and *y* is the project name that only exists on my local system.
```
git init
git re... | The right command is:
```
git push -u origin master
```
Or, for more recent (2021+) repositories:
```
git push -u origin main
```
Then the next `git push` will be a simple: `git push`.
See "[Why do I need to explicitly push a new branch?](https://stackoverflow.com/a/17096880/6309)"
[Since Git 1.8](https://stackov... |
35261086 | Determine which computer a git commit came from | 11 | 2016-02-08 00:58:53 | <p>Lately I've been exploring the vast and terrible world of intellectual property law and people seem to think that if you create something(software) on your time, with your equipment, it typically belongs to you. I know there are many exclusions to this and a couple of really good and informative posts on the subject... | 4,035 | 1,265,528 | 2022-04-05 17:08:40 | 35,261,115 | 13 | 2016-02-08 01:05:03 | 145,279 | 2016-02-08 01:12:53 | https://stackoverflow.com/q/35261086 | https://stackoverflow.com/a/35261115 | <p>When you push to a Git repository over HTTP, HTTPS, or SSH, the remote server generally creates logs of what time the connection occurred and what IP address it originated from. However, most companies employ NAT, resulting in multiple computers on a network sharing the same public IP address. </p>
<p>Some examples... | <p>When you push to a Git repository over HTTP, HTTPS, or SSH, the remote server generally creates logs of what time the connection occurred and what IP address it originated from. However, most companies employ NAT, resulting in multiple computers on a network sharing the same public IP address. </p> <p>Some examples... | 119, 2261 | computer-forensics, git | <h1>Determine which computer a git commit came from</h1>
<p>Lately I've been exploring the vast and terrible world of intellectual property law and people seem to think that if you create something(software) on your time, with your equipment, it typically belongs to you. I know there are many exclusions to this and a c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,641 | git | # Determine which computer a git commit came from
Lately I've been exploring the vast and terrible world of intellectual property law and people seem to think that if you create something(software) on your time, with your equipment, it typically belongs to you. I know there are many exclusions to this and a couple of ... | When you push to a Git repository over HTTP, HTTPS, or SSH, the remote server generally creates logs of what time the connection occurred and what IP address it originated from. However, most companies employ NAT, resulting in multiple computers on a network sharing the same public IP address.
Some examples logs:
```... |
33053615 | How to download only a working directory of the AOSP source code without the entire repo history? | 11 | 2015-10-10 11:45:16 | <p>The size of the latest AOSP source code is rather large (around 30-35 Gb for the .repo directory and another 15 Gb or so for the working directory). Is there a way to download only a snapshot of the latest version of the source code (official marshmallow release) without the entire repo history? That would save me a... | 7,454 | 5,430,778 | 2020-10-19 21:58:05 | 33,053,833 | 13 | 2015-10-10 12:11:53 | 1,615,903 | 2015-10-10 12:11:53 | https://stackoverflow.com/q/33053615 | https://stackoverflow.com/a/33053833 | <p>You can specify <code>--depth 1</code> to <a href="https://git-scm.com/docs/git-clone" rel="noreferrer">git clone</a> command. It will only get the latest snapshot.</p>
| <p>You can specify <code>--depth 1</code> to <a href="https://git-scm.com/docs/git-clone" rel="noreferrer">git clone</a> command. It will only get the latest snapshot.</p> | 119, 1386, 47738 | android, android-source, git | <h1>How to download only a working directory of the AOSP source code without the entire repo history?</h1>
<p>The size of the latest AOSP source code is rather large (around 30-35 Gb for the .repo directory and another 15 Gb or so for the working directory). Is there a way to download only a snapshot of the latest vers... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,642 | git | # How to download only a working directory of the AOSP source code without the entire repo history?
The size of the latest AOSP source code is rather large (around 30-35 Gb for the .repo directory and another 15 Gb or so for the working directory). Is there a way to download only a snapshot of the latest version of th... | You can specify `--depth 1` to [git clone](https://git-scm.com/docs/git-clone) command. It will only get the latest snapshot. |
30798638 | Android Studio Best way import module from other repository | 11 | 2015-06-12 08:27:22 | <p>I have to import a project from a Github repository as a module inside an Android Studio project that it committed into another repository. </p>
<p>The project I have to import from Github will be updated constantly so it means that I'll have to refresh every now and again for having the latest changes done on the... | 10,897 | 1,873,390 | 2015-06-12 08:43:44 | 30,798,785 | 13 | 2015-06-12 08:35:34 | 737,925 | 2015-06-12 08:43:44 | https://stackoverflow.com/q/30798638 | https://stackoverflow.com/a/30798785 | <p>I'd advice to use <a href="https://jitpack.io/">Jitpack</a></p>
<p>Jitpack: Easy to use package repository for GitHub, just include it inside your gradle, and now you can deal with github project as a module</p>
<p>Thanks Jitpack <3</p>
<hr>
<p>For example:
we have this repository: <a href="https://github.com... | <p>I'd advice to use <a href="https://jitpack.io/">Jitpack</a></p> <p>Jitpack: Easy to use package repository for GitHub, just include it inside your gradle, and now you can deal with github project as a module</p> <p>Thanks Jitpack <3</p> <hr> <p>For example: we have this repository: <a href="https://github.com... | 119, 1386, 7330, 32307 | android, git, gradle, repository | <h1>Android Studio Best way import module from other repository</h1>
<p>I have to import a project from a Github repository as a module inside an Android Studio project that it committed into another repository. </p>
<p>The project I have to import from Github will be updated constantly so it means that I'll have to ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,643 | git | # Android Studio Best way import module from other repository
I have to import a project from a Github repository as a module inside an Android Studio project that it committed into another repository.
The project I have to import from Github will be updated constantly so it means that I'll have to refresh every now ... | I'd advice to use [Jitpack](https://jitpack.io/)
Jitpack: Easy to use package repository for GitHub, just include it inside your gradle, and now you can deal with github project as a module
Thanks Jitpack <3
---
For example:
we have this repository: <https://github.com/florent37/MaterialViewPager>
and with Jitpack... |
30561895 | How to remove merge commits while keeping merged changes? | 11 | 2015-05-31 19:41:44 | <p>I have our commit log from my repo. You can see the "Merge branch...into..." commits. After these commits, the branch was merged.</p>
<p>I need to delete the merge commits, but not discard the changes.
Default rebasing doesn't show merge commits.</p>
<p><img src="https://i.sstatic.net/XqJlM.png" alt="scree... | 41,928 | 3,925,125 | 2021-04-20 08:12:46 | 30,565,914 | 13 | 2015-06-01 05:03:20 | 3,241,487 | 2015-06-01 05:36:26 | https://stackoverflow.com/q/30561895 | https://stackoverflow.com/a/30565914 | <p>If you want to apply the changes of the commits without including the merge commit (which as Roland Smith pointed out is generally considered bad practice) you can use <code>git rebase</code> with the following workflow:</p>
<ol>
<li>Checkout the branch you want the changes to be on (let's say master): <code>git ch... | <p>If you want to apply the changes of the commits without including the merge commit (which as Roland Smith pointed out is generally considered bad practice) you can use <code>git rebase</code> with the following workflow:</p> <ol> <li>Checkout the branch you want the changes to be on (let's say master): <code>git ch... | 119, 28897 | git, git-merge | <h1>How to remove merge commits while keeping merged changes?</h1>
<p>I have our commit log from my repo. You can see the "Merge branch...into..." commits. After these commits, the branch was merged.</p>
<p>I need to delete the merge commits, but not discard the changes.
Default rebasing doesn't show merge co... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,644 | git | # How to remove merge commits while keeping merged changes?
I have our commit log from my repo. You can see the "Merge branch...into..." commits. After these commits, the branch was merged.
I need to delete the merge commits, but not discard the changes.
Default rebasing doesn't show merge commits.
. Note that it's a regex, so some characters may need escaped. |
25976794 | Is HEAD in git case insensitive on all platforms? | 11 | 2014-09-22 14:40:29 | <p>Using msysgit on Windows, I can do this:</p>
<pre><code>git checkout head
</code></pre>
<p>or</p>
<pre><code>git checkout HEAD
</code></pre>
<p>Either works. I don't have a linux environment to test on, but I'm just curious: is <code>HEAD</code> case insensitive by design? Is it this way on all platforms?</p>
| 1,660 | 157,971 | 2020-03-18 19:13:07 | 25,976,876 | 13 | 2014-09-22 14:44:17 | 354,577 | 2014-09-22 14:53:36 | https://stackoverflow.com/q/25976794 | https://stackoverflow.com/a/25976876 | <p><code>HEAD</code> is case-sensitive on Linux.</p>
<p>For example:</p>
<pre><code>$ git checkout head
error: pathspec 'head' did not match any file(s) known to git.
$ git checkout HEAD
Your branch is up-to-date with 'origin/master'.
</code></pre>
<p>Git version 1.9.1 on Ubuntu 14.04.</p>
| <p><code>HEAD</code> is case-sensitive on Linux.</p> <p>For example:</p> <pre><code>$ git checkout head error: pathspec 'head' did not match any file(s) known to git. $ git checkout HEAD Your branch is up-to-date with 'origin/master'. </code></pre> <p>Git version 1.9.1 on Ubuntu 14.04.</p> | 119 | git | <h1>Is HEAD in git case insensitive on all platforms?</h1>
<p>Using msysgit on Windows, I can do this:</p>
<pre><code>git checkout head
</code></pre>
<p>or</p>
<pre><code>git checkout HEAD
</code></pre>
<p>Either works. I don't have a linux environment to test on, but I'm just curious: is <code>HEAD</code> case ins... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,647 | git | # Is HEAD in git case insensitive on all platforms?
Using msysgit on Windows, I can do this:
```
git checkout head
```
or
```
git checkout HEAD
```
Either works. I don't have a linux environment to test on, but I'm just curious: is `HEAD` case insensitive by design? Is it this way on all platforms? | `HEAD` is case-sensitive on Linux.
For example:
```
$ git checkout head
error: pathspec 'head' did not match any file(s) known to git.
$ git checkout HEAD
Your branch is up-to-date with 'origin/master'.
```
Git version 1.9.1 on Ubuntu 14.04. |
19662570 | Git diff with remote tag | 11 | 2013-10-29 15:30:02 | <p>I'm about to merge a big change from a remote branch (non-origin), and more specifically from a given tag.</p>
<p>There are two remotes then:</p>
<ol>
<li><code>origin</code></li>
<li><code>proposal</code></li>
</ol>
<p>On the <code>proposal</code> remote, a branch name <code>idea</code> exists, with a tag <code>... | 22,344 | 1,003,190 | 2018-06-27 09:40:54 | 19,664,604 | 13 | 2013-10-29 16:59:22 | 1,169,096 | 2015-10-01 07:15:51 | https://stackoverflow.com/q/19662570 | https://stackoverflow.com/a/19664604 | <p>Most git commands only work locally, esp. things like <code>git diff</code> and <code>git merge</code>.</p>
<p>Your local repository can have multiple remotes, but in order to work on these, you must first sync the local repository with your remotes:</p>
<pre><code> git fetch --all
</code></pre>
<p>While this wil... | <p>Most git commands only work locally, esp. things like <code>git diff</code> and <code>git merge</code>.</p> <p>Your local repository can have multiple remotes, but in order to work on these, you must first sync the local repository with your remotes:</p> <pre><code> git fetch --all </code></pre> <p>While this wil... | 115, 119, 606 | diff, git, tags | <h1>Git diff with remote tag</h1>
<p>I'm about to merge a big change from a remote branch (non-origin), and more specifically from a given tag.</p>
<p>There are two remotes then:</p>
<ol>
<li><code>origin</code></li>
<li><code>proposal</code></li>
</ol>
<p>On the <code>proposal</code> remote, a branch name <code>ide... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,650 | git | # Git diff with remote tag
I'm about to merge a big change from a remote branch (non-origin), and more specifically from a given tag.
There are two remotes then:
1. `origin`
2. `proposal`
On the `proposal` remote, a branch name `idea` exists, with a tag `tagged_idea`.
The idea is that I want to review the incoming... | Most git commands only work locally, esp. things like `git diff` and `git merge`.
Your local repository can have multiple remotes, but in order to work on these, you must first sync the local repository with your remotes:
```
git fetch --all
```
While this will download all the changesets, it will not apply them to... |
16655105 | How to accommodate multiple coding styles? (git vs. IDE) | 11 | 2013-05-20 17:41:17 | <p>I am collaborating on a git-sourced, maven-managed Java project with differing code styling preferences with users using multiple IDE's (note 1). </p>
<p>Is there a tool or IDE configuration that will allow code to be viewed and edited using <i>style-1</i>, but committed to SCM using <i>style-2</i>?</p>
<p>My res... | 3,046 | 237,225 | 2013-05-27 22:34:17 | 16,726,373 | 13 | 2013-05-24 01:21:37 | 620,249 | 2013-05-24 01:21:37 | https://stackoverflow.com/q/16655105 | https://stackoverflow.com/a/16726373 | <p>First of all, <strong>you really shouldn't do that</strong>. Codestyle wars are bad for any project, and it is best to decide upon <strong>one</strong> codestyle that everybody must use. It is simple to configure IDEs to automatically apply the specified codestyle at every filesave, so the developers don't have to w... | <p>First of all, <strong>you really shouldn't do that</strong>. Codestyle wars are bad for any project, and it is best to decide upon <strong>one</strong> codestyle that everybody must use. It is simple to configure IDEs to automatically apply the specified codestyle at every filesave, so the developers don't have to w... | 17, 53, 119, 3054, 8945 | coding-style, eclipse, git, intellij-idea, java | <h1>How to accommodate multiple coding styles? (git vs. IDE)</h1>
<p>I am collaborating on a git-sourced, maven-managed Java project with differing code styling preferences with users using multiple IDE's (note 1). </p>
<p>Is there a tool or IDE configuration that will allow code to be viewed and edited using <i>styl... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,651 | git | # How to accommodate multiple coding styles? (git vs. IDE)
I am collaborating on a git-sourced, maven-managed Java project with differing code styling preferences with users using multiple IDE's (note 1).
Is there a tool or IDE configuration that will allow code to be viewed and edited using *style-1*, but committed ... | First of all, **you really shouldn't do that**. Codestyle wars are bad for any project, and it is best to decide upon **one** codestyle that everybody must use. It is simple to configure IDEs to automatically apply the specified codestyle at every filesave, so the developers don't have to write code in the target codes... |
16195729 | Git: List all files with assume-unchanged flag | 11 | 2013-04-24 15:14:18 | <p>I need the assume-unchanged flag to avoid wrong commits of my project settings files. I do this via:</p>
<pre><code>git update-index --assume-unchanged <file>
</code></pre>
<p>There is also a way to disable this with --no-assume-unchanged.</p>
<p>Now I added 5 files in this way and subsequently decided to a... | 3,919 | 1,020,719 | 2017-03-08 22:20:42 | 16,196,945 | 13 | 2013-04-24 16:07:20 | 305,973 | 2013-04-24 16:07:20 | https://stackoverflow.com/q/16195729 | https://stackoverflow.com/a/16196945 | <p>You can use the lower-level command <code>ls-files</code>:</p>
<pre><code>% git ls-files -v
h a.txt
H b.txt
</code></pre>
<p>If the first character is lowercase, it is marked as "assume unchanged", in this case <code>a.txt</code>. See also the <a href="http://git-scm.com/docs/git-ls-files">man page of ls-files</a>... | <p>You can use the lower-level command <code>ls-files</code>:</p> <pre><code>% git ls-files -v h a.txt H b.txt </code></pre> <p>If the first character is lowercase, it is marked as "assume unchanged", in this case <code>a.txt</code>. See also the <a href="http://git-scm.com/docs/git-ls-files">man page of ls-files</a>... | 119 | git | <h1>Git: List all files with assume-unchanged flag</h1>
<p>I need the assume-unchanged flag to avoid wrong commits of my project settings files. I do this via:</p>
<pre><code>git update-index --assume-unchanged <file>
</code></pre>
<p>There is also a way to disable this with --no-assume-unchanged.</p>
<p>Now I... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,652 | git | # Git: List all files with assume-unchanged flag
I need the assume-unchanged flag to avoid wrong commits of my project settings files. I do this via:
```
git update-index --assume-unchanged <file>
```
There is also a way to disable this with --no-assume-unchanged.
Now I added 5 files in this way and subsequently de... | You can use the lower-level command `ls-files`:
```
% git ls-files -v
h a.txt
H b.txt
```
If the first character is lowercase, it is marked as "assume unchanged", in this case `a.txt`. See also the [man page of ls-files](http://git-scm.com/docs/git-ls-files). |
13343581 | Creating branch inside a branch in git | 11 | 2012-11-12 12:17:30 | <p>In my repository, I have a master branch and then a staging branch coming out of master branch. Now I need to add a third branch that should come out from staging branch. That means I need a branch coming out of another branch. Can anyone help in this?</p>
<p>The syntax I used for creating branch is like this: </p>... | 21,833 | 1,817,937 | 2012-11-12 12:38:07 | 13,343,838 | 13 | 2012-11-12 12:38:07 | 6,309 | 2012-11-12 12:38:07 | https://stackoverflow.com/q/13343581 | https://stackoverflow.com/a/13343838 | <p>This can create your branch locally:</p>
<pre><code>git checkout staging
git checkout -b newBranch
</code></pre>
<p>or, one line:</p>
<pre><code>git checkout -b newBranch staging
</code></pre>
<p>That will start from the current HEAD of <code>staging</code>, but note that a branch doesn't really comes from anoth... | <p>This can create your branch locally:</p> <pre><code>git checkout staging git checkout -b newBranch </code></pre> <p>or, one line:</p> <pre><code>git checkout -b newBranch staging </code></pre> <p>That will start from the current HEAD of <code>staging</code>, but note that a branch doesn't really comes from anoth... | 119, 1879, 76220 | branch, git, git-branch | <h1>Creating branch inside a branch in git</h1>
<p>In my repository, I have a master branch and then a staging branch coming out of master branch. Now I need to add a third branch that should come out from staging branch. That means I need a branch coming out of another branch. Can anyone help in this?</p>
<p>The synt... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,653 | git | # Creating branch inside a branch in git
In my repository, I have a master branch and then a staging branch coming out of master branch. Now I need to add a third branch that should come out from staging branch. That means I need a branch coming out of another branch. Can anyone help in this?
The syntax I used for cr... | This can create your branch locally:
```
git checkout staging
git checkout -b newBranch
```
or, one line:
```
git checkout -b newBranch staging
```
That will start from the current HEAD of `staging`, but note that a branch doesn't really comes from another branch: it comes from a commit (and that commit can be part... |
10457639 | eclipse compare editor stopped showing detailed differences | 11 | 2012-05-05 00:09:31 | <p>I've been using eclipse for java android development for 6 months and I love the compare editor. In the last few days I have been hacking away and I think I have all my git ducks in a row, or close enough that things are clean and neat and I can find old working versions of apps. </p>
<p>But it seems in the last ... | 13,245 | 841,828 | 2024-10-14 11:46:56 | 10,457,671 | 13 | 2012-05-05 00:15:39 | 6,309 | 2023-08-27 22:12:04 | https://stackoverflow.com/q/10457639 | https://stackoverflow.com/a/10457671 | <p>Note the latest <a href="https://wiki.eclipse.org/EGit/New_and_Noteworthy/5.3#Compare_and_Merge_Editors" rel="nofollow noreferrer">EGit 5.3.0 (Feb. 2020, 8 years later)</a> improves the right side of the compare editor, using the <code>Eclipse -> Preferences -> Text Editors -> Show whitespace characters</co... | <p>Note the latest <a href="https://wiki.eclipse.org/EGit/New_and_Noteworthy/5.3#Compare_and_Merge_Editors" rel="nofollow noreferrer">EGit 5.3.0 (Feb. 2020, 8 years later)</a> improves the right side of the compare editor, using the <code>Eclipse -> Preferences -> Text Editors -> Show whitespace characters</co... | 53, 119, 2936, 5025 | compare, eclipse, editor, git | <h1>eclipse compare editor stopped showing detailed differences</h1>
<p>I've been using eclipse for java android development for 6 months and I love the compare editor. In the last few days I have been hacking away and I think I have all my git ducks in a row, or close enough that things are clean and neat and I can f... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,654 | git | # eclipse compare editor stopped showing detailed differences
I've been using eclipse for java android development for 6 months and I love the compare editor. In the last few days I have been hacking away and I think I have all my git ducks in a row, or close enough that things are clean and neat and I can find old wo... | Note the latest [EGit 5.3.0 (Feb. 2020, 8 years later)](https://wiki.eclipse.org/EGit/New_and_Noteworthy/5.3#Compare_and_Merge_Editors) improves the right side of the compare editor, using the `Eclipse -> Preferences -> Text Editors -> Show whitespace characters` mentioned in [Vivek](https://stackoverflow.com/users/206... |
10402285 | How to get rid of false dependencies in gerrit | 11 | 2012-05-01 18:26:13 | <p>It appears that when using gerrit, by default all changes depend on the previous one. I do not branch for new changes, I simply work off the master branch and then push the commited changes to a remote origin/master. A dependency is created every time even if the two commits have nothing to do with each other.</p>
... | 15,467 | 1,015,144 | 2015-03-11 16:54:08 | 10,404,720 | 13 | 2012-05-01 21:36:11 | 457,488 | 2015-03-11 16:54:08 | https://stackoverflow.com/q/10402285 | https://stackoverflow.com/a/10404720 | <p>This is what <code>Gerrit</code> means by dependencies - A commit which is on top of another commit. If both are in review, the newer one depends on the older one.</p>
<p>If you don't want them to depend on each other, don't create the commits on top of each other. Create one commit, then make a new branch based ... | <p>This is what <code>Gerrit</code> means by dependencies - A commit which is on top of another commit. If both are in review, the newer one depends on the older one.</p> <p>If you don't want them to depend on each other, don't create the commits on top of each other. Create one commit, then make a new branch based ... | 119, 52272 | gerrit, git | <h1>How to get rid of false dependencies in gerrit</h1>
<p>It appears that when using gerrit, by default all changes depend on the previous one. I do not branch for new changes, I simply work off the master branch and then push the commited changes to a remote origin/master. A dependency is created every time even if t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,655 | git | # How to get rid of false dependencies in gerrit
It appears that when using gerrit, by default all changes depend on the previous one. I do not branch for new changes, I simply work off the master branch and then push the commited changes to a remote origin/master. A dependency is created every time even if the two co... | This is what `Gerrit` means by dependencies - A commit which is on top of another commit. If both are in review, the newer one depends on the older one.
If you don't want them to depend on each other, don't create the commits on top of each other. Create one commit, then make a new branch based on master for your next... |
5020055 | What is the git(1) equivalent of "cvs export"? | 11 | 2011-02-16 17:45:04 | <p>What is the git(1)-based equivalent of the "cvs export" command, which checks-out a snapshot of the repository without needing or creating any administrative files (imagine that this is the first step executed by an independent continuous-integration server). Does the git(1) equivalent use the <code>git archive</cod... | 877 | 204,143 | 2011-02-16 17:47:46 | 5,020,083 | 13 | 2011-02-16 17:47:46 | 28,804 | 2011-02-16 17:47:46 | https://stackoverflow.com/q/5020055 | https://stackoverflow.com/a/5020083 | <p>Yes, <code>git-archive</code> is what you want.</p>
| <p>Yes, <code>git-archive</code> is what you want.</p> | 119 | git | <h1>What is the git(1) equivalent of "cvs export"?</h1>
<p>What is the git(1)-based equivalent of the "cvs export" command, which checks-out a snapshot of the repository without needing or creating any administrative files (imagine that this is the first step executed by an independent continuous-integration server). D... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,657 | git | # What is the git(1) equivalent of "cvs export"?
What is the git(1)-based equivalent of the "cvs export" command, which checks-out a snapshot of the repository without needing or creating any administrative files (imagine that this is the first step executed by an independent continuous-integration server). Does the g... | Yes, `git-archive` is what you want. |
4960960 | Git: How to clone a 3rd party library into a subdirectory of my app's repository? | 11 | 2011-02-10 18:11:05 | <p>I'm trying to figure out the proper way to clone a 3rd party library (engage.iphone from Janrain) into my own app's directory structure in a way that will let me pull the latest changes and merge them with any changes that I make locally. I also want the 3rd party library (merged with my changes) to be included in ... | 10,254 | 96,624 | 2015-09-15 15:51:30 | 4,962,025 | 13 | 2011-02-10 20:03:28 | 158,304 | 2011-03-14 21:42:51 | https://stackoverflow.com/q/4960960 | https://stackoverflow.com/a/4962025 | <p>Submodules are the easiest way to accomplish this.</p>
<p>There are two common ways of working with submodules - adding new ones and initialising existing ones.</p>
<p><strong>Adding New Submodules</strong></p>
<p>From the root of your local repository run:</p>
<p><code>git submodule add <repository> exter... | <p>Submodules are the easiest way to accomplish this.</p> <p>There are two common ways of working with submodules - adding new ones and initialising existing ones.</p> <p><strong>Adding New Submodules</strong></p> <p>From the root of your local repository run:</p> <p><code>git submodule add <repository> exter... | 119, 34099 | git, git-clone | <h1>Git: How to clone a 3rd party library into a subdirectory of my app's repository?</h1>
<p>I'm trying to figure out the proper way to clone a 3rd party library (engage.iphone from Janrain) into my own app's directory structure in a way that will let me pull the latest changes and merge them with any changes that I m... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,658 | git | # Git: How to clone a 3rd party library into a subdirectory of my app's repository?
I'm trying to figure out the proper way to clone a 3rd party library (engage.iphone from Janrain) into my own app's directory structure in a way that will let me pull the latest changes and merge them with any changes that I make local... | Submodules are the easiest way to accomplish this.
There are two common ways of working with submodules - adding new ones and initialising existing ones.
**Adding New Submodules**
From the root of your local repository run:
`git submodule add <repository> external/engage.iphone`.
The `add` command is for when you'... |
4369735 | How can I make my local Git repository accessible for multiple users? | 11 | 2010-12-06 18:36:21 | <p>I want to create a git repository and allow all users to have access to it. I tried initializing it by:</p>
<pre><code>git init --shared=all
</code></pre>
<p>However when I change the user and do a <code>git status</code>, I get the following error:</p>
<pre><code>fatal: Unable to create '.git/index.lock': Permi... | 13,811 | 503,823 | 2015-11-10 15:45:06 | 4,369,844 | 13 | 2010-12-06 18:48:29 | 166,749 | 2012-10-26 13:24:10 | https://stackoverflow.com/q/4369735 | https://stackoverflow.com/a/4369844 | <p>Apparently, <code>--shared={all|world|everybody}</code> is broken in recent Git. Use octal permissions:</p>
<pre><code>git init --shared=0777
</code></pre>
| <p>Apparently, <code>--shared={all|world|everybody}</code> is broken in recent Git. Use octal permissions:</p> <pre><code>git init --shared=0777 </code></pre> | 119, 359, 2120 | file-permissions, git, permissions | <h1>How can I make my local Git repository accessible for multiple users?</h1>
<p>I want to create a git repository and allow all users to have access to it. I tried initializing it by:</p>
<pre><code>git init --shared=all
</code></pre>
<p>However when I change the user and do a <code>git status</code>, I get the fo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,659 | git | # How can I make my local Git repository accessible for multiple users?
I want to create a git repository and allow all users to have access to it. I tried initializing it by:
```
git init --shared=all
```
However when I change the user and do a `git status`, I get the following error:
```
fatal: Unable to create '... | Apparently, `--shared={all|world|everybody}` is broken in recent Git. Use octal permissions:
```
git init --shared=0777
``` |
3731222 | Is it safe to zipup bare `git` repositories and hand it to other people? | 11 | 2010-09-16 22:09:40 | <p>Had to transfer code (the whole project history) to another dev shop today and was wondering if it's a good idea to zipup the bare git repository our team use for collaboration and just send it verbatim?</p>
<p>Is it safe to do as such?<br>
Is there any sensitive data stored in a .git folder?</p>
| 908 | 3,055 | 2017-06-11 04:39:16 | 3,732,554 | 13 | 2010-09-17 03:50:05 | 825 | 2010-09-17 03:50:05 | https://stackoverflow.com/q/3731222 | https://stackoverflow.com/a/3732554 | <p>If you do this instead of using <code>clone</code> or <code>bundle</code> then you'll also be giving them your <code>.git/hooks</code> directory, <code>.git/config</code> file and a few other customizable files. It's not common for those files to contain any sensitive data (you'd know because you would have put it ... | <p>If you do this instead of using <code>clone</code> or <code>bundle</code> then you'll also be giving them your <code>.git/hooks</code> directory, <code>.git/config</code> file and a few other customizable files. It's not common for those files to contain any sensitive data (you'd know because you would have put it ... | 119 | git | <h1>Is it safe to zipup bare `git` repositories and hand it to other people?</h1>
<p>Had to transfer code (the whole project history) to another dev shop today and was wondering if it's a good idea to zipup the bare git repository our team use for collaboration and just send it verbatim?</p>
<p>Is it safe to do as suc... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,660 | git | # Is it safe to zipup bare `git` repositories and hand it to other people?
Had to transfer code (the whole project history) to another dev shop today and was wondering if it's a good idea to zipup the bare git repository our team use for collaboration and just send it verbatim?
Is it safe to do as such?
Is there an... | If you do this instead of using `clone` or `bundle` then you'll also be giving them your `.git/hooks` directory, `.git/config` file and a few other customizable files. It's not common for those files to contain any sensitive data (you'd know because you would have put it there manually) but they may contain personalize... |
2648375 | git merging changes to local branch | 11 | 2010-04-15 19:30:33 | <p>Is it possible to merge changes from a central repo to a local branch without having to commit/stash the edits on the local branch and checkout master?</p>
<p>If I am working on local branch "work" and there are some uncommited changes, I use the following steps to get updates from the central repo into my working ... | 14,742 | 51,851 | 2016-12-30 16:50:16 | 2,648,415 | 13 | 2010-04-15 19:35:48 | 158,676 | 2010-04-16 03:58:28 | https://stackoverflow.com/q/2648375 | https://stackoverflow.com/a/2648415 | <p>You can do (on branch <code>work</code>):</p>
<pre><code>git stash
git pull --rebase origin master
git stash apply
</code></pre>
<p><code>git pull --rebase</code> both pulls remote changes and rebases your local changes on top of the remote ones. I.e. essentially does what you show in your script.</p>
<p>Local c... | <p>You can do (on branch <code>work</code>):</p> <pre><code>git stash git pull --rebase origin master git stash apply </code></pre> <p><code>git pull --rebase</code> both pulls remote changes and rebases your local changes on top of the remote ones. I.e. essentially does what you show in your script.</p> <p>Local c... | 119 | git | <h1>git merging changes to local branch</h1>
<p>Is it possible to merge changes from a central repo to a local branch without having to commit/stash the edits on the local branch and checkout master?</p>
<p>If I am working on local branch "work" and there are some uncommited changes, I use the following steps to get u... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,661 | git | # git merging changes to local branch
Is it possible to merge changes from a central repo to a local branch without having to commit/stash the edits on the local branch and checkout master?
If I am working on local branch "work" and there are some uncommited changes, I use the following steps to get updates from the ... | You can do (on branch `work`):
```
git stash
git pull --rebase origin master
git stash apply
```
`git pull --rebase` both pulls remote changes and rebases your local changes on top of the remote ones. I.e. essentially does what you show in your script.
Local changes, of course, should be committed or stashed on `mer... |
73658025 | How to approach a large merge with many conflicts that are not all best handled by the same person? | 10 | 2022-09-09 06:16:38 | <p>Say we have a <code>develop</code> branch and a <code>feature</code> branch. The <code>develop</code> branch receives many updates, very frequently, from dozens of developers. It often gets very far ahead of the <code>feature</code> branch.</p>
<p>On one occasion, a merge from <code>develop</code> into <code>feature... | 4,877 | 802,517 | 2025-12-16 05:45:59 | 73,658,474 | 13 | 2022-09-09 07:04:43 | 2,437,508 | 2023-11-02 03:37:24 | https://stackoverflow.com/q/73658025 | https://stackoverflow.com/a/73658474 | <p>There are ways to <em>cope</em> with it... and they are not beautiful. Say, merge on a separate branch that will be used to... let's say, <em>stabilize</em> it..... keep a list of the conflicted files. Commit the results <em>with</em> conflicts (awful, I know..... it will make sense in the end, continue reading). Le... | <p>There are ways to <em>cope</em> with it... and they are not beautiful. Say, merge on a separate branch that will be used to... let's say, <em>stabilize</em> it..... keep a list of the conflicted files. Commit the results <em>with</em> conflicts (awful, I know..... it will make sense in the end, continue reading). Le... | 119, 28897, 106113 | git, git-merge, git-merge-conflict | <h1>How to approach a large merge with many conflicts that are not all best handled by the same person?</h1>
<p>Say we have a <code>develop</code> branch and a <code>feature</code> branch. The <code>develop</code> branch receives many updates, very frequently, from dozens of developers. It often gets very far ahead of ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,663 | git | # How to approach a large merge with many conflicts that are not all best handled by the same person?
Say we have a `develop` branch and a `feature` branch. The `develop` branch receives many updates, very frequently, from dozens of developers. It often gets very far ahead of the `feature` branch.
On one occasion, a ... | There are ways to *cope* with it... and they are not beautiful. Say, merge on a separate branch that will be used to... let's say, *stabilize* it..... keep a list of the conflicted files. Commit the results *with* conflicts (awful, I know..... it will make sense in the end, continue reading). Let the developers now wor... |
69312158 | git pull VS git pull --no-rebase | 10 | 2021-09-24 08:50:25 | <p>What is the difference between <code>git pull</code> and <code>git pull --no-rebase</code>
?</p>
<p>In my understanding the git pull by default does a fetch then a merge. So the no-rebase means merge and therefore these two commands are exactly identical! Is that correct?</p>
| 27,151 | 15,102,038 | 2026-01-15 05:32:55 | 69,317,036 | 13 | 2021-09-24 14:51:19 | 1,057,485 | 2025-05-27 12:10:43 | https://stackoverflow.com/q/69312158 | https://stackoverflow.com/a/69317036 | <p>When you have <code>pull.rebase</code> set to <code>true</code> in your config, the default action upon <code>git pull</code> is a rebase.</p>
<p>(If you're unsure about how to look for it in your config, it's <code>git config --get pull.rebase</code> )</p>
<p>In <strong>this</strong> case, the <code>--no-rebase</co... | <p>When you have <code>pull.rebase</code> set to <code>true</code> in your config, the default action upon <code>git pull</code> is a rebase.</p> <p>(If you're unsure about how to look for it in your config, it's <code>git config --get pull.rebase</code> )</p> <p>In <strong>this</strong> case, the <code>--no-rebase</co... | 119, 28896, 28897, 29934 | git, git-merge, git-pull, git-rebase | <h1>git pull VS git pull --no-rebase</h1>
<p>What is the difference between <code>git pull</code> and <code>git pull --no-rebase</code>
?</p>
<p>In my understanding the git pull by default does a fetch then a merge. So the no-rebase means merge and therefore these two commands are exactly identical! Is that correct?</p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,664 | git | # git pull VS git pull --no-rebase
What is the difference between `git pull` and `git pull --no-rebase`
?
In my understanding the git pull by default does a fetch then a merge. So the no-rebase means merge and therefore these two commands are exactly identical! Is that correct? | When you have `pull.rebase` set to `true` in your config, the default action upon `git pull` is a rebase.
(If you're unsure about how to look for it in your config, it's `git config --get pull.rebase` )
In **this** case, the `--no-rebase` option is a one-time exception to your personal default, resulting in a merge-p... |
39350939 | How to use GPG signatures with Xcode source control? | 10 | 2016-09-06 13:59:47 | <p>Whenever I try to commit my files, I get this error message:</p>
<blockquote>
<p>gpg: cannot open `/dev/tty': Device not configured<br>
error: gpg failed to sign the data<br>
fatal: failed to write commit object</p>
</blockquote>
<p>Yikes! This is because I have GPG signatures enabled for git.</p>
<p>Is it ... | 3,213 | 4,633,828 | 2025-08-05 03:09:53 | 55,054,819 | 13 | 2019-03-08 00:08:42 | 8,705,432 | 2019-03-08 00:08:42 | https://stackoverflow.com/q/39350939 | https://stackoverflow.com/a/55054819 | <p>The issue here is that the default pinentry (password dialog) is terminal-based, and when you are in Xcode, Git isn't invoked with a terminal attached. Consequently, there's no way for GnuPG to prompt you for a passphrase.</p>
<p>The easiest way to handle this is to install the Mac pinentry with <code>brew install ... | <p>The issue here is that the default pinentry (password dialog) is terminal-based, and when you are in Xcode, Git isn't invoked with a terminal attached. Consequently, there's no way for GnuPG to prompt you for a passphrase.</p> <p>The easiest way to handle this is to install the Mac pinentry with <code>brew install ... | 119, 456, 908 | git, version-control, xcode | <h1>How to use GPG signatures with Xcode source control?</h1>
<p>Whenever I try to commit my files, I get this error message:</p>
<blockquote>
<p>gpg: cannot open `/dev/tty': Device not configured<br>
error: gpg failed to sign the data<br>
fatal: failed to write commit object</p>
</blockquote>
<p>Yikes! This is... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,668 | git | # How to use GPG signatures with Xcode source control?
Whenever I try to commit my files, I get this error message:
> gpg: cannot open `/dev/tty': Device not configured
> error: gpg failed to sign the data
> fatal: failed to write commit object
Yikes! This is because I have GPG signatures enabled for git.
Is it... | The issue here is that the default pinentry (password dialog) is terminal-based, and when you are in Xcode, Git isn't invoked with a terminal attached. Consequently, there's no way for GnuPG to prompt you for a passphrase.
The easiest way to handle this is to install the Mac pinentry with `brew install pinentry-mac`. ... |
46612507 | Git diff branch before and after rebase ignoring changes in master | 10 | 2017-10-06 19:15:22 | <p>I want to be able to see changes in a branch, since I last reviewed it, but ignoring the changes in master that happened in the meantime.</p>
<pre><code> F - G H - I
/ /
A - B - C - D - E
</code></pre>
<p>I have two commit ranges <code>c3af8fc5..7ccc4b49</code> (represented by <code>B - G</... | 5,413 | 602,899 | 2018-09-26 12:30:16 | 52,517,821 | 13 | 2018-09-26 12:30:16 | 602,899 | 2018-09-26 12:30:16 | https://stackoverflow.com/q/46612507 | https://stackoverflow.com/a/52517821 | <p>So the solution is to use the new <a href="https://git-scm.com/docs/git-range-diff" rel="noreferrer">git range-diff</a>.</p>
<p>Simply run <code>git range-diff c3af8fc5..7ccc4b49 4dfdabdd..301a443c</code>, or even simpler <code>git range-diff 7ccc4b49...301a443c</code> might work unless you've done some really craz... | <p>So the solution is to use the new <a href="https://git-scm.com/docs/git-range-diff" rel="noreferrer">git range-diff</a>.</p> <p>Simply run <code>git range-diff c3af8fc5..7ccc4b49 4dfdabdd..301a443c</code>, or even simpler <code>git range-diff 7ccc4b49...301a443c</code> might work unless you've done some really craz... | 119, 606 | diff, git | <h1>Git diff branch before and after rebase ignoring changes in master</h1>
<p>I want to be able to see changes in a branch, since I last reviewed it, but ignoring the changes in master that happened in the meantime.</p>
<pre><code> F - G H - I
/ /
A - B - C - D - E
</code></pre>
<p>I have two... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,669 | git | # Git diff branch before and after rebase ignoring changes in master
I want to be able to see changes in a branch, since I last reviewed it, but ignoring the changes in master that happened in the meantime.
```
F - G H - I
/ /
A - B - C - D - E
```
I have two commit ranges `c3af8fc5..7ccc4b4... | So the solution is to use the new [git range-diff](https://git-scm.com/docs/git-range-diff).
Simply run `git range-diff c3af8fc5..7ccc4b49 4dfdabdd..301a443c`, or even simpler `git range-diff 7ccc4b49...301a443c` might work unless you've done some really crazy rebase.
For a better explanation, I'm referencing few rel... |
45177660 | Why is Git merge creating multiple commits on master branch? | 10 | 2017-07-18 21:46:59 | <p>There are two branches I am working with, <code>master</code> and <code>newFeature</code>. While building the "new feature", I added multiple commits to the <code>newFeature</code> branch. My understanding of <code>git merge</code> is that it will create a <em>single</em> commit on <code>master</code> once the bra... | 8,129 | 3,739,391 | 2017-07-24 16:01:42 | 45,177,661 | 13 | 2017-07-18 21:46:59 | 3,739,391 | 2017-07-24 16:01:42 | https://stackoverflow.com/q/45177660 | https://stackoverflow.com/a/45177661 | <p>The key to note here, is that <em>no changes have been made to <code>master</code></em> throughout the course of your work on <code>newVersion</code>. In these situations, Git defaults to a "fast-forward" merge, which can essentially be thought of as taking all of the new commits from <code>newVersion</code> and ap... | <p>The key to note here, is that <em>no changes have been made to <code>master</code></em> throughout the course of your work on <code>newVersion</code>. In these situations, Git defaults to a "fast-forward" merge, which can essentially be thought of as taking all of the new commits from <code>newVersion</code> and ap... | 119, 456, 717, 53850 | git, git-commit, merge, version-control | <h1>Why is Git merge creating multiple commits on master branch?</h1>
<p>There are two branches I am working with, <code>master</code> and <code>newFeature</code>. While building the "new feature", I added multiple commits to the <code>newFeature</code> branch. My understanding of <code>git merge</code> is that it wi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,670 | git | # Why is Git merge creating multiple commits on master branch?
There are two branches I am working with, `master` and `newFeature`. While building the "new feature", I added multiple commits to the `newFeature` branch. My understanding of `git merge` is that it will create a *single* commit on `master` once the branch... | The key to note here, is that *no changes have been made to `master`* throughout the course of your work on `newVersion`. In these situations, Git defaults to a "fast-forward" merge, which can essentially be thought of as taking all of the new commits from `newVersion` and appending them to the most recent commit on `m... |
40536572 | Sourcetree does not launch Beyond compare external merge tool | 10 | 2016-11-10 20:37:36 | <p>Suddenly, when I try to launch "External merge tool" from Sourcetree, the tool does not appear. I say suddenly, because it worked last time I tried. The dialog remains forever: </p>
<p><img src="https://i.sstatic.net/vv4Tf.png" alt="image description"></p>
<p>Eventually I found this process related to the visual ... | 14,600 | 607,407 | 2022-03-07 16:11:06 | 43,804,496 | 13 | 2017-05-05 12:04:43 | 607,407 | 2017-05-05 12:04:43 | https://stackoverflow.com/q/40536572 | https://stackoverflow.com/a/43804496 | <p>I found out that this happens when one of the files to be merged has been deleted. In that case, <code>git</code> prints out a command line prompt which sourcetree cannot handle. The git process then ends up hanging forever.</p>
<p>Best way to handle this is to kill the hanging git process and then make the choice ... | <p>I found out that this happens when one of the files to be merged has been deleted. In that case, <code>git</code> prints out a command line prompt which sourcetree cannot handle. The git process then ends up hanging forever.</p> <p>Best way to handle this is to kill the hanging git process and then make the choice ... | 119, 15129, 90056 | atlassian-sourcetree, beyondcompare, git | <h1>Sourcetree does not launch Beyond compare external merge tool</h1>
<p>Suddenly, when I try to launch "External merge tool" from Sourcetree, the tool does not appear. I say suddenly, because it worked last time I tried. The dialog remains forever: </p>
<p><img src="https://i.sstatic.net/vv4Tf.png" alt="image descr... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,671 | git | # Sourcetree does not launch Beyond compare external merge tool
Suddenly, when I try to launch "External merge tool" from Sourcetree, the tool does not appear. I say suddenly, because it worked last time I tried. The dialog remains forever:

Eventually I found thi... | I found out that this happens when one of the files to be merged has been deleted. In that case, `git` prints out a command line prompt which sourcetree cannot handle. The git process then ends up hanging forever.
Best way to handle this is to kill the hanging git process and then make the choice manually using use mi... |
42079733 | Visual Studio Git error: "The index is locked. This might be due to a concurrent or crashed process." | 10 | 2017-02-07 00:31:01 | <p>Received an error in Git for Visual Studio:</p>
<p><code>The index is locked. This might be due to a concurrent or crashed process.</code></p>
| 12,443 | 1,236,397 | 2025-05-07 11:35:25 | 42,079,734 | 13 | 2017-02-07 00:31:01 | 1,236,397 | 2017-09-11 21:59:46 | https://stackoverflow.com/q/42079733 | https://stackoverflow.com/a/42079734 | <p>Another process may still be running in the background. In my case, I had a command (I keep wanting to say DOS, lol) prompt open with a Git command that paused on <code>Should I try again? (y/n)</code> and I didn't realize. It had created an <code>index.lock</code> file in the <code>.git</code> folder, locking the... | <p>Another process may still be running in the background. In my case, I had a command (I keep wanting to say DOS, lol) prompt open with a Git command that paused on <code>Should I try again? (y/n)</code> and I didn't realize. It had created an <code>index.lock</code> file in the <code>.git</code> folder, locking the... | 119, 33953 | git, visual-studio | <h1>Visual Studio Git error: "The index is locked. This might be due to a concurrent or crashed process."</h1>
<p>Received an error in Git for Visual Studio:</p>
<p><code>The index is locked. This might be due to a concurrent or crashed process.</code></p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,672 | git | # Visual Studio Git error: "The index is locked. This might be due to a concurrent or crashed process."
Received an error in Git for Visual Studio:
`The index is locked. This might be due to a concurrent or crashed process.` | Another process may still be running in the background. In my case, I had a command (I keep wanting to say DOS, lol) prompt open with a Git command that paused on `Should I try again? (y/n)` and I didn't realize. It had created an `index.lock` file in the `.git` folder, locking the `index` file (same folder) in the pro... |
38598099 | Git log - find last use of function | 10 | 2016-07-26 19:13:21 | <p>Is there an easy way to find out at what commit a certain function stopped being used? There have been too many times I find a function that I thought I was using, but nothing seems to be calling it, which leaves me wondering when and why I did this.</p>
| 2,006 | 1,373,572 | 2016-07-27 15:57:23 | 38,599,800 | 13 | 2016-07-26 21:00:36 | 6,194,839 | 2016-07-27 15:57:23 | https://stackoverflow.com/q/38598099 | https://stackoverflow.com/a/38599800 | <h2>git log -S</h2>
<p>From <code>git log --help</code>:</p>
<blockquote>
<p>-S<string></p>
<p>Look for differences that change the number of occurrences of the specified string (i.e. addition/deletion) in a file. Intended for the scripter’s use.</p>
<p>It is useful when you’re looking for an exact blo... | <h2>git log -S</h2> <p>From <code>git log --help</code>:</p> <blockquote> <p>-S<string></p> <p>Look for differences that change the number of occurrences of the specified string (i.e. addition/deletion) in a file. Intended for the scripter’s use.</p> <p>It is useful when you’re looking for an exact blo... | 119 | git | <h1>Git log - find last use of function</h1>
<p>Is there an easy way to find out at what commit a certain function stopped being used? There have been too many times I find a function that I thought I was using, but nothing seems to be calling it, which leaves me wondering when and why I did this.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,673 | git | # Git log - find last use of function
Is there an easy way to find out at what commit a certain function stopped being used? There have been too many times I find a function that I thought I was using, but nothing seems to be calling it, which leaves me wondering when and why I did this. | ## git log -S
From `git log --help`:
> -S<string>
>
> Look for differences that change the number of occurrences of the specified string (i.e. addition/deletion) in a file. Intended for the scripter’s use.
>
> It is useful when you’re looking for an exact block of code (like a struct), and want to know the history of... |
32747089 | How does man find git's subcommand manpages? | 10 | 2015-09-23 18:41:11 | <p>On my linux system, I can do "man git log" (note the space), and this will show me the manpage for git-log(1) (with a dash), as expected.</p>
<p>On my MacOSX machine, "man git log" only shows the manual page for git(1).</p>
<p>How does the linux man know that the two arguments "git" and "log" should be combined to... | 1,499 | 481,788 | 2016-02-24 21:18:58 | 32,750,157 | 13 | 2015-09-23 21:54:52 | 4,518,274 | 2016-02-24 21:18:58 | https://stackoverflow.com/q/32747089 | https://stackoverflow.com/a/32750157 | <p>This is a feature of the <a href="http://man-db.nongnu.org/" rel="noreferrer">particular implementation of <code>man</code></a> used on many Linux systems. Referring to the <a href="http://man7.org/linux/man-pages/man1/man.1.html" rel="noreferrer">documentation</a> (for <code>man</code>), it is mentioned in the des... | <p>This is a feature of the <a href="http://man-db.nongnu.org/" rel="noreferrer">particular implementation of <code>man</code></a> used on many Linux systems. Referring to the <a href="http://man7.org/linux/man-pages/man1/man.1.html" rel="noreferrer">documentation</a> (for <code>man</code>), it is mentioned in the des... | 58, 119, 369, 9524 | git, linux, macos, manpage | <h1>How does man find git's subcommand manpages?</h1>
<p>On my linux system, I can do "man git log" (note the space), and this will show me the manpage for git-log(1) (with a dash), as expected.</p>
<p>On my MacOSX machine, "man git log" only shows the manual page for git(1).</p>
<p>How does the linux man know that t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,675 | git | # How does man find git's subcommand manpages?
On my linux system, I can do "man git log" (note the space), and this will show me the manpage for git-log(1) (with a dash), as expected.
On my MacOSX machine, "man git log" only shows the manual page for git(1).
How does the linux man know that the two arguments "git" ... | This is a feature of the [particular implementation of `man`](http://man-db.nongnu.org/) used on many Linux systems. Referring to the [documentation](http://man7.org/linux/man-pages/man1/man.1.html) (for `man`), it is mentioned in the description of the `--no-subpages` option:
> **`--no-subpages`**
>
> By default, `ma... |
32556762 | Are digit separators allowed before the digits in a hex or binary number? | 10 | 2015-09-14 03:08:37 | <p>C++14 introduced the concept of digit separators into literals, along the lines of <code>3'141'592'653'589</code>. Now this is a <em>great</em> feature for readable code but I was wondering whether it allowed quotes <em>before</em> the numeric portion of a <code>0x/0b</code>-type literal. It seems to me that:</p>
<... | 3,223 | 14,860 | 2015-09-20 21:39:18 | 32,556,808 | 13 | 2015-09-14 03:14:12 | 1,708,801 | 2015-09-18 18:25:35 | https://stackoverflow.com/q/32556762 | https://stackoverflow.com/a/32556808 | <p>If we look at the grammar from the <a href="https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf" rel="noreferrer">draft C++14 standard: N4140</a> section <code>2.14.2</code> <em>[lex.icon]</em>, it is not allowed right after the base indicator of hexadecimal or binary literals:</p>
<pre><code>binary-lit... | <p>If we look at the grammar from the <a href="https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf" rel="noreferrer">draft C++14 standard: N4140</a> section <code>2.14.2</code> <em>[lex.icon]</em>, it is not allowed right after the base indicator of hexadecimal or binary literals:</p> <pre><code>binary-lit... | 10, 106410, 114756 | c++, c++14, digit-separator | <h1>Are digit separators allowed before the digits in a hex or binary number?</h1>
<p>C++14 introduced the concept of digit separators into literals, along the lines of <code>3'141'592'653'589</code>. Now this is a <em>great</em> feature for readable code but I was wondering whether it allowed quotes <em>before</em> th... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,676 | git | # Are digit separators allowed before the digits in a hex or binary number?
C++14 introduced the concept of digit separators into literals, along the lines of `3'141'592'653'589`. Now this is a *great* feature for readable code but I was wondering whether it allowed quotes *before* the numeric portion of a `0x/0b`-typ... | If we look at the grammar from the [draft C++14 standard: N4140](https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf) section `2.14.2` *[lex.icon]*, it is not allowed right after the base indicator of hexadecimal or binary literals:
```
binary-literal:
0b binary-digit
0B binary-digit
binary-literal ’... |
32230161 | Difference between git reset --hard and git checkout | 10 | 2015-08-26 15:01:58 | <p>Let's say I want to undo all changes introduced by previous commits.</p>
<p>As far as I understand, <code>git reset --hard <specified commit></code> will remove all commits up until the specified commit, and undo all changes.<br>
On the other hand <code>git checkout <specified commit></code> will change... | 7,115 | 5,205,383 | 2022-11-15 23:42:27 | 32,230,813 | 13 | 2015-08-26 15:31:41 | 115,493 | 2022-11-15 23:42:27 | https://stackoverflow.com/q/32230161 | https://stackoverflow.com/a/32230813 | <p><em>Commits</em> are trees, <em>branches</em> are pointers to some commits, and <code>HEAD</code> (alias: <code>@</code>) is a pointer to some branch or to some commit (‘detached <code>HEAD</code>’).</p>
<p><code>git checkout <commit></code> moves <em>the <code>HEAD</code></em>, index, and working tree to the ... | <p><em>Commits</em> are trees, <em>branches</em> are pointers to some commits, and <code>HEAD</code> (alias: <code>@</code>) is a pointer to some branch or to some commit (‘detached <code>HEAD</code>’).</p> <p><code>git checkout <commit></code> moves <em>the <code>HEAD</code></em>, index, and working tree to the ... | 119, 456, 37230, 51381 | git, git-checkout, git-reset, version-control | <h1>Difference between git reset --hard and git checkout</h1>
<p>Let's say I want to undo all changes introduced by previous commits.</p>
<p>As far as I understand, <code>git reset --hard <specified commit></code> will remove all commits up until the specified commit, and undo all changes.<br>
On the other hand ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,677 | git | # Difference between git reset --hard and git checkout
Let's say I want to undo all changes introduced by previous commits.
As far as I understand, `git reset --hard <specified commit>` will remove all commits up until the specified commit, and undo all changes.
On the other hand `git checkout <specified commit>` w... | *Commits* are trees, *branches* are pointers to some commits, and `HEAD` (alias: `@`) is a pointer to some branch or to some commit (‘detached `HEAD`’).
`git checkout <commit>` moves *the `HEAD`*, index, and working tree to the specified commit, and keeps any local changes in the index and working tree [if possible](h... |
30828957 | How can I push git-replace to a remote repo? | 10 | 2015-06-14 11:45:47 | <p>I have used "git replace" to substitute a branch (with no common ancestor) 22b2b25 for a commit in master. I want this change to be permanent. I'm not interested in the previous history. In the output below the top five commits are from the original master branch and the bottom 2 come from a different branch.</p>... | 3,025 | 96,167 | 2024-09-23 21:13:16 | 31,356,704 | 13 | 2015-07-11 11:28:27 | 6,309 | 2024-09-23 21:13:16 | https://stackoverflow.com/q/30828957 | https://stackoverflow.com/a/31356704 | <p><a href="http://git-scm.com/docs/git-replace" rel="nofollow noreferrer"><code>git replace</code></a> alone isn't enough: replacing one commit isn't enough.</p>
<p>The next commit must now reference the replaced commit as a parent.</p>
<p>Update (inspired from <a href="https://stackoverflow.com/users/1246387/stephen"... | <p><a href="http://git-scm.com/docs/git-replace" rel="nofollow noreferrer"><code>git replace</code></a> alone isn't enough: replacing one commit isn't enough.</p> <p>The next commit must now reference the replaced commit as a parent.</p> <p>Update (inspired from <a href="https://stackoverflow.com/users/1246387/stephen"... | 119 | git | <h1>How can I push git-replace to a remote repo?</h1>
<p>I have used "git replace" to substitute a branch (with no common ancestor) 22b2b25 for a commit in master. I want this change to be permanent. I'm not interested in the previous history. In the output below the top five commits are from the original master bra... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,678 | git | # How can I push git-replace to a remote repo?
I have used "git replace" to substitute a branch (with no common ancestor) 22b2b25 for a commit in master. I want this change to be permanent. I'm not interested in the previous history. In the output below the top five commits are from the original master branch and the ... | [`git replace`](http://git-scm.com/docs/git-replace) alone isn't enough: replacing one commit isn't enough.
The next commit must now reference the replaced commit as a parent.
Update (inspired from [Stephen](https://stackoverflow.com/users/1246387/stephen)'s comment)
As I noted in Oct. 2019 in "[Git commands that co... |
28044420 | What is the git pretty format equivalent of "medium"? (OR: why no LF in %s) | 10 | 2015-01-20 11:37:58 | <p>I was trying to work out the <code>git log --pretty=format:...</code> equivalent for the default <code>git log</code> behaviour. I can find that the default is "medium", but cannot track down what pretty format string that corresponds to (so that I can copy parts of it).</p>
<p>My real question is why <code>%s</cod... | 1,327 | 841,830 | 2015-01-20 12:37:40 | 28,045,008 | 13 | 2015-01-20 12:06:59 | 974,186 | 2015-01-20 12:37:40 | https://stackoverflow.com/q/28044420 | https://stackoverflow.com/a/28045008 | <p>You can use the line wrapping format <code>%w</code> to reintroduce new lines by setting the width to <code>0</code>.</p>
<pre><code>%w(width[,<indent1>[,<indent2>]])
</code></pre>
<p>This format is equivalent to <code>medium</code></p>
<pre><code>git log --pretty="format:%C(yellow)commit %H%n%C(white... | <p>You can use the line wrapping format <code>%w</code> to reintroduce new lines by setting the width to <code>0</code>.</p> <pre><code>%w(width[,<indent1>[,<indent2>]]) </code></pre> <p>This format is equivalent to <code>medium</code></p> <pre><code>git log --pretty="format:%C(yellow)commit %H%n%C(white... | 119 | git | <h1>What is the git pretty format equivalent of "medium"? (OR: why no LF in %s)</h1>
<p>I was trying to work out the <code>git log --pretty=format:...</code> equivalent for the default <code>git log</code> behaviour. I can find that the default is "medium", but cannot track down what pretty format string that correspon... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,679 | git | # What is the git pretty format equivalent of "medium"? (OR: why no LF in %s)
I was trying to work out the `git log --pretty=format:...` equivalent for the default `git log` behaviour. I can find that the default is "medium", but cannot track down what pretty format string that corresponds to (so that I can copy parts... | You can use the line wrapping format `%w` to reintroduce new lines by setting the width to `0`.
```
%w(width[,<indent1>[,<indent2>]])
```
This format is equivalent to `medium`
```
git log --pretty="format:%C(yellow)commit %H%n%C(white)Author: %an <%ae>%nDate: %ad%n%n%w(0,4,4)%B%n"
``` |
18323311 | Mercurial equivalent of "git pull --rebase" | 10 | 2013-08-19 21:19:09 | <p>Is there a Mercurial equivalent of <code>git pull --rebase</code>?</p>
| 6,282 | 2,112,633 | 2017-03-30 03:13:42 | 18,325,041 | 13 | 2013-08-20 00:18:05 | 8,992 | 2017-03-30 03:13:42 | https://stackoverflow.com/q/18323311 | https://stackoverflow.com/a/18325041 | <p>Try <code>hg pull --rebase</code>. Mecurial's pull is git's fetch, and git's fetch is mercurial's pull, but when you're rebasing you're updating the working dir either way, so <code>hg pull --rebase</code> is your guy.</p>
<p>NOTE: Because <code>rebase</code> alters history, it's disabled by default. You can turn ... | <p>Try <code>hg pull --rebase</code>. Mecurial's pull is git's fetch, and git's fetch is mercurial's pull, but when you're rebasing you're updating the working dir either way, so <code>hg pull --rebase</code> is your guy.</p> <p>NOTE: Because <code>rebase</code> alters history, it's disabled by default. You can turn ... | 119, 802, 29934 | git, git-rebase, mercurial | <h1>Mercurial equivalent of "git pull --rebase"</h1>
<p>Is there a Mercurial equivalent of <code>git pull --rebase</code>?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,680 | git | # Mercurial equivalent of "git pull --rebase"
Is there a Mercurial equivalent of `git pull --rebase`? | Try `hg pull --rebase`. Mecurial's pull is git's fetch, and git's fetch is mercurial's pull, but when you're rebasing you're updating the working dir either way, so `hg pull --rebase` is your guy.
NOTE: Because `rebase` alters history, it's disabled by default. You can turn it on (no need to download, you already have... |
17850483 | Migrating a Gerrit project into a different instance of Gerrit | 10 | 2013-07-25 06:21:18 | <p>I have <code>MainGerritServer</code> which hosts many projects.<br>
Also, I have <code>RogueGerritServer</code> which also hosts many projects.</p>
<p>I'm looking for a way to move a <code>ProjectA</code> from <code>RogueGerritServer</code> to <code>MainGerritServer</code> while preserving both Git commit history a... | 12,082 | 899,207 | 2017-08-28 17:03:02 | 17,851,030 | 13 | 2013-07-25 06:53:51 | 1,138,252 | 2013-07-25 06:53:51 | https://stackoverflow.com/q/17850483 | https://stackoverflow.com/a/17851030 | <p>I've been moving a lot of git projects around lately and although I've mostly been moving from Gerrit (due to department fiat, Gerrit's a fine choice IMO) this should work the same and is relatively easy. Moving the Gerrit history, however will be more difficult.</p>
<p>Here's how to move a repo:</p>
<ol>
<li>Clon... | <p>I've been moving a lot of git projects around lately and although I've mostly been moving from Gerrit (due to department fiat, Gerrit's a fine choice IMO) this should work the same and is relatively easy. Moving the Gerrit history, however will be more difficult.</p> <p>Here's how to move a repo:</p> <ol> <li>Clon... | 97, 119, 6538, 52272 | gerrit, git, migrate, migration | <h1>Migrating a Gerrit project into a different instance of Gerrit</h1>
<p>I have <code>MainGerritServer</code> which hosts many projects.<br>
Also, I have <code>RogueGerritServer</code> which also hosts many projects.</p>
<p>I'm looking for a way to move a <code>ProjectA</code> from <code>RogueGerritServer</code> to ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,681 | git | # Migrating a Gerrit project into a different instance of Gerrit
I have `MainGerritServer` which hosts many projects.
Also, I have `RogueGerritServer` which also hosts many projects.
I'm looking for a way to move a `ProjectA` from `RogueGerritServer` to `MainGerritServer` while preserving both Git commit history as... | I've been moving a lot of git projects around lately and although I've mostly been moving from Gerrit (due to department fiat, Gerrit's a fine choice IMO) this should work the same and is relatively easy. Moving the Gerrit history, however will be more difficult.
Here's how to move a repo:
1. Clone the project from t... |
16200359 | "git clean -xdf" with some additional filter | 10 | 2013-04-24 19:15:56 | <p>Is it possible to do <strong>git clean -xdf</strong> with some additional filter? What I want to do is delete all untracked files but keep files with a certain file extension.</p>
| 6,951 | 584,492 | 2013-04-24 19:23:43 | 16,200,498 | 13 | 2013-04-24 19:23:43 | 46,194 | 2013-04-24 19:23:43 | https://stackoverflow.com/q/16200359 | https://stackoverflow.com/a/16200498 | <p>Use the <code>-e</code> option to specify an exclude pattern.</p>
<p>Example: This deletes all untracked files except those with the <code>.txt</code> extension:</p>
<pre><code>git clean -xdfe *.txt
</code></pre>
| <p>Use the <code>-e</code> option to specify an exclude pattern.</p> <p>Example: This deletes all untracked files except those with the <code>.txt</code> extension:</p> <pre><code>git clean -xdfe *.txt </code></pre> | 119 | git | <h1>"git clean -xdf" with some additional filter</h1>
<p>Is it possible to do <strong>git clean -xdf</strong> with some additional filter? What I want to do is delete all untracked files but keep files with a certain file extension.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,682 | git | # "git clean -xdf" with some additional filter
Is it possible to do **git clean -xdf** with some additional filter? What I want to do is delete all untracked files but keep files with a certain file extension. | Use the `-e` option to specify an exclude pattern.
Example: This deletes all untracked files except those with the `.txt` extension:
```
git clean -xdfe *.txt
``` |
14591888 | Apply patches created with git log -p | 10 | 2013-01-29 20:44:03 | <p>I have a file of patches (all of which apply to a single file) generated with</p>
<pre><code>git log -p file-of-interest.txt >patches.txt
</code></pre>
<p>Now I want to apply these patches in another repo, but when I try</p>
<pre><code>git am patches.txt
</code></pre>
<p>I get the error message "Patch format ... | 8,346 | 47,161 | 2019-10-09 20:33:49 | 14,592,810 | 13 | 2013-01-29 21:39:57 | 1,253,222 | 2013-01-30 02:03:06 | https://stackoverflow.com/q/14591888 | https://stackoverflow.com/a/14592810 | <p>You need to break the patches down into individual patches. You could do that manually from your <code>git log -p</code> output, then use <code>git apply</code> to apply them in sequence. <code>git log -p</code> output wasn't really intended for <code>git</code> to process...</p>
<p>But a better option would be to ... | <p>You need to break the patches down into individual patches. You could do that manually from your <code>git log -p</code> output, then use <code>git apply</code> to apply them in sequence. <code>git log -p</code> output wasn't really intended for <code>git</code> to process...</p> <p>But a better option would be to ... | 119, 2132 | git, patch | <h1>Apply patches created with git log -p</h1>
<p>I have a file of patches (all of which apply to a single file) generated with</p>
<pre><code>git log -p file-of-interest.txt >patches.txt
</code></pre>
<p>Now I want to apply these patches in another repo, but when I try</p>
<pre><code>git am patches.txt
</code></... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,683 | git | # Apply patches created with git log -p
I have a file of patches (all of which apply to a single file) generated with
```
git log -p file-of-interest.txt >patches.txt
```
Now I want to apply these patches in another repo, but when I try
```
git am patches.txt
```
I get the error message "Patch format detection fai... | You need to break the patches down into individual patches. You could do that manually from your `git log -p` output, then use `git apply` to apply them in sequence. `git log -p` output wasn't really intended for `git` to process...
But a better option would be to use `git format-patch` to create the sequence of patch... |
12093966 | Fixing Git History after Fetching Wrong Repo | 10 | 2012-08-23 14:29:50 | <p>I made a mistake setting up a remote on my git repo and fetched from a totally different project.</p>
<p>Fortunately, there was no merge, but I now have the history of 2 projects floating around in my repo and I'm trying to figure out how to get my repo back to the state it was in before I made the erroneous fetch.... | 992 | 110,255 | 2012-08-23 14:32:52 | 12,094,026 | 13 | 2012-08-23 14:32:52 | 223,339 | 2012-08-23 14:32:52 | https://stackoverflow.com/q/12093966 | https://stackoverflow.com/a/12094026 | <p>You just need to remove the dangling tag (<code>0.1.something</code>, where <code>something</code> isn't visible in your screenshot) using <code>git tag -d 0.1.something</code>. Once this is done, the commits will be gc-able.</p>
<p>As long as there is a tag that reaches a commit, this commit is considered reachabl... | <p>You just need to remove the dangling tag (<code>0.1.something</code>, where <code>something</code> isn't visible in your screenshot) using <code>git tag -d 0.1.something</code>. Once this is done, the commits will be gc-able.</p> <p>As long as there is a tag that reaches a commit, this commit is considered reachabl... | 119 | git | <h1>Fixing Git History after Fetching Wrong Repo</h1>
<p>I made a mistake setting up a remote on my git repo and fetched from a totally different project.</p>
<p>Fortunately, there was no merge, but I now have the history of 2 projects floating around in my repo and I'm trying to figure out how to get my repo back to ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,685 | git | # Fixing Git History after Fetching Wrong Repo
I made a mistake setting up a remote on my git repo and fetched from a totally different project.
Fortunately, there was no merge, but I now have the history of 2 projects floating around in my repo and I'm trying to figure out how to get my repo back to the state it was... | You just need to remove the dangling tag (`0.1.something`, where `something` isn't visible in your screenshot) using `git tag -d 0.1.something`. Once this is done, the commits will be gc-able.
As long as there is a tag that reaches a commit, this commit is considered reachable and will thus persist "forever", it's eff... |
9858055 | How do I determine what branch I have checked out in git? | 10 | 2012-03-25 05:06:58 | <p>I clone my source using <code>git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git w/</code>. Then I specify a specific branch/tag by doing <code>git checkout <tag name></code> or <code>git checkout origin/REL<release number></code>. Sometimes I forget what branch I'm on.</p>
<p>In SVN I would d... | 10,495 | 155,823 | 2023-07-11 06:29:59 | 9,858,064 | 13 | 2012-03-25 05:08:32 | 148,870 | 2012-03-25 05:08:32 | https://stackoverflow.com/q/9858055 | https://stackoverflow.com/a/9858064 | <pre><code>git branch
</code></pre>
<p>tells you what branch you're on (with a <code>*</code> marker).</p>
<p>Tags are just names for revisions, so Git won't tell you that you're "on" a tag, but you can use <code>git name-rev HEAD</code> to get a sense for what it might be.</p>
| <pre><code>git branch </code></pre> <p>tells you what branch you're on (with a <code>*</code> marker).</p> <p>Tags are just names for revisions, so Git won't tell you that you're "on" a tag, but you can use <code>git name-rev HEAD</code> to get a sense for what it might be.</p> | 119, 1097, 1879 | branch, git, tagging | <h1>How do I determine what branch I have checked out in git?</h1>
<p>I clone my source using <code>git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git w/</code>. Then I specify a specific branch/tag by doing <code>git checkout <tag name></code> or <code>git checkout origin/REL<release number></co... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,686 | git | # How do I determine what branch I have checked out in git?
I clone my source using `git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git w/`. Then I specify a specific branch/tag by doing `git checkout <tag name>` or `git checkout origin/REL<release number>`. Sometimes I forget what branch I'm on.
In SVN I ... | ```
git branch
```
tells you what branch you're on (with a `*` marker).
Tags are just names for revisions, so Git won't tell you that you're "on" a tag, but you can use `git name-rev HEAD` to get a sense for what it might be. |
9742078 | How do you ignore whitespace when using git whatchanged -p? | 10 | 2012-03-16 17:46:47 | <p>I can use</p>
<pre><code>git whatchanged -p
</code></pre>
<p>to show a log of all the changes I've made to a repository with diffs inline.</p>
<p>I can use</p>
<pre><code>git diff -b
</code></pre>
<p>or</p>
<pre><code>git diff -w
</code></pre>
<p>to show a single diff that ignores various amounts of whitespac... | 4,836 | 890,779 | 2012-03-16 17:52:36 | 9,742,146 | 13 | 2012-03-16 17:52:36 | 87,858 | 2012-03-16 17:52:36 | https://stackoverflow.com/q/9742078 | https://stackoverflow.com/a/9742146 | <p>What about using <code>git log -p -w</code>? I believe that is the same output as <code>whatchanged -p</code>.</p>
| <p>What about using <code>git log -p -w</code>? I believe that is the same output as <code>whatchanged -p</code>.</p> | 119 | git | <h1>How do you ignore whitespace when using git whatchanged -p?</h1>
<p>I can use</p>
<pre><code>git whatchanged -p
</code></pre>
<p>to show a log of all the changes I've made to a repository with diffs inline.</p>
<p>I can use</p>
<pre><code>git diff -b
</code></pre>
<p>or</p>
<pre><code>git diff -w
</code></pre... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,687 | git | # How do you ignore whitespace when using git whatchanged -p?
I can use
```
git whatchanged -p
```
to show a log of all the changes I've made to a repository with diffs inline.
I can use
```
git diff -b
```
or
```
git diff -w
```
to show a single diff that ignores various amounts of whitespace changes.
How can... | What about using `git log -p -w`? I believe that is the same output as `whatchanged -p`. |
8961619 | How to push local Git repo to newly created Google Code project? | 10 | 2012-01-22 14:05:50 | <p>I have a local git repo created by Qt Creator during the New Project Wizard. I've made many commits there. I have created a new Google Code project only now. What is the best way to sync the remote repo to my local one?</p>
| 7,039 | 492,336 | 2012-01-22 14:19:05 | 8,961,638 | 13 | 2012-01-22 14:08:38 | 6,309 | 2012-01-22 14:19:05 | https://stackoverflow.com/q/8961619 | https://stackoverflow.com/a/8961638 | <p>You can see an example at <a href="http://alblue.bandlem.com/2011/07/setting-up-google-code-with-git.html" rel="nofollow noreferrer">this article "Setting up Google Code with Git"</a> from <a href="http://alblue.bandlem.com/" rel="nofollow noreferrer">AlBlue’s Blog</a>:</p>
<pre><code>$ cd /path/to/existing/local/... | <p>You can see an example at <a href="http://alblue.bandlem.com/2011/07/setting-up-google-code-with-git.html" rel="nofollow noreferrer">this article "Setting up Google Code with Git"</a> from <a href="http://alblue.bandlem.com/" rel="nofollow noreferrer">AlBlue’s Blog</a>:</p> <pre><code>$ cd /path/to/existing/local/... | 119, 3682, 26924 | git, google-code, qt-creator | <h1>How to push local Git repo to newly created Google Code project?</h1>
<p>I have a local git repo created by Qt Creator during the New Project Wizard. I've made many commits there. I have created a new Google Code project only now. What is the best way to sync the remote repo to my local one?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,688 | git | # How to push local Git repo to newly created Google Code project?
I have a local git repo created by Qt Creator during the New Project Wizard. I've made many commits there. I have created a new Google Code project only now. What is the best way to sync the remote repo to my local one? | You can see an example at [this article "Setting up Google Code with Git"](http://alblue.bandlem.com/2011/07/setting-up-google-code-with-git.html) from [AlBlue’s Blog](http://alblue.bandlem.com/):
```
$ cd /path/to/existing/local/repo
$ git remote add googlecode https://project.googlecode.com/git
$ git push googlecode... |
7758113 | How to "git log" the entire repository and not just the branch you are on? | 10 | 2011-10-13 17:39:48 | <p>The question is simple: I want to see the output of <code>git log</code>, but for the entire repository. Currently it just shows the changesets in the branch I am on: <code>git log --all --source --graph</code>.</p>
<p>For example, it would be perfect if I could see the last 100 commits in the repository no matter ... | 3,286 | 283,055 | 2011-10-13 18:07:23 | 7,758,413 | 13 | 2011-10-13 18:03:04 | 105,938 | 2011-10-13 18:03:04 | https://stackoverflow.com/q/7758113 | https://stackoverflow.com/a/7758413 | <p>Give this command a try:</p>
<pre><code>git log --all --graph --decorate --pretty=oneline --abbrev-commit
</code></pre>
<p>You already had the right start with <code>--all --graph</code>. Adding in <code>--decorate</code> will show any branches or tags pointing to a commit, and the others two, <code>--pretty=oneli... | <p>Give this command a try:</p> <pre><code>git log --all --graph --decorate --pretty=oneline --abbrev-commit </code></pre> <p>You already had the right start with <code>--all --graph</code>. Adding in <code>--decorate</code> will show any branches or tags pointing to a commit, and the others two, <code>--pretty=oneli... | 119 | git | <h1>How to "git log" the entire repository and not just the branch you are on?</h1>
<p>The question is simple: I want to see the output of <code>git log</code>, but for the entire repository. Currently it just shows the changesets in the branch I am on: <code>git log --all --source --graph</code>.</p>
<p>For example, ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,689 | git | # How to "git log" the entire repository and not just the branch you are on?
The question is simple: I want to see the output of `git log`, but for the entire repository. Currently it just shows the changesets in the branch I am on: `git log --all --source --graph`.
For example, it would be perfect if I could see the... | Give this command a try:
```
git log --all --graph --decorate --pretty=oneline --abbrev-commit
```
You already had the right start with `--all --graph`. Adding in `--decorate` will show any branches or tags pointing to a commit, and the others two, `--pretty=oneline --abbrev-commit` are just to clean up and compact t... |
6457395 | phpstorm git pull --rebase | 10 | 2011-06-23 16:23:25 | <p>In phpstorm how do you do a <code>git pull --rebase</code>? I can't seem to find an option to do it. I would like this to be the default behavior as we are all working off the same branch.</p>
<p>I am doing the pull by <code>Version Control > Git > Pull Changes...</code>.</p>
| 5,130 | 502,340 | 2011-06-23 18:23:38 | 6,458,837 | 13 | 2011-06-23 18:23:38 | 72,788 | 2011-06-23 18:23:38 | https://stackoverflow.com/q/6457395 | https://stackoverflow.com/a/6458837 | <p>Just use the <code>Version Control -> Update Project</code> action.
There you may choose the way of update: via merge (<code>git pull</code>) or via rebase (<code>git pull --rebase</code>) or via the default way for the current branch (it is merge by default).</p>
<p>The action also has more capabilities than P... | <p>Just use the <code>Version Control -> Update Project</code> action. There you may choose the way of update: via merge (<code>git pull</code>) or via rebase (<code>git pull --rebase</code>) or via the default way for the current branch (it is merge by default).</p> <p>The action also has more capabilities than P... | 64, 119, 66821 | git, phpstorm, windows | <h1>phpstorm git pull --rebase</h1>
<p>In phpstorm how do you do a <code>git pull --rebase</code>? I can't seem to find an option to do it. I would like this to be the default behavior as we are all working off the same branch.</p>
<p>I am doing the pull by <code>Version Control > Git > Pull Changes...</code>.</... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,690 | git | # phpstorm git pull --rebase
In phpstorm how do you do a `git pull --rebase`? I can't seem to find an option to do it. I would like this to be the default behavior as we are all working off the same branch.
I am doing the pull by `Version Control > Git > Pull Changes...`. | Just use the `Version Control -> Update Project` action.
There you may choose the way of update: via merge (`git pull`) or via rebase (`git pull --rebase`) or via the default way for the current branch (it is merge by default).
The action also has more capabilities than Pull: it stashes/slelves your uncommitted change... |
5952591 | GIT Xcode - change origin | 10 | 2011-05-10 15:33:46 | <p>How can i change the origin url in the GIT Repository. I dont want to add a new repo. I want to change the old one.Please help me. I find option to add new one but not change the existing one.</p>
<p>Thanks</p>
| 5,687 | 589,560 | 2014-09-11 19:12:13 | 5,952,993 | 13 | 2011-05-10 16:05:45 | 526,535 | 2011-05-10 16:05:45 | https://stackoverflow.com/q/5952591 | https://stackoverflow.com/a/5952993 | <p>I don't think you can do that from XCode4, much like many other things.</p>
<p>Do <code>git remote set-url origin <newurl></code> like @Dan Ray suggests, or go to .git/config and edit the url to the new one.</p>
<p>And one piece of advice, Git is enjoyed through the command line, so where the IDE/ GUI doesn'... | <p>I don't think you can do that from XCode4, much like many other things.</p> <p>Do <code>git remote set-url origin <newurl></code> like @Dan Ray suggests, or go to .git/config and edit the url to the new one.</p> <p>And one piece of advice, Git is enjoyed through the command line, so where the IDE/ GUI doesn'... | 119, 908 | git, xcode | <h1>GIT Xcode - change origin</h1>
<p>How can i change the origin url in the GIT Repository. I dont want to add a new repo. I want to change the old one.Please help me. I find option to add new one but not change the existing one.</p>
<p>Thanks</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,691 | git | # GIT Xcode - change origin
How can i change the origin url in the GIT Repository. I dont want to add a new repo. I want to change the old one.Please help me. I find option to add new one but not change the existing one.
Thanks | I don't think you can do that from XCode4, much like many other things.
Do `git remote set-url origin <newurl>` like @Dan Ray suggests, or go to .git/config and edit the url to the new one.
And one piece of advice, Git is enjoyed through the command line, so where the IDE/ GUI doesn't work, be happy to work from the ... |
5612337 | How to deal with Git submodules on a repo that is converted to Mercurial | 10 | 2011-04-10 14:16:35 | <p>Here goes:</p>
<pre><code>$ cat .gitmodules
[submodule "utils/external/firepython"]
path = utils/external/firepython
url = git://github.com/darwin/firepython.git
[submodule "utils/external/textile"]
path = utils/external/textile
url = git://github.com/jsamsa/python-textile.git
</code></pre>
<p>Whi... | 1,629 | 321,731 | 2018-02-22 12:53:05 | 5,613,011 | 13 | 2011-04-10 16:08:55 | 110,204 | 2018-02-22 12:53:05 | https://stackoverflow.com/q/5612337 | https://stackoverflow.com/a/5613011 | <p>Mercurial supports <a href="https://www.mercurial-scm.org/wiki/Subrepository" rel="nofollow noreferrer">subrepositories</a> of different kinds: Mercurial, Subversion, and Git. So you can create a <code>.hgsub</code> file with</p>
<pre><code>utils/external/firepython = [git]git://github.com/darwin/firepython.git
uti... | <p>Mercurial supports <a href="https://www.mercurial-scm.org/wiki/Subrepository" rel="nofollow noreferrer">subrepositories</a> of different kinds: Mercurial, Subversion, and Git. So you can create a <code>.hgsub</code> file with</p> <pre><code>utils/external/firepython = [git]git://github.com/darwin/firepython.git uti... | 119, 802, 3346, 41612, 65209 | dvcs, git, git-submodules, mercurial, mercurial-subrepos | <h1>How to deal with Git submodules on a repo that is converted to Mercurial</h1>
<p>Here goes:</p>
<pre><code>$ cat .gitmodules
[submodule "utils/external/firepython"]
path = utils/external/firepython
url = git://github.com/darwin/firepython.git
[submodule "utils/external/textile"]
path = utils/external/... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,692 | git | # How to deal with Git submodules on a repo that is converted to Mercurial
Here goes:
```
$ cat .gitmodules
[submodule "utils/external/firepython"]
path = utils/external/firepython
url = git://github.com/darwin/firepython.git
[submodule "utils/external/textile"]
path = utils/external/textile
url = gi... | Mercurial supports [subrepositories](https://www.mercurial-scm.org/wiki/Subrepository) of different kinds: Mercurial, Subversion, and Git. So you can create a `.hgsub` file with
```
utils/external/firepython = [git]git://github.com/darwin/firepython.git
utils/external/textile = [git]git://github.com/jsamsa/python-t... |
5280212 | Error on branch creation: "warning: refname 'master' is ambiguous." | 10 | 2011-03-12 01:36:38 | <p>I've had simple project being managed in a Git repository. To date I haven't intentionally created any branches, but when I tried to create my first today using</p>
<pre><code>$ git branch mybranch
</code></pre>
<p>I see this error:</p>
<pre><code>warning: refname 'master' is ambiguous.
fatal: Ambiguous object na... | 12,361 | 265,005 | 2021-10-27 05:23:43 | 5,280,248 | 13 | 2011-03-12 01:42:56 | 211,563 | 2011-03-12 01:42:56 | https://stackoverflow.com/q/5280212 | https://stackoverflow.com/a/5280248 | <p>It seems it's ambiguous because your remote name and branch name are both <code>master</code>. You can try renaming the remote to the more conventional <code>origin</code> by running</p>
<pre><code>git remote rename master origin
</code></pre>
| <p>It seems it's ambiguous because your remote name and branch name are both <code>master</code>. You can try renaming the remote to the more conventional <code>origin</code> by running</p> <pre><code>git remote rename master origin </code></pre> | 119, 76220 | git, git-branch | <h1>Error on branch creation: "warning: refname 'master' is ambiguous."</h1>
<p>I've had simple project being managed in a Git repository. To date I haven't intentionally created any branches, but when I tried to create my first today using</p>
<pre><code>$ git branch mybranch
</code></pre>
<p>I see this error:</p>
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,693 | git | # Error on branch creation: "warning: refname 'master' is ambiguous."
I've had simple project being managed in a Git repository. To date I haven't intentionally created any branches, but when I tried to create my first today using
```
$ git branch mybranch
```
I see this error:
```
warning: refname 'master' is ambi... | It seems it's ambiguous because your remote name and branch name are both `master`. You can try renaming the remote to the more conventional `origin` by running
```
git remote rename master origin
``` |
5251492 | git problem - got detached from branch | 10 | 2011-03-09 20:04:22 | <p>Accidently I got detached from my application branch:</p>
<blockquote>
<p>Not currently on any branch.
nothing
to commit (working directory clean)</p>
</blockquote>
<p>How can I return to the branch?</p>
| 12,548 | 527,106 | 2011-03-09 21:30:21 | 5,251,519 | 13 | 2011-03-09 20:06:20 | 223,092 | 2011-03-09 20:29:26 | https://stackoverflow.com/q/5251492 | https://stackoverflow.com/a/5251519 | <p>Try:</p>
<pre><code>git checkout master
</code></pre>
<p>... or whatever branch you were previously on. To give some further explanation:</p>
<p>One of the most common uses of <code>git checkout</code> is to switch from one branch to another. e.g. <code>git checkout experiment</code>, <code>git checkout master</... | <p>Try:</p> <pre><code>git checkout master </code></pre> <p>... or whatever branch you were previously on. To give some further explanation:</p> <p>One of the most common uses of <code>git checkout</code> is to switch from one branch to another. e.g. <code>git checkout experiment</code>, <code>git checkout master</... | 119 | git | <h1>git problem - got detached from branch</h1>
<p>Accidently I got detached from my application branch:</p>
<blockquote>
<p>Not currently on any branch.
nothing
to commit (working directory clean)</p>
</blockquote>
<p>How can I return to the branch?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,694 | git | # git problem - got detached from branch
Accidently I got detached from my application branch:
> Not currently on any branch.
> nothing
> to commit (working directory clean)
How can I return to the branch? | Try:
```
git checkout master
```
... or whatever branch you were previously on. To give some further explanation:
One of the most common uses of `git checkout` is to switch from one branch to another. e.g. `git checkout experiment`, `git checkout master`. However, you can also give it the name of a tag, or the SHA1 ... |
4532835 | update version each time git push is done? | 10 | 2010-12-26 05:08:42 | <p>how do we do like changing version ( each +1 ) using git on each push?</p>
<p>example i have a 2 php file </p>
<pre><code>libs/lib1.php
libs/lib2.php
</code></pre>
<p>on each header usually there is some information like</p>
<pre><code>/**
* LIB1.PHP
* this libs does something like this
* and that this is a d... | 6,223 | 320,486 | 2017-01-08 22:09:13 | 4,532,896 | 13 | 2010-12-26 05:39:58 | 90,848 | 2017-01-08 22:09:13 | https://stackoverflow.com/q/4532835 | https://stackoverflow.com/a/4532896 | <p>What you're asking for is essentially keyword expansion. To start, take a look at the Git FAQ question "<a href="https://git.wiki.kernel.org/index.php/GitFaq#Does_git_have_keyword_expansion.3F" rel="nofollow noreferrer">Does git have keyword expansion?</a>". It says:</p>
<blockquote>
<p>Keyword expansion is not r... | <p>What you're asking for is essentially keyword expansion. To start, take a look at the Git FAQ question "<a href="https://git.wiki.kernel.org/index.php/GitFaq#Does_git_have_keyword_expansion.3F" rel="nofollow noreferrer">Does git have keyword expansion?</a>". It says:</p> <blockquote> <p>Keyword expansion is not r... | 119, 41155 | git, post-update | <h1>update version each time git push is done?</h1>
<p>how do we do like changing version ( each +1 ) using git on each push?</p>
<p>example i have a 2 php file </p>
<pre><code>libs/lib1.php
libs/lib2.php
</code></pre>
<p>on each header usually there is some information like</p>
<pre><code>/**
* LIB1.PHP
* this l... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,695 | git | # update version each time git push is done?
how do we do like changing version ( each +1 ) using git on each push?
example i have a 2 php file
```
libs/lib1.php
libs/lib2.php
```
on each header usually there is some information like
```
/**
* LIB1.PHP
* this libs does something like this
* and that this is a d... | What you're asking for is essentially keyword expansion. To start, take a look at the Git FAQ question "[Does git have keyword expansion?](https://git.wiki.kernel.org/index.php/GitFaq#Does_git_have_keyword_expansion.3F)". It says:
> Keyword expansion is not recommended. Keyword expansion causes all sorts of strange pr... |
4068453 | Git: How to overwrite local change? | 10 | 2010-11-01 11:28:07 | <p>I use git clone from github and I deleted some files & modified some files. Now I want to keep my local code & restore to the original form. Is there a command to achieve this?</p>
| 24,967 | 446,929 | 2019-08-22 11:56:44 | 4,068,654 | 13 | 2010-11-01 12:00:33 | 410,556 | 2010-11-01 12:00:33 | https://stackoverflow.com/q/4068453 | https://stackoverflow.com/a/4068654 | <p>If you want to save you changes first, you can commit them before and then checkout you code to previous commit(s):
<code>git checkout HEAD^</code> (one commit back)
<code>git checkout GEAD~2</code> (2 commits back)</p>
<p>Or, if you don't need your changes anymore, run <code>git reset --hard HEAD</code></p>
| <p>If you want to save you changes first, you can commit them before and then checkout you code to previous commit(s): <code>git checkout HEAD^</code> (one commit back) <code>git checkout GEAD~2</code> (2 commits back)</p> <p>Or, if you don't need your changes anymore, run <code>git reset --hard HEAD</code></p> | 119, 5377 | git, restore | <h1>Git: How to overwrite local change?</h1>
<p>I use git clone from github and I deleted some files & modified some files. Now I want to keep my local code & restore to the original form. Is there a command to achieve this?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,696 | git | # Git: How to overwrite local change?
I use git clone from github and I deleted some files & modified some files. Now I want to keep my local code & restore to the original form. Is there a command to achieve this? | If you want to save you changes first, you can commit them before and then checkout you code to previous commit(s):
`git checkout HEAD^` (one commit back)
`git checkout GEAD~2` (2 commits back)
Or, if you don't need your changes anymore, run `git reset --hard HEAD` |
3983334 | how to use nested branches through git-svn | 10 | 2010-10-21 00:15:45 | <p>our svn server has a trunk called Dev and Branches live in </p>
<pre>
/Branches/Release/1.0/
/2.0/
/2.3.4/
</pre>
<p>i cloned it with something like <code>git svn clone -T Dev ... -b Branches ...</code><br>
when I run <code>git branch 2.1 remotes/Release/2.1</code> i get:<br>
<cod... | 3,262 | 90,801 | 2010-10-21 07:08:59 | 3,985,094 | 13 | 2010-10-21 07:08:59 | 6,309 | 2010-10-21 07:08:59 | https://stackoverflow.com/q/3983334 | https://stackoverflow.com/a/3985094 | <p>As mentioned in "<a href="https://stackoverflow.com/questions/258590/how-do-i-import-svn-branches-rooted-in-different-directories-into-git-using-git-s">How do I import svn branches rooted in different directories into git using git-svn?</a>", you need to grab all the nested branch during the initial import:</p>
<pr... | <p>As mentioned in "<a href="https://stackoverflow.com/questions/258590/how-do-i-import-svn-branches-rooted-in-different-directories-into-git-using-git-s">How do I import svn branches rooted in different directories into git using git-svn?</a>", you need to grab all the nested branch during the initial import:</p> <pr... | 63, 119, 1879, 6452 | branch, git, git-svn, svn | <h1>how to use nested branches through git-svn</h1>
<p>our svn server has a trunk called Dev and Branches live in </p>
<pre>
/Branches/Release/1.0/
/2.0/
/2.3.4/
</pre>
<p>i cloned it with something like <code>git svn clone -T Dev ... -b Branches ...</code><br>
when I run <code>git b... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,697 | git | # how to use nested branches through git-svn
our svn server has a trunk called Dev and Branches live in
```
/Branches/Release/1.0/
/2.0/
/2.3.4/
```
i cloned it with something like `git svn clone -T Dev ... -b Branches ...`
when I run `git branch 2.1 remotes/Release/2.1` i get:
... | As mentioned in "[How do I import svn branches rooted in different directories into git using git-svn?](https://stackoverflow.com/questions/258590/how-do-i-import-svn-branches-rooted-in-different-directories-into-git-using-git-s)", you need to grab all the nested branch during the initial import:
```
[svn-remote "svn"... |
64308136 | What is git-cache and what is stored in the git-cache | 9 | 2020-10-11 19:24:41 | <p>Actually, I read a lot of things about git.</p>
<p>I know I can remove cache by <code>git rm --cached .</code> command but I can not understand the concept of <em>git-cache</em>.</p>
<p>What is cache? And where is the location of caching in GIT? Is this cache stored in RAM or in a file? Is cache used to improve perf... | 13,464 | 4,460,737 | 2020-10-12 06:49:37 | 64,308,412 | 13 | 2020-10-11 19:55:05 | 1,256,452 | 2020-10-11 19:55:05 | https://stackoverflow.com/q/64308136 | https://stackoverflow.com/a/64308412 | <p>Git is a fairly old (15+ years) program with a lot of parts and some internal terminology, not all of which has aged very well. The expression <em>the cache</em>, and the spelling of the flag as <code>--cached</code>, is one of those. The most <em>modern</em> term for this entity is the <em>staging area</em>, which... | <p>Git is a fairly old (15+ years) program with a lot of parts and some internal terminology, not all of which has aged very well. The expression <em>the cache</em>, and the spelling of the flag as <code>--cached</code>, is one of those. The most <em>modern</em> term for this entity is the <em>staging area</em>, which... | 119 | git | <h1>What is git-cache and what is stored in the git-cache</h1>
<p>Actually, I read a lot of things about git.</p>
<p>I know I can remove cache by <code>git rm --cached .</code> command but I can not understand the concept of <em>git-cache</em>.</p>
<p>What is cache? And where is the location of caching in GIT? Is this ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,701 | git | # What is git-cache and what is stored in the git-cache
Actually, I read a lot of things about git.
I know I can remove cache by `git rm --cached .` command but I can not understand the concept of *git-cache*.
What is cache? And where is the location of caching in GIT? Is this cache stored in RAM or in a file? Is ca... | Git is a fairly old (15+ years) program with a lot of parts and some internal terminology, not all of which has aged very well. The expression *the cache*, and the spelling of the flag as `--cached`, is one of those. The most *modern* term for this entity is the *staging area*, which reflects how you use it, but the mo... |
60187612 | How to set Git compression level? | 9 | 2020-02-12 11:45:41 | <p>Git is able to compress objects and pack files. How can I set this compression level?</p>
<p>Normally, the answer is to set <code>core.compression</code> or <code>pack.compression</code>.</p>
<p><em>However</em>, I tried setting these to 1 or 9 and then running <code>gc --aggressive</code> and in a separate test <... | 19,253 | 5,036,997 | 2023-02-24 17:44:23 | 60,194,624 | 13 | 2020-02-12 18:12:13 | 1,256,452 | 2023-02-24 17:44:23 | https://stackoverflow.com/q/60187612 | https://stackoverflow.com/a/60194624 | <h3>Important</h3>
<p>When doing the repack, be sure to use <code>-F</code> so as to:</p>
<blockquote>
<p>Pass the <code>--no-reuse-object</code> option to <code>git-pack-objects</code></p>
</blockquote>
<p>as <a href="https://git-scm.com/docs/git-repack" rel="noreferrer">the <code>git repack</code> documentation</a> n... | <h3>Important</h3> <p>When doing the repack, be sure to use <code>-F</code> so as to:</p> <blockquote> <p>Pass the <code>--no-reuse-object</code> option to <code>git-pack-objects</code></p> </blockquote> <p>as <a href="https://git-scm.com/docs/git-repack" rel="noreferrer">the <code>git repack</code> documentation</a> n... | 119 | git | <h1>How to set Git compression level?</h1>
<p>Git is able to compress objects and pack files. How can I set this compression level?</p>
<p>Normally, the answer is to set <code>core.compression</code> or <code>pack.compression</code>.</p>
<p><em>However</em>, I tried setting these to 1 or 9 and then running <code>gc -... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,705 | git | # How to set Git compression level?
Git is able to compress objects and pack files. How can I set this compression level?
Normally, the answer is to set `core.compression` or `pack.compression`.
*However*, I tried setting these to 1 or 9 and then running `gc --aggressive` and in a separate test `repack -a -d`. This ... | ### Important
When doing the repack, be sure to use `-F` so as to:
> Pass the `--no-reuse-object` option to `git-pack-objects`
as [the `git repack` documentation](https://git-scm.com/docs/git-repack) notes, and you discovered. Otherwise your new compression level won't apply to any existing objects.
### Background
... |
52390416 | Detached HEAD after checking out a branch; how to `push`? | 9 | 2018-09-18 15:53:56 | <p>Here's what I did:</p>
<ol>
<li><p>Checked out a remote git repository.</p></li>
<li><p>Added to the <code>[remote "origin]</code> section of <code>.git/config</code>:</p></li>
</ol>
<p><code>fetch = +refs/heads/release/BranchName:refs/remotes/origin/release/BranchName</code></p>
<ol start="3">
<li>Checked out th... | 27,299 | 2,540,407 | 2023-08-07 15:00:20 | 52,390,537 | 13 | 2018-09-18 16:01:09 | 157,957 | 2023-08-07 15:00:20 | https://stackoverflow.com/q/52390416 | https://stackoverflow.com/a/52390537 | <p>The string <code>origin/release/BranchName</code> contains both the name of the remote (<code>origin</code>) and the remote branch name (<code>release/BranchName</code>). The suggested command had these as separate arguments, so you should run:</p>
<pre><code>git push origin HEAD:release/BranchName
</code></pre>
<p>... | <p>The string <code>origin/release/BranchName</code> contains both the name of the remote (<code>origin</code>) and the remote branch name (<code>release/BranchName</code>). The suggested command had these as separate arguments, so you should run:</p> <pre><code>git push origin HEAD:release/BranchName </code></pre> <p>... | 119, 98582 | git, git-detached-head | <h1>Detached HEAD after checking out a branch; how to `push`?</h1>
<p>Here's what I did:</p>
<ol>
<li><p>Checked out a remote git repository.</p></li>
<li><p>Added to the <code>[remote "origin]</code> section of <code>.git/config</code>:</p></li>
</ol>
<p><code>fetch = +refs/heads/release/BranchName:refs/remotes/orig... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,709 | git | # Detached HEAD after checking out a branch; how to `push`?
Here's what I did:
1. Checked out a remote git repository.
2. Added to the `[remote "origin]` section of `.git/config`:
`fetch = +refs/heads/release/BranchName:refs/remotes/origin/release/BranchName`
3. Checked out the corresponding branch:
`git checkout ... | The string `origin/release/BranchName` contains both the name of the remote (`origin`) and the remote branch name (`release/BranchName`). The suggested command had these as separate arguments, so you should run:
```
git push origin HEAD:release/BranchName
```
To understand what went wrong, you have to understand that... |
50961804 | Git: reduce the size of `.git/lfs/` | 9 | 2018-06-21 06:32:00 | <p>I use git-lfs to track large files, the setup is:</p>
<pre><code>.
├── ...
├── ...
├── large-files
├── ...
├── ...
└── .git
</code></pre>
<p>where an external storage is mounted on <code>large-files</code>, and all large files go here.</p>
<p>The problem with this setup is, there is a <code>.git/lfs</code> direct... | 5,235 | 7,208,627 | 2018-06-21 08:05:39 | 50,963,358 | 13 | 2018-06-21 08:01:43 | 14,660 | 2018-06-21 08:01:43 | https://stackoverflow.com/q/50961804 | https://stackoverflow.com/a/50963358 | <p><code>.git/lfs</code> is the local cache directory for <a href="https://git-lfs.github.com/" rel="noreferrer">git-lfs</a>, Git Large File Storage. It keeps the repository size down by storing the history of large files in cloud storage instead of in local history.</p>
<p><code>.git/lfs</code> will not grow indefini... | <p><code>.git/lfs</code> is the local cache directory for <a href="https://git-lfs.github.com/" rel="noreferrer">git-lfs</a>, Git Large File Storage. It keeps the repository size down by storing the history of large files in cloud storage instead of in local history.</p> <p><code>.git/lfs</code> will not grow indefini... | 119, 115244 | git, git-lfs | <h1>Git: reduce the size of `.git/lfs/`</h1>
<p>I use git-lfs to track large files, the setup is:</p>
<pre><code>.
├── ...
├── ...
├── large-files
├── ...
├── ...
└── .git
</code></pre>
<p>where an external storage is mounted on <code>large-files</code>, and all large files go here.</p>
<p>The problem with this setu... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,710 | git | # Git: reduce the size of `.git/lfs/`
I use git-lfs to track large files, the setup is:
```
.
├── ...
├── ...
├── large-files
├── ...
├── ...
└── .git
```
where an external storage is mounted on `large-files`, and all large files go here.
The problem with this setup is, there is a `.git/lfs` directory, which uses t... | `.git/lfs` is the local cache directory for [git-lfs](https://git-lfs.github.com/), Git Large File Storage. It keeps the repository size down by storing the history of large files in cloud storage instead of in local history.
`.git/lfs` will not grow indefinitely. It's normal for `git-lfs` to cache "recent" versions o... |
49076876 | git - how to remove a file that is too big from my current commit | 9 | 2018-03-02 20:29:15 | <p>When I do the following:</p>
<pre><code>git add *
git commit -m "msg"
git push origin develop
</code></pre>
<p>I get the following errors:</p>
<pre><code>Counting objects: 25, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (24/24), done.
Writing objects: 100% (25/25), 46.43 MiB | 2.49 Mi... | 11,812 | 1,952,194 | 2018-03-05 15:36:50 | 49,076,936 | 13 | 2018-03-02 20:33:17 | 6,395,388 | 2018-03-02 20:33:17 | https://stackoverflow.com/q/49076876 | https://stackoverflow.com/a/49076936 | <p>This should work:</p>
<pre><code>git rm --cached <big_file>
git commit --amend .
</code></pre>
<p>This deletes the file from tracking, and then modifies the previous commit to also not include this file.</p>
| <p>This should work:</p> <pre><code>git rm --cached <big_file> git commit --amend . </code></pre> <p>This deletes the file from tracking, and then modifies the previous commit to also not include this file.</p> | 119, 53850 | git, git-commit | <h1>git - how to remove a file that is too big from my current commit</h1>
<p>When I do the following:</p>
<pre><code>git add *
git commit -m "msg"
git push origin develop
</code></pre>
<p>I get the following errors:</p>
<pre><code>Counting objects: 25, done.
Delta compression using up to 4 threads.
Compressing obje... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,711 | git | # git - how to remove a file that is too big from my current commit
When I do the following:
```
git add *
git commit -m "msg"
git push origin develop
```
I get the following errors:
```
Counting objects: 25, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (24/24), done.
Writing objects: 10... | This should work:
```
git rm --cached <big_file>
git commit --amend .
```
This deletes the file from tracking, and then modifies the previous commit to also not include this file. |
47076998 | Is there a way to get VS code work with git worktree? (Windows with WSL) | 9 | 2017-11-02 13:50:05 | <p>I like to keep on repository checked out in several worktrees with <code>git worktree</code> to easily work on different branches simultaneously.
Yet VS code does not seem to recognize git as scm when it is in a git worktree folder.</p>
<p>I couldn't find anything in the docs about this or an extension.
Are there ... | 5,150 | 7,401,689 | 2017-11-02 15:13:22 | 47,078,631 | 13 | 2017-11-02 15:11:20 | 7,401,689 | 2017-11-02 15:12:13 | https://stackoverflow.com/q/47076998 | https://stackoverflow.com/a/47078631 | <p>I didn't think this would matter, but it turns out... I'm on Windows and run my git command line in Windows Subsystem for Linux. But obviously, Git on Windows couldn't find the absolute linux path in <code>/mnt/d...</code>.</p>
<p>I replaced it with a relative path and now Git on Linux and Git on Windows both repor... | <p>I didn't think this would matter, but it turns out... I'm on Windows and run my git command line in Windows Subsystem for Linux. But obviously, Git on Windows couldn't find the absolute linux path in <code>/mnt/d...</code>.</p> <p>I replaced it with a relative path and now Git on Linux and Git on Windows both repor... | 119, 111608, 117020, 119526 | git, git-worktree, visual-studio-code, windows-subsystem-for-linux | <h1>Is there a way to get VS code work with git worktree? (Windows with WSL)</h1>
<p>I like to keep on repository checked out in several worktrees with <code>git worktree</code> to easily work on different branches simultaneously.
Yet VS code does not seem to recognize git as scm when it is in a git worktree folder.</... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,712 | git | # Is there a way to get VS code work with git worktree? (Windows with WSL)
I like to keep on repository checked out in several worktrees with `git worktree` to easily work on different branches simultaneously.
Yet VS code does not seem to recognize git as scm when it is in a git worktree folder.
I couldn't find anyth... | I didn't think this would matter, but it turns out... I'm on Windows and run my git command line in Windows Subsystem for Linux. But obviously, Git on Windows couldn't find the absolute linux path in `/mnt/d...`.
I replaced it with a relative path and now Git on Linux and Git on Windows both report the worktree as bei... |
44935712 | Viewing changes to deleted files in git | 9 | 2017-07-05 20:46:33 | <p>Let's say that when I branch off from master, there's a file <code>colors.txt</code> on the <code>master</code> branch of my repo with these contents:</p>
<pre><code>red
green
blue
yellow
</code></pre>
<p>I then branch off into <code>my-branch</code>, in which I make the following changes:</p>
<ol>
<li>Delete <co... | 2,556 | 3,777,633 | 2017-07-08 07:08:06 | 44,956,845 | 13 | 2017-07-06 18:54:19 | 1,406,321 | 2017-07-08 07:08:06 | https://stackoverflow.com/q/44935712 | https://stackoverflow.com/a/44956845 | <p>You can show all changes done to that file on master using this command:</p>
<pre><code>git diff HEAD...master -- colors.txt
</code></pre>
<p>This should lead to this output in your case:</p>
<pre><code>red
green
blue
yellow
+orange
+purple
</code></pre>
<p>Using three dots for <code>git diff</code> will show th... | <p>You can show all changes done to that file on master using this command:</p> <pre><code>git diff HEAD...master -- colors.txt </code></pre> <p>This should lead to this output in your case:</p> <pre><code>red green blue yellow +orange +purple </code></pre> <p>Using three dots for <code>git diff</code> will show th... | 119, 28897, 62599 | git, git-merge, merge-conflict-resolution | <h1>Viewing changes to deleted files in git</h1>
<p>Let's say that when I branch off from master, there's a file <code>colors.txt</code> on the <code>master</code> branch of my repo with these contents:</p>
<pre><code>red
green
blue
yellow
</code></pre>
<p>I then branch off into <code>my-branch</code>, in which I mak... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,714 | git | # Viewing changes to deleted files in git
Let's say that when I branch off from master, there's a file `colors.txt` on the `master` branch of my repo with these contents:
```
red
green
blue
yellow
```
I then branch off into `my-branch`, in which I make the following changes:
1. Delete `colors.txt`
2. Add `red.txt` ... | You can show all changes done to that file on master using this command:
```
git diff HEAD...master -- colors.txt
```
This should lead to this output in your case:
```
red
green
blue
yellow
+orange
+purple
```
Using three dots for `git diff` will show the changes of all commits which are parents of the second refer... |
34628532 | Git: How to determine if a ref to a commit exists | 9 | 2016-01-06 08:23:14 | <p>I need to find out if a ref to a commit exists. One thing that almost works is <code>git show</code> which sometimes returns non-zero if the ref does not exist. However, it also accepts paths within the current source tree. So if I have a file named <code>master</code> but the ref <code>master</code> does not exist,... | 7,731 | 2,126,889 | 2024-03-03 13:06:53 | 34,629,682 | 13 | 2016-01-06 09:32:24 | 216,074 | 2016-01-06 09:32:24 | https://stackoverflow.com/q/34628532 | https://stackoverflow.com/a/34629682 | <p>You can use <a href="http://git-scm.com/docs/git-rev-parse" rel="noreferrer"><code>git rev-parse</code></a> with the <code>--verify</code> flag to parse various refs and decode them to their SHA-1 hash value. This will get rid of all invalid refs and also file paths:</p>
<pre><code>$ git rev-parse --verify HEAD
a93... | <p>You can use <a href="http://git-scm.com/docs/git-rev-parse" rel="noreferrer"><code>git rev-parse</code></a> with the <code>--verify</code> flag to parse various refs and decode them to their SHA-1 hash value. This will get rid of all invalid refs and also file paths:</p> <pre><code>$ git rev-parse --verify HEAD a93... | 119 | git | <h1>Git: How to determine if a ref to a commit exists</h1>
<p>I need to find out if a ref to a commit exists. One thing that almost works is <code>git show</code> which sometimes returns non-zero if the ref does not exist. However, it also accepts paths within the current source tree. So if I have a file named <code>ma... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,715 | git | # Git: How to determine if a ref to a commit exists
I need to find out if a ref to a commit exists. One thing that almost works is `git show` which sometimes returns non-zero if the ref does not exist. However, it also accepts paths within the current source tree. So if I have a file named `master` but the ref `master... | You can use [`git rev-parse`](http://git-scm.com/docs/git-rev-parse) with the `--verify` flag to parse various refs and decode them to their SHA-1 hash value. This will get rid of all invalid refs and also file paths:
```
$ git rev-parse --verify HEAD
a93775d7fcd9bf27bbd89ee69e84a03e06223e9b
$ git rev-parse --verify H... |
31369449 | How do I push/pull changesets from an offline machine to a server? | 9 | 2015-07-12 15:30:19 | <p>The software project I am working on recently migrated from ClearCase to Git. I am still learning the fundamentals, so this question might be resolved later once I am more familiar with Git and its capabilities. </p>
<p><strong>My question is this:</strong> Does Git have a good workflow mechanism for a developer's ... | 3,113 | 3,889,627 | 2019-03-15 12:44:42 | 31,369,621 | 13 | 2015-07-12 15:48:06 | 53,897 | 2019-03-14 16:30:59 | https://stackoverflow.com/q/31369449 | https://stackoverflow.com/a/31369621 | <p>You can zip a .git folder up and transfer it to another location (e.g. burned on DVD). This will allow you to get the source inside. You can also unzip it and use <code>git pull ../somewhere/unpackedgit</code> to get changes both in and out.</p>
<p>You can however, use the <code>git bundle</code> command to creat... | <p>You can zip a .git folder up and transfer it to another location (e.g. burned on DVD). This will allow you to get the source inside. You can also unzip it and use <code>git pull ../somewhere/unpackedgit</code> to get changes both in and out.</p> <p>You can however, use the <code>git bundle</code> command to creat... | 119, 456 | git, version-control | <h1>How do I push/pull changesets from an offline machine to a server?</h1>
<p>The software project I am working on recently migrated from ClearCase to Git. I am still learning the fundamentals, so this question might be resolved later once I am more familiar with Git and its capabilities. </p>
<p><strong>My question ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,716 | git | # How do I push/pull changesets from an offline machine to a server?
The software project I am working on recently migrated from ClearCase to Git. I am still learning the fundamentals, so this question might be resolved later once I am more familiar with Git and its capabilities.
**My question is this:** Does Git hav... | You can zip a .git folder up and transfer it to another location (e.g. burned on DVD). This will allow you to get the source inside. You can also unzip it and use `git pull ../somewhere/unpackedgit` to get changes both in and out.
You can however, use the `git bundle` command to create what is essentially off-line pus... |
22855567 | Why does my refs/remotes/origin not have a ref to master? | 9 | 2014-04-04 06:50:27 | <p>In the process of exploring the inner working of Git, I went in to the refs/remotes/origin directory of my git project and ran the <code>ls</code> command. Here is what I see.</p>
<pre><code>$ ls
HEAD sp2013dev
</code></pre>
<p>Then I ran <code>cat HEAD</code> and here's what was printed.</p>
<pre><code>$ cat HE... | 18,320 | 34,956 | 2017-02-11 01:49:54 | 22,855,803 | 13 | 2014-04-04 07:01:42 | 1,256,452 | 2017-02-11 01:49:54 | https://stackoverflow.com/q/22855567 | https://stackoverflow.com/a/22855803 | <p>Just for emphasis: you're poking around in the insides of git; you've found a directory named <code>.git/refs/remotes/origin</code> and it contains two files, <code>HEAD</code> and <code>sp2013dev</code>. The contents of <code>.git/refs/remotes/origin/HEAD</code> are <code>ref: refs/remotes/origin/master</code>.</p... | <p>Just for emphasis: you're poking around in the insides of git; you've found a directory named <code>.git/refs/remotes/origin</code> and it contains two files, <code>HEAD</code> and <code>sp2013dev</code>. The contents of <code>.git/refs/remotes/origin/HEAD</code> are <code>ref: refs/remotes/origin/master</code>.</p... | 119 | git | <h1>Why does my refs/remotes/origin not have a ref to master?</h1>
<p>In the process of exploring the inner working of Git, I went in to the refs/remotes/origin directory of my git project and ran the <code>ls</code> command. Here is what I see.</p>
<pre><code>$ ls
HEAD sp2013dev
</code></pre>
<p>Then I ran <code>ca... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,717 | git | # Why does my refs/remotes/origin not have a ref to master?
In the process of exploring the inner working of Git, I went in to the refs/remotes/origin directory of my git project and ran the `ls` command. Here is what I see.
```
$ ls
HEAD sp2013dev
```
Then I ran `cat HEAD` and here's what was printed.
```
$ cat H... | Just for emphasis: you're poking around in the insides of git; you've found a directory named `.git/refs/remotes/origin` and it contains two files, `HEAD` and `sp2013dev`. The contents of `.git/refs/remotes/origin/HEAD` are `ref: refs/remotes/origin/master`.
A reference that consists of the literal string `ref:` follo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.