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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2372583 | Untangle two lines with `git add -p` | 22 | 2010-03-03 15:37:48 | <p>I've got a file with the following changes:</p>
<pre><code># Manual hunk edit mode -- see bottom for a quick guide
@@ -280,6 +281,7 @@
if( foo )
{
bla();
- test( true );
+ removeThis();
+ test( false );
}
else
</code></pre>
<p>How can I commit the change for <code>test()</code> only, and avoid co... | 5,333 | 146,289 | 2010-03-05 14:22:19 | 2,372,792 | 27 | 2010-03-03 16:01:08 | 158,676 | 2010-03-03 16:01:08 | https://stackoverflow.com/q/2372583 | https://stackoverflow.com/a/2372792 | <blockquote>
<p>How can I commit the change for test() only, and avoid committing removeThis() ?</p>
</blockquote>
<p>That's simple. </p>
<ol>
<li><p>Enter <code>add -i</code> mode, then select <code>5: [p]atch</code> by pressing <kbd>p</kbd><kbd>Enter</kbd>. </p></li>
<li><p>Choose your file by entering its numb... | <blockquote> <p>How can I commit the change for test() only, and avoid committing removeThis() ?</p> </blockquote> <p>That's simple. </p> <ol> <li><p>Enter <code>add -i</code> mode, then select <code>5: [p]atch</code> by pressing <kbd>p</kbd><kbd>Enter</kbd>. </p></li> <li><p>Choose your file by entering its numb... | 119, 34792 | git, git-add | <h1>Untangle two lines with `git add -p`</h1>
<p>I've got a file with the following changes:</p>
<pre><code># Manual hunk edit mode -- see bottom for a quick guide
@@ -280,6 +281,7 @@
if( foo )
{
bla();
- test( true );
+ removeThis();
+ test( false );
}
else
</code></pre>
<p>How can I commit the cha... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,370 | git | # Untangle two lines with `git add -p`
I've got a file with the following changes:
```
# Manual hunk edit mode -- see bottom for a quick guide
@@ -280,6 +281,7 @@
if( foo )
{
bla();
- test( true );
+ removeThis();
+ test( false );
}
else
```
How can I commit the change for `test()` only, and avoid ... | > How can I commit the change for test() only, and avoid committing removeThis() ?
That's simple.
1. Enter `add -i` mode, then select `5: [p]atch` by pressing `p``Enter`.
2. Choose your file by entering its number and press `Enter` to start editing patches.
3. Press `e` to edit your hunk (you seem to have succesfully... |
39084984 | How to rebase only last two commits without the whole branch? | 21 | 2016-08-22 17:00:13 | <p>I accidentally committed to a wrong branch. The graph looks like this</p>
<pre><code>----o--o-----o (master)
\
\
A--B--C--D (feature)
</code></pre>
<p>I want to move C and D to master without the changes in A and B. I want the graph to look like this</p>
<pre><code>----o--o-----o (master)
\... | 12,354 | 4,507,367 | 2018-01-25 23:10:40 | 39,085,045 | 27 | 2016-08-22 17:05:00 | 1,440,565 | 2016-08-22 17:15:02 | https://stackoverflow.com/q/39084984 | https://stackoverflow.com/a/39085045 | <p><strong>Warning:</strong> The following git commands will rewrite the history of the <code>feature</code> branch. <code>git rebase</code> and <code>git reset</code> are dangerous because it can wreak havoc for anyone else who is using the <code>feature</code> branch.</p>
<p>First create the branch <code>other_featu... | <p><strong>Warning:</strong> The following git commands will rewrite the history of the <code>feature</code> branch. <code>git rebase</code> and <code>git reset</code> are dangerous because it can wreak havoc for anyone else who is using the <code>feature</code> branch.</p> <p>First create the branch <code>other_featu... | 119 | git | <h1>How to rebase only last two commits without the whole branch?</h1>
<p>I accidentally committed to a wrong branch. The graph looks like this</p>
<pre><code>----o--o-----o (master)
\
\
A--B--C--D (feature)
</code></pre>
<p>I want to move C and D to master without the changes in A and B. I want the... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,372 | git | # How to rebase only last two commits without the whole branch?
I accidentally committed to a wrong branch. The graph looks like this
```
----o--o-----o (master)
\
\
A--B--C--D (feature)
```
I want to move C and D to master without the changes in A and B. I want the graph to look like this
```
---... | **Warning:** The following git commands will rewrite the history of the `feature` branch. `git rebase` and `git reset` are dangerous because it can wreak havoc for anyone else who is using the `feature` branch.
First create the branch `other_feature` at the same commit as `feature`.
```
git checkout -b other_feature ... |
35503036 | Git and IntelliJ lines separator issue | 21 | 2016-02-19 10:30:20 | <p>I am working in <code>IntelliJ 15.0.3</code> and using Git through Git Bash (to commit and push changes). When I <code>fetch</code> file from remote git repository
it contains different line separators (mixed mode or how it's called). I mean that some lines ends with <code>CRLF</code> and some lines ends with <code... | 48,906 | 2,042,827 | 2023-06-07 13:01:54 | 35,503,242 | 27 | 2016-02-19 10:39:43 | 1,594,817 | 2023-06-07 13:01:54 | https://stackoverflow.com/q/35503036 | https://stackoverflow.com/a/35503242 | <p>While installing git, we will have option to set the <code>checkout as-is and commit as-is</code>.</p>
<p>If that is not set, we can do with the git <a href="http://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#Formatting-and-Whitespace" rel="nofollow noreferrer">config</a>.</p>
<p>Following command helps... | <p>While installing git, we will have option to set the <code>checkout as-is and commit as-is</code>.</p> <p>If that is not set, we can do with the git <a href="http://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#Formatting-and-Whitespace" rel="nofollow noreferrer">config</a>.</p> <p>Following command helps... | 119, 8945 | git, intellij-idea | <h1>Git and IntelliJ lines separator issue</h1>
<p>I am working in <code>IntelliJ 15.0.3</code> and using Git through Git Bash (to commit and push changes). When I <code>fetch</code> file from remote git repository
it contains different line separators (mixed mode or how it's called). I mean that some lines ends with ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,373 | git | # Git and IntelliJ lines separator issue
I am working in `IntelliJ 15.0.3` and using Git through Git Bash (to commit and push changes). When I `fetch` file from remote git repository
it contains different line separators (mixed mode or how it's called). I mean that some lines ends with `CRLF` and some lines ends with ... | While installing git, we will have option to set the `checkout as-is and commit as-is`.
If that is not set, we can do with the git [config](http://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#Formatting-and-Whitespace).
Following command helps you in doing so.
```
git config --global core.autocrlf true
`... |
27257399 | Git garbage collection doesn’t seem to fully work | 21 | 2014-12-02 19:30:56 | <p>I'm a little confused as how to completely clean out my garbage...</p>
<p>For:</p>
<pre class="lang-none prettyprint-override"><code>git count-objects -v -H
</code></pre>
<p>Output:</p>
<pre class="lang-none prettyprint-override"><code>warning: garbage found: ./objects/pack/gc_7174754666377259454.idx_tmp
warning: ga... | 6,677 | 2,069,812 | 2025-05-18 22:06:20 | 28,563,637 | 27 | 2015-02-17 14:26:35 | 6,309 | 2025-05-18 22:06:20 | https://stackoverflow.com/q/27257399 | https://stackoverflow.com/a/28563637 | <pre><code>C:\Users\VonC\prog\git\git>git log -Ssize-garbage|more
</code></pre>
<p>This shows the <code>size-garbage</code> output has been introduced in <a href="https://github.com/git/git/commit/1a20dd49f8c4e6c62080f267ca77b357cb61be8e" rel="nofollow noreferrer">commit 1a20dd4</a> by <a href="https://github.com/pc... | <pre><code>C:\Users\VonC\prog\git\git>git log -Ssize-garbage|more </code></pre> <p>This shows the <code>size-garbage</code> output has been introduced in <a href="https://github.com/git/git/commit/1a20dd49f8c4e6c62080f267ca77b357cb61be8e" rel="nofollow noreferrer">commit 1a20dd4</a> by <a href="https://github.com/pc... | 119, 1850 | garbage-collection, git | <h1>Git garbage collection doesn’t seem to fully work</h1>
<p>I'm a little confused as how to completely clean out my garbage...</p>
<p>For:</p>
<pre class="lang-none prettyprint-override"><code>git count-objects -v -H
</code></pre>
<p>Output:</p>
<pre class="lang-none prettyprint-override"><code>warning: garbage found... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,375 | git | # Git garbage collection doesn’t seem to fully work
I'm a little confused as how to completely clean out my garbage...
For:
```
git count-objects -v -H
```
Output:
```
warning: garbage found: ./objects/pack/gc_7174754666377259454.idx_tmp
warning: garbage found: ./objects/pack/gc_7174754666377259454.pack_tmp
warnin... | ```
C:\Users\VonC\prog\git\git>git log -Ssize-garbage|more
```
This shows the `size-garbage` output has been introduced in [commit 1a20dd4](https://github.com/git/git/commit/1a20dd49f8c4e6c62080f267ca77b357cb61be8e) by [Nguyễn Thái Ngọc Duy (`pclouds`)](https://github.com/pclouds) for Git 1.8.3 (May 2013)
> `size-gar... |
17913550 | Git - Moving the .git directory to another drive, keep the source code where it is | 21 | 2013-07-28 22:24:00 | <p>I have my source code and .git folder on a small fast ssd, I would like to have the .git directory on my second bigger slower hdd and keep my working code on my fast smaller ssd, is it possible? how?
thanks.</p>
<p>I guess my local working copy .git directory will grow as time goes (with the new versions) and so it... | 11,412 | 458,875 | 2020-07-19 21:03:35 | 17,913,726 | 27 | 2013-07-28 22:47:03 | 761,202 | 2015-02-28 17:54:35 | https://stackoverflow.com/q/17913550 | https://stackoverflow.com/a/17913726 | <h2>Yes you can</h2>
<h3>Symlinks</h3>
<p>You can symlink (or use junction points) the <code>.git</code> dir to a different location:</p>
<pre><code>$ cd my/project
$ mv .git /over/here/.git
ln -s /over/here/.git .
</code></pre>
<p>And the repository will work fine.</p>
<h3>gitdir:</h3>
<p>Or you can replace the ... | <h2>Yes you can</h2> <h3>Symlinks</h3> <p>You can symlink (or use junction points) the <code>.git</code> dir to a different location:</p> <pre><code>$ cd my/project $ mv .git /over/here/.git ln -s /over/here/.git . </code></pre> <p>And the repository will work fine.</p> <h3>gitdir:</h3> <p>Or you can replace the ... | 119 | git | <h1>Git - Moving the .git directory to another drive, keep the source code where it is</h1>
<p>I have my source code and .git folder on a small fast ssd, I would like to have the .git directory on my second bigger slower hdd and keep my working code on my fast smaller ssd, is it possible? how?
thanks.</p>
<p>I guess m... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,376 | git | # Git - Moving the .git directory to another drive, keep the source code where it is
I have my source code and .git folder on a small fast ssd, I would like to have the .git directory on my second bigger slower hdd and keep my working code on my fast smaller ssd, is it possible? how?
thanks.
I guess my local working ... | ## Yes you can
### Symlinks
You can symlink (or use junction points) the `.git` dir to a different location:
```
$ cd my/project
$ mv .git /over/here/.git
ln -s /over/here/.git .
```
And the repository will work fine.
### gitdir:
Or you can replace the `.git` folder with a file that tells git where the `.git` fol... |
5996484 | git - errors after merge conflicts during stash pop | 21 | 2011-05-13 18:56:25 | <p>Original title: git - update all files that have not been changed</p>
<p>Currently I am trying to update all files in a git repository that have not been changed. Lets say for example I have:</p>
<ul>
<li>test1.py</li>
<li>test2.py</li>
</ul>
<p>test1.py has been modified locally while both files have been modifi... | 19,225 | 373,361 | 2011-05-13 21:47:17 | 5,996,620 | 27 | 2011-05-13 19:08:36 | 119,963 | 2011-05-13 21:47:17 | https://stackoverflow.com/q/5996484 | https://stackoverflow.com/a/5996620 | <p>You resolved the conflict in your file (maybe? see footnote), but Git doesn't know whether you're done or not. You have to indicate to git that you've finished resolving that conflict. (Otherwise, if it let you move on and you hadn't actually resolved it, you could find all kinds of ways to shoot yourself in the foo... | <p>You resolved the conflict in your file (maybe? see footnote), but Git doesn't know whether you're done or not. You have to indicate to git that you've finished resolving that conflict. (Otherwise, if it let you move on and you hadn't actually resolved it, you could find all kinds of ways to shoot yourself in the foo... | 119, 13091 | git, git-stash | <h1>git - errors after merge conflicts during stash pop</h1>
<p>Original title: git - update all files that have not been changed</p>
<p>Currently I am trying to update all files in a git repository that have not been changed. Lets say for example I have:</p>
<ul>
<li>test1.py</li>
<li>test2.py</li>
</ul>
<p>test1.p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,379 | git | # git - errors after merge conflicts during stash pop
Original title: git - update all files that have not been changed
Currently I am trying to update all files in a git repository that have not been changed. Lets say for example I have:
- test1.py
- test2.py
test1.py has been modified locally while both files hav... | You resolved the conflict in your file (maybe? see footnote), but Git doesn't know whether you're done or not. You have to indicate to git that you've finished resolving that conflict. (Otherwise, if it let you move on and you hadn't actually resolved it, you could find all kinds of ways to shoot yourself in the foot.)... |
2548642 | Gitweb: How I see source code in tree view with color | 21 | 2010-03-30 20:53:53 | <p>I use gitweb. </p>
<p>In the tree view I see my source code. But this code is all in black, I like configurated to added highlight </p>
| 11,055 | 269,606 | 2018-10-14 10:50:05 | 2,549,090 | 27 | 2010-03-30 22:09:37 | 46,058 | 2013-02-01 20:35:05 | https://stackoverflow.com/q/2548642 | https://stackoverflow.com/a/2549090 | <p>To enable syntax highlighting in 'blob' view in modern gitweb, you need</p>
<ol>
<li><p>Have <a href="http://www.andre-simon.de/" rel="noreferrer" title="Highlight - a universal sourcecode to formatted text converter"><code>highlight</code></a> program installed (the one from 'highlight' package, not from 'source-h... | <p>To enable syntax highlighting in 'blob' view in modern gitweb, you need</p> <ol> <li><p>Have <a href="http://www.andre-simon.de/" rel="noreferrer" title="Highlight - a universal sourcecode to formatted text converter"><code>highlight</code></a> program installed (the one from 'highlight' package, not from 'source-h... | 119, 31236 | git, gitweb | <h1>Gitweb: How I see source code in tree view with color</h1>
<p>I use gitweb. </p>
<p>In the tree view I see my source code. But this code is all in black, I like configurated to added highlight </p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,380 | git | # Gitweb: How I see source code in tree view with color
I use gitweb.
In the tree view I see my source code. But this code is all in black, I like configurated to added highlight | To enable syntax highlighting in 'blob' view in modern gitweb, you need
1. Have [`highlight`](http://www.andre-simon.de/ "Highlight - a universal sourcecode to formatted text converter") program installed (the one from 'highlight' package, not from 'source-highlight' or 'src-highlight'; they are different programs).
2... |
41088069 | How to find the commit(s) that point to a git tree object? | 20 | 2016-12-11 15:57:22 | <p>In trying to mirror a repo to a remote server, the server is rejecting tree object 4e8f805dd45088219b5662bd3d434eb4c5428ec0. This is not a top-level tree, by the way but a subdirectory.</p>
<p>How can I find out which commit(s) indirectly reference that tree object so I can avoid pushing the refs that link to those... | 9,382 | 46,926 | 2022-11-02 12:48:11 | 41,090,798 | 27 | 2016-12-11 20:26:40 | 1,256,452 | 2022-10-26 23:50:28 | https://stackoverflow.com/q/41088069 | https://stackoverflow.com/a/41090798 | <p>As you noted, you just need to find the commit(s) with the desired <code>tree</code>. If it could be a <em>top level</em> tree you would need one extra test, but since it's not, you don't.</p>
<p>You want:</p>
<ul>
<li>for some set of commits (all those reachable from a given branch name, for instance)</li>
<li>if ... | <p>As you noted, you just need to find the commit(s) with the desired <code>tree</code>. If it could be a <em>top level</em> tree you would need one extra test, but since it's not, you don't.</p> <p>You want:</p> <ul> <li>for some set of commits (all those reachable from a given branch name, for instance)</li> <li>if ... | 119 | git | <h1>How to find the commit(s) that point to a git tree object?</h1>
<p>In trying to mirror a repo to a remote server, the server is rejecting tree object 4e8f805dd45088219b5662bd3d434eb4c5428ec0. This is not a top-level tree, by the way but a subdirectory.</p>
<p>How can I find out which commit(s) indirectly reference... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,381 | git | # How to find the commit(s) that point to a git tree object?
In trying to mirror a repo to a remote server, the server is rejecting tree object 4e8f805dd45088219b5662bd3d434eb4c5428ec0. This is not a top-level tree, by the way but a subdirectory.
How can I find out which commit(s) indirectly reference that tree objec... | As you noted, you just need to find the commit(s) with the desired `tree`. If it could be a *top level* tree you would need one extra test, but since it's not, you don't.
You want:
- for some set of commits (all those reachable from a given branch name, for instance)
- if that commit has, as a sub-tree, the target tr... |
36890139 | how to push to git from Terminal / Command Line | 20 | 2016-04-27 12:41:22 | <p>I added a file into the folder for Git uploading. I can see the folder in the SourceTree under unstaged. How can I push the file to online storage with terminal commands?</p>
<p>I figured it out I need to first cd to the local repository, which I did with this:</p>
<pre><code>cd /Users/mainuser/Desktop/Projects
gi... | 126,647 | 5,139,911 | 2023-01-30 18:47:11 | 36,890,328 | 27 | 2016-04-27 12:48:59 | 1,172,724 | 2016-04-27 12:48:59 | https://stackoverflow.com/q/36890139 | https://stackoverflow.com/a/36890328 | <p>next thing would be to commit using and then push to what ever branch you want to push</p>
<pre><code>git commit -m 'Some message about the change'
git push origin 'branch-name'
</code></pre>
| <p>next thing would be to commit using and then push to what ever branch you want to push</p> <pre><code>git commit -m 'Some message about the change' git push origin 'branch-name' </code></pre> | 119, 391, 1231 | command-line, git, terminal | <h1>how to push to git from Terminal / Command Line</h1>
<p>I added a file into the folder for Git uploading. I can see the folder in the SourceTree under unstaged. How can I push the file to online storage with terminal commands?</p>
<p>I figured it out I need to first cd to the local repository, which I did with thi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,382 | git | # how to push to git from Terminal / Command Line
I added a file into the folder for Git uploading. I can see the folder in the SourceTree under unstaged. How can I push the file to online storage with terminal commands?
I figured it out I need to first cd to the local repository, which I did with this:
```
cd /User... | next thing would be to commit using and then push to what ever branch you want to push
```
git commit -m 'Some message about the change'
git push origin 'branch-name'
``` |
29028696 | Why "git fetch origin branch:branch" works only on a non-current branch? | 20 | 2015-03-13 09:24:58 | <p>While working on a feature branch, I use this Git command to update my "develop" branch to the latest state, immediately before merging my feature branch with the "develop":</p>
<pre><code>git fetch origin develop:develop
</code></pre>
<p><strong>This works</strong>, i.e. the local "develop" points at the same com... | 17,815 | 838,434 | 2022-05-26 16:05:09 | 32,561,463 | 27 | 2015-09-14 09:33:06 | 6,309 | 2022-05-26 16:05:09 | https://stackoverflow.com/q/29028696 | https://stackoverflow.com/a/32561463 | <p>The error message comes from <a href="https://github.com/git/git/blob/16163602bacb2804d00d599049a62b7af0b0b7b6/builtin/fetch.c#L822-L834" rel="nofollow noreferrer"><code>builtin/fetch.c#check_not_current_branch()</code></a>.<br />
That function goes all the way back to <a href="https://github.com/git/git/commit/8ee5... | <p>The error message comes from <a href="https://github.com/git/git/blob/16163602bacb2804d00d599049a62b7af0b0b7b6/builtin/fetch.c#L822-L834" rel="nofollow noreferrer"><code>builtin/fetch.c#check_not_current_branch()</code></a>.<br /> That function goes all the way back to <a href="https://github.com/git/git/commit/8ee5... | 119 | git | <h1>Why "git fetch origin branch:branch" works only on a non-current branch?</h1>
<p>While working on a feature branch, I use this Git command to update my "develop" branch to the latest state, immediately before merging my feature branch with the "develop":</p>
<pre><code>git fetch origin develop:develop
</code></pre... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,383 | git | # Why "git fetch origin branch:branch" works only on a non-current branch?
While working on a feature branch, I use this Git command to update my "develop" branch to the latest state, immediately before merging my feature branch with the "develop":
```
git fetch origin develop:develop
```
**This works**, i.e. the lo... | The error message comes from [`builtin/fetch.c#check_not_current_branch()`](https://github.com/git/git/blob/16163602bacb2804d00d599049a62b7af0b0b7b6/builtin/fetch.c#L822-L834).
That function goes all the way back to [commit 8ee5d73, Oct. 2008, git 1.6.0.4](https://github.com/git/git/commit/8ee5d73137f355c21e8d4db365a... |
28497104 | How to ignore any changes on already committed file to Git | 20 | 2015-02-13 10:09:57 | <p>I need to ignore any changes done to a particular files that are already tracked by Git. Those files should not be removed from either local or remote repository.</p>
<p>I tried to ignore them in .gitignore, but it does not work.</p>
<p>.gitignore:</p>
<pre><code>$MAVEN_PATH_TO_CHILD_MODULE/src/main/java/$PACKAGE... | 12,275 | 1,280,723 | 2022-08-10 08:17:19 | 28,497,505 | 27 | 2015-02-13 10:30:33 | 46,058 | 2022-08-10 08:17:19 | https://stackoverflow.com/q/28497104 | https://stackoverflow.com/a/28497505 | <p>Only <strong>untracked</strong> files (not added to Git) can be ignored. Or in other words ignoring is about files which are not known to Git, i.e. are not in the index (have no entry in the staging area).</p>
<p>To make a file untracked (removing it from the index, and thus staging it from deletion in the next com... | <p>Only <strong>untracked</strong> files (not added to Git) can be ignored. Or in other words ignoring is about files which are not known to Git, i.e. are not in the index (have no entry in the staging area).</p> <p>To make a file untracked (removing it from the index, and thus staging it from deletion in the next com... | 119, 25056 | git, gitignore | <h1>How to ignore any changes on already committed file to Git</h1>
<p>I need to ignore any changes done to a particular files that are already tracked by Git. Those files should not be removed from either local or remote repository.</p>
<p>I tried to ignore them in .gitignore, but it does not work.</p>
<p>.gitignore... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,384 | git | # How to ignore any changes on already committed file to Git
I need to ignore any changes done to a particular files that are already tracked by Git. Those files should not be removed from either local or remote repository.
I tried to ignore them in .gitignore, but it does not work.
.gitignore:
```
$MAVEN_PATH_TO_C... | Only **untracked** files (not added to Git) can be ignored. Or in other words ignoring is about files which are not known to Git, i.e. are not in the index (have no entry in the staging area).
To make a file untracked (removing it from the index, and thus staging it from deletion in the next commit), but keep it in th... |
18424943 | Undo multiple file and folder 'git add' | 20 | 2013-08-25 01:58:44 | <p>I executed </p>
<pre><code>git add .
</code></pre>
<p>and now I want to revert that git add. How can I accomplish that? </p>
| 17,668 | 1,106,160 | 2013-08-25 21:33:34 | 18,425,161 | 27 | 2013-08-25 02:45:09 | 54,249 | 2013-08-25 02:45:09 | https://stackoverflow.com/q/18424943 | https://stackoverflow.com/a/18425161 | <p><code>git reset</code> (which is equivalent to <code>git reset HEAD</code>) will un-<code>add</code> (more commonly "unstage") all files.</p>
<p>In Git, <code>revert</code> is used for undoing an existing commit (typically a commit that happened a while ago, or has been shared with others). If your commit has not y... | <p><code>git reset</code> (which is equivalent to <code>git reset HEAD</code>) will un-<code>add</code> (more commonly "unstage") all files.</p> <p>In Git, <code>revert</code> is used for undoing an existing commit (typically a commit that happened a while ago, or has been shared with others). If your commit has not y... | 119, 34792 | git, git-add | <h1>Undo multiple file and folder 'git add'</h1>
<p>I executed </p>
<pre><code>git add .
</code></pre>
<p>and now I want to revert that git add. How can I accomplish that? </p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,385 | git | # Undo multiple file and folder 'git add'
I executed
```
git add .
```
and now I want to revert that git add. How can I accomplish that? | `git reset` (which is equivalent to `git reset HEAD`) will un-`add` (more commonly "unstage") all files.
In Git, `revert` is used for undoing an existing commit (typically a commit that happened a while ago, or has been shared with others). If your commit has not yet been shared with others, there are ways to "rewrite... |
12667936 | Did Apple remove the 'git gui' command in Xcode 4.5 command line tools? | 20 | 2012-10-01 05:32:01 | <p>After updating to Xcode 4.5 and installing the developer tools I can no longer run the 'git gui' command from the command line. It says:</p>
<pre><code>$ git gui
git: 'gui' is not a git command. See 'git --help'.
</code></pre>
<p>I'm running this version:</p>
<pre><code>$ git --version
git version 1.7.10.2 (Apple Gi... | 6,131 | 1,192,740 | 2021-10-13 17:35:24 | 12,684,291 | 27 | 2012-10-02 03:51:38 | 1,192,740 | 2021-10-13 17:34:41 | https://stackoverflow.com/q/12667936 | https://stackoverflow.com/a/12684291 | <p>Apple did indeed remove the 'git gui' command, probably because they were <a href="http://www.macrumors.com/2012/02/17/apple-removes-x11-in-os-x-mountain-lion-shifts-support-to-open-source-xquartz/" rel="nofollow noreferrer">removing X11</a> which 'git gui' is based on.</p>
<p>I decided to just homebrew git instead ... | <p>Apple did indeed remove the 'git gui' command, probably because they were <a href="http://www.macrumors.com/2012/02/17/apple-removes-x11-in-os-x-mountain-lion-shifts-support-to-open-source-xquartz/" rel="nofollow noreferrer">removing X11</a> which 'git gui' is based on.</p> <p>I decided to just homebrew git instead ... | 119, 33729, 81144 | git, git-gui, xcode4.5 | <h1>Did Apple remove the 'git gui' command in Xcode 4.5 command line tools?</h1>
<p>After updating to Xcode 4.5 and installing the developer tools I can no longer run the 'git gui' command from the command line. It says:</p>
<pre><code>$ git gui
git: 'gui' is not a git command. See 'git --help'.
</code></pre>
<p>I'm ru... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,387 | git | # Did Apple remove the 'git gui' command in Xcode 4.5 command line tools?
After updating to Xcode 4.5 and installing the developer tools I can no longer run the 'git gui' command from the command line. It says:
```
$ git gui
git: 'gui' is not a git command. See 'git --help'.
```
I'm running this version:
```
$ git ... | Apple did indeed remove the 'git gui' command, probably because they were [removing X11](http://www.macrumors.com/2012/02/17/apple-removes-x11-in-os-x-mountain-lion-shifts-support-to-open-source-xquartz/) which 'git gui' is based on.
I decided to just homebrew git instead of relying on the Xcode command line tools.
`... |
7850395 | Jenkins can not clone Git repository over Git/SSH on Windows | 20 | 2011-10-21 13:53:46 | <p>I have successfully cloned Git repository in Jenkins over Git/SSH on Windows 2008 32-bit. When I tried to do the same on Windows 2008 64-bit, <em>Console Output</em> page gets stuck here:</p>
<pre><code>Démarré par l'utilisateur anonymous
Checkout:book / C:\Jenkins\workspace\book - hudson.remoting.LocalChannel@1da6... | 62,501 | 17,469 | 2016-09-02 11:49:46 | 7,854,476 | 27 | 2011-10-21 19:42:41 | 174,284 | 2011-10-25 17:40:53 | https://stackoverflow.com/q/7850395 | https://stackoverflow.com/a/7854476 | <p>I've gone through these pains recently. Especially frustrating is the lack of error logs in this scenario: probably because MSysgit prompts user on the console when trying to recover - which doesn't get through Jenkins console.</p>
<p>Based on my experience here are a few key elements to watch for:</p>
<ol>
<li>a ... | <p>I've gone through these pains recently. Especially frustrating is the lack of error logs in this scenario: probably because MSysgit prompts user on the console when trying to recover - which doesn't get through Jenkins console.</p> <p>Based on my experience here are a few key elements to watch for:</p> <ol> <li>a ... | 64, 119, 1066, 3858, 64999 | continuous-integration, git, hudson, jenkins, windows | <h1>Jenkins can not clone Git repository over Git/SSH on Windows</h1>
<p>I have successfully cloned Git repository in Jenkins over Git/SSH on Windows 2008 32-bit. When I tried to do the same on Windows 2008 64-bit, <em>Console Output</em> page gets stuck here:</p>
<pre><code>Démarré par l'utilisateur anonymous
Checkou... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,388 | git | # Jenkins can not clone Git repository over Git/SSH on Windows
I have successfully cloned Git repository in Jenkins over Git/SSH on Windows 2008 32-bit. When I tried to do the same on Windows 2008 64-bit, *Console Output* page gets stuck here:
```
Démarré par l'utilisateur anonymous
Checkout:book / C:\Jenkins\workspa... | I've gone through these pains recently. Especially frustrating is the lack of error logs in this scenario: probably because MSysgit prompts user on the console when trying to recover - which doesn't get through Jenkins console.
Based on my experience here are a few key elements to watch for:
1. a mix of both Msysgit ... |
40166440 | Does every git branch of an NPM project have different node_modules dependencies? | 19 | 2016-10-21 00:11:04 | <p>I assume that when developing an <code>NPM</code> project, that every <code>git</code> branch (or whatever version control system you use) probably points to a different set of <code>node_modules</code> on the filesystem. Is that true? How does that work? Does it pose any problems for diskspace etc?</p>
<p>Or perha... | 8,432 | 1,223,975 | 2016-11-02 19:15:04 | 40,272,255 | 27 | 2016-10-26 21:16:11 | 1,079,354 | 2016-10-26 21:19:55 | https://stackoverflow.com/q/40166440 | https://stackoverflow.com/a/40272255 | <p>By convention, one <strong>should not</strong> add any files, libraries or binaries which can be generated or pulled in from an external source. This includes things like <code>node_modules</code>; since that is made readily available* once you do <code>npm install</code>, there's no reason or incentive** to want t... | <p>By convention, one <strong>should not</strong> add any files, libraries or binaries which can be generated or pulled in from an external source. This includes things like <code>node_modules</code>; since that is made readily available* once you do <code>npm install</code>, there's no reason or incentive** to want t... | 119, 46426, 61387 | git, node.js, npm | <h1>Does every git branch of an NPM project have different node_modules dependencies?</h1>
<p>I assume that when developing an <code>NPM</code> project, that every <code>git</code> branch (or whatever version control system you use) probably points to a different set of <code>node_modules</code> on the filesystem. Is t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,390 | git | # Does every git branch of an NPM project have different node_modules dependencies?
I assume that when developing an `NPM` project, that every `git` branch (or whatever version control system you use) probably points to a different set of `node_modules` on the filesystem. Is that true? How does that work? Does it pose... | By convention, one **should not** add any files, libraries or binaries which can be generated or pulled in from an external source. This includes things like `node_modules`; since that is made readily available* once you do `npm install`, there's no reason or incentive** to want to put that into your source control. At... |
25850117 | How to count number of commits per file pathname by author in a Git repository? | 19 | 2014-09-15 14:14:07 | <p>While <a href="http://git-scm.com/docs/git-blame" rel="nofollow noreferrer">git-blame</a> and <a href="https://stackoverflow.com/questions/1265040/how-to-count-total-lines-changed-by-a-specific-author-in-a-git-repository">counting number of lines changed</a> by an author within a git repository are helpful, is there... | 9,889 | 178,651 | 2025-10-12 19:01:29 | 28,647,880 | 27 | 2015-02-21 16:09:06 | 178,651 | 2015-02-21 21:08:40 | https://stackoverflow.com/q/25850117 | https://stackoverflow.com/a/28647880 | <p>Just realized that if you use <code>--name-only</code> to print the filenames, pretty format as empty string, and use <a href="https://stackoverflow.com/a/6447515/178651">this method</a> to sort, uniq, and sort by top number of commits, in *nix/OS X, you could use:</p>
<pre><code>git log --name-only --author=John -... | <p>Just realized that if you use <code>--name-only</code> to print the filenames, pretty format as empty string, and use <a href="https://stackoverflow.com/a/6447515/178651">this method</a> to sort, uniq, and sort by top number of commits, in *nix/OS X, you could use:</p> <pre><code>git log --name-only --author=John -... | 119 | git | <h1>How to count number of commits per file pathname by author in a Git repository?</h1>
<p>While <a href="http://git-scm.com/docs/git-blame" rel="nofollow noreferrer">git-blame</a> and <a href="https://stackoverflow.com/questions/1265040/how-to-count-total-lines-changed-by-a-specific-author-in-a-git-repository">counti... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,391 | git | # How to count number of commits per file pathname by author in a Git repository?
While [git-blame](http://git-scm.com/docs/git-blame) and [counting number of lines changed](https://stackoverflow.com/questions/1265040/how-to-count-total-lines-changed-by-a-specific-author-in-a-git-repository) by an author within a git ... | Just realized that if you use `--name-only` to print the filenames, pretty format as empty string, and use [this method](https://stackoverflow.com/a/6447515/178651) to sort, uniq, and sort by top number of commits, in *nix/OS X, you could use:
```
git log --name-only --author=John --pretty=format: | sort | uniq -c | s... |
61196309 | Husky 4.x+ not working with Visual Studio Git | 18 | 2020-04-13 20:37:32 | <p>Husky <a href="https://github.com/typicode/husky/releases/tag/v4.0.0" rel="noreferrer">changed it's path handling with 4.0.0</a>. After this change, it throws the following error on commit <strong>from Visual Studio</strong>:</p>
<pre><code>husky > pre-commit (node v12.12.0)/c/path/to/repo/node_modules/.bin/lint... | 18,631 | 5,083,218 | 2024-04-05 11:50:47 | 61,211,178 | 27 | 2020-04-14 15:16:57 | 5,083,218 | 2023-06-10 22:58:57 | https://stackoverflow.com/q/61196309 | https://stackoverflow.com/a/61211178 | <p>I found a solution, albeit it not a full explanation. The easy work around is to modify your husky command like so:</p>
<pre><code>...
"husky":{
"hooks":{ "pre-commit": "npx lint-staged"}
},
...
</code></pre>
<p>Specifying the NPM command corrects the issue with pathing. I... | <p>I found a solution, albeit it not a full explanation. The easy work around is to modify your husky command like so:</p> <pre><code>... "husky":{ "hooks":{ "pre-commit": "npx lint-staged"} }, ... </code></pre> <p>Specifying the NPM command corrects the issue with pathing. I... | 119, 124263, 135964 | git, husky, visual-studio-2019 | <h1>Husky 4.x+ not working with Visual Studio Git</h1>
<p>Husky <a href="https://github.com/typicode/husky/releases/tag/v4.0.0" rel="noreferrer">changed it's path handling with 4.0.0</a>. After this change, it throws the following error on commit <strong>from Visual Studio</strong>:</p>
<pre><code>husky > pre-commi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,392 | git | # Husky 4.x+ not working with Visual Studio Git
Husky [changed it's path handling with 4.0.0](https://github.com/typicode/husky/releases/tag/v4.0.0). After this change, it throws the following error on commit **from Visual Studio**:
```
husky > pre-commit (node v12.12.0)/c/path/to/repo/node_modules/.bin/lint-staged: ... | I found a solution, albeit it not a full explanation. The easy work around is to modify your husky command like so:
```
...
"husky":{
"hooks":{ "pre-commit": "npx lint-staged"}
},
...
```
Specifying the NPM command corrects the issue with pathing. I found the suggestion in this response to an issue from 2018 in t... |
37733131 | When exactly does git prune objects: why is "git gc" not removing commits? | 18 | 2016-06-09 18:01:15 | <p>I'm working on a git course and wanted to mention that lost refs are not really lost until running <code>git gc</code>. But verifying this, I found out that this is not the case. Even after running <code>git gc --prune=all --aggressive</code> the lost refs are still there.</p>
<p>Clearly I misunderstood something. ... | 6,431 | 160,665 | 2017-06-19 20:46:12 | 37,734,293 | 27 | 2016-06-09 19:08:19 | 1,256,452 | 2017-06-19 20:46:12 | https://stackoverflow.com/q/37733131 | https://stackoverflow.com/a/37734293 | <p>For an object to be pruned, it must meet <em>two</em> criteria. One is date/time related: it must have been created<sup>1</sup> long enough ago to be ripe for collection. The "long enough ago" part is what you are setting with <code>--prune=all</code>: you're overriding the normal "at least two weeks old" setting.... | <p>For an object to be pruned, it must meet <em>two</em> criteria. One is date/time related: it must have been created<sup>1</sup> long enough ago to be ripe for collection. The "long enough ago" part is what you are setting with <code>--prune=all</code>: you're overriding the normal "at least two weeks old" setting.... | 119, 44929 | git, git-gc | <h1>When exactly does git prune objects: why is "git gc" not removing commits?</h1>
<p>I'm working on a git course and wanted to mention that lost refs are not really lost until running <code>git gc</code>. But verifying this, I found out that this is not the case. Even after running <code>git gc --prune=all --aggressi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,393 | git | # When exactly does git prune objects: why is "git gc" not removing commits?
I'm working on a git course and wanted to mention that lost refs are not really lost until running `git gc`. But verifying this, I found out that this is not the case. Even after running `git gc --prune=all --aggressive` the lost refs are sti... | For an object to be pruned, it must meet *two* criteria. One is date/time related: it must have been created1 long enough ago to be ripe for collection. The "long enough ago" part is what you are setting with `--prune=all`: you're overriding the normal "at least two weeks old" setting.
The second criterion is where yo... |
30580948 | git error: unable to index file Crashlytics.framework/Headers | 18 | 2015-06-01 18:47:40 | <p>I am using Twitter's Fabric on my iOS app.</p>
<p>Crashlytics in Fabric just updated itself and now I cannot commit my project to <code>git</code>. I get the error:</p>
<blockquote>
<p>git error: unable to index file <code>Crashlytics.framework/Headers</code></p>
<p>fatal: updating files failed</p>
</blockquote>
<p>... | 17,985 | 1,094,339 | 2018-07-30 00:08:28 | 30,855,620 | 27 | 2015-06-15 21:54:20 | 1,094,339 | 2015-06-15 21:54:20 | https://stackoverflow.com/q/30580948 | https://stackoverflow.com/a/30855620 | <p>Going into terminal and manually committing to git solved the issue. All my further commits in xcode have worked since.</p>
<pre><code>git add .
git commit -m "message"
</code></pre>
| <p>Going into terminal and manually committing to git solved the issue. All my further commits in xcode have worked since.</p> <pre><code>git add . git commit -m "message" </code></pre> | 119, 41612 | git, git-submodules | <h1>git error: unable to index file Crashlytics.framework/Headers</h1>
<p>I am using Twitter's Fabric on my iOS app.</p>
<p>Crashlytics in Fabric just updated itself and now I cannot commit my project to <code>git</code>. I get the error:</p>
<blockquote>
<p>git error: unable to index file <code>Crashlytics.framework/H... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,394 | git | # git error: unable to index file Crashlytics.framework/Headers
I am using Twitter's Fabric on my iOS app.
Crashlytics in Fabric just updated itself and now I cannot commit my project to `git`. I get the error:
> git error: unable to index file `Crashlytics.framework/Headers`
>
> fatal: updating files failed
 |
4121025 | Moving commits from one branch to another | 18 | 2010-11-08 03:26:45 | <p>I've committed a bunch of changes onto the master branch of my git repository, and pushed it upstream (although I'm the only one working out of these.) What I want to do is to pull these last few commits off, roll back master to before the pulled-off commits, re-apply the commits onto the develop branch, and then m... | 9,160 | 61,676 | 2010-11-08 03:35:30 | 4,121,055 | 27 | 2010-11-08 03:35:30 | 119,963 | 2010-11-08 03:35:30 | https://stackoverflow.com/q/4121025 | https://stackoverflow.com/a/4121055 | <p>Here you are:</p>
<pre><code># move cba onto e
git branch foo
git rebase --onto <SHA1-e> <SHA1-d> foo
# rewind master to d
git checkout master
git reset --hard <SHA1-d>
# merge
git merge foo
</code></pre>
<p>You might want to pick a more descriptive branch name than foo, since it'll be recorded... | <p>Here you are:</p> <pre><code># move cba onto e git branch foo git rebase --onto <SHA1-e> <SHA1-d> foo # rewind master to d git checkout master git reset --hard <SHA1-d> # merge git merge foo </code></pre> <p>You might want to pick a more descriptive branch name than foo, since it'll be recorded... | 119, 717, 1879, 8974 | branch, git, merge, rebase | <h1>Moving commits from one branch to another</h1>
<p>I've committed a bunch of changes onto the master branch of my git repository, and pushed it upstream (although I'm the only one working out of these.) What I want to do is to pull these last few commits off, roll back master to before the pulled-off commits, re-ap... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,400 | git | # Moving commits from one branch to another
I've committed a bunch of changes onto the master branch of my git repository, and pushed it upstream (although I'm the only one working out of these.) What I want to do is to pull these last few commits off, roll back master to before the pulled-off commits, re-apply the co... | Here you are:
```
# move cba onto e
git branch foo
git rebase --onto <SHA1-e> <SHA1-d> foo
# rewind master to d
git checkout master
git reset --hard <SHA1-d>
# merge
git merge foo
```
You might want to pick a more descriptive branch name than foo, since it'll be recorded in the merge commit message for Z. |
56529435 | What is the behavior of the "cousins" options in git rebase --rebase-merges? | 17 | 2019-06-10 15:37:00 | <p>For Git v2.22, the following information regarding the <code>--rebase-merges</code> option can be found on the <a href="https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---rebase-mergesrebase-cousinsno-rebase-cousins" rel="noreferrer">git rebase</a> documentation page:</p>
<blockquote>
<p>By defaul... | 1,328 | 157,971 | 2019-06-10 23:56:59 | 56,533,595 | 27 | 2019-06-10 21:10:59 | 1,256,452 | 2019-06-10 23:56:59 | https://stackoverflow.com/q/56529435 | https://stackoverflow.com/a/56533595 | <p>This is probably best done by example.</p>
<p>Suppose you have:</p>
<pre><code>...--o--*--o--o <-- main
\
\ C--D
\ / \
A--B G--H <-- branch
\ /
E--F
</code></pre>
<p>You want to rebase <code>branch</code> onto ... | <p>This is probably best done by example.</p> <p>Suppose you have:</p> <pre><code>...--o--*--o--o <-- main \ \ C--D \ / \ A--B G--H <-- branch \ / E--F </code></pre> <p>You want to rebase <code>branch</code> onto ... | 119 | git | <h1>What is the behavior of the "cousins" options in git rebase --rebase-merges?</h1>
<p>For Git v2.22, the following information regarding the <code>--rebase-merges</code> option can be found on the <a href="https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---rebase-mergesrebase-cousinsno-rebase-cousins... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,401 | git | # What is the behavior of the "cousins" options in git rebase --rebase-merges?
For Git v2.22, the following information regarding the `--rebase-merges` option can be found on the [git rebase](https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---rebase-mergesrebase-cousinsno-rebase-cousins) documentation ... | This is probably best done by example.
Suppose you have:
```
...--o--*--o--o <-- main
\
\ C--D
\ / \
A--B G--H <-- branch
\ /
E--F
```
You want to rebase `branch` onto `main`, with `--rebase-merges`. The enumeration of ... |
36026185 | Name only option for `git branch --list`? | 17 | 2016-03-16 03:18:38 | <p><code>git branch</code> outputs a list of branches, but also outputs other human-oriented fluff such as an asterisk (<code>*</code>) beside the current branch.</p>
<pre><code>$ git branch
* (HEAD detached at origin/master)
branch_foo
some/branch_bar
</code></pre>
<p>How do I get a more machine parsable output ... | 6,074 | 1,036,728 | 2022-09-21 02:37:30 | 36,026,316 | 27 | 2016-03-16 03:32:21 | 1,256,452 | 2022-09-21 02:37:30 | https://stackoverflow.com/q/36026185 | https://stackoverflow.com/a/36026316 | <p>The general scripting command for working with references is <code>git for-each-ref</code>.</p>
<p>Branch references live in the <code>refs/heads/</code> part of the name-space, so use <code>git for-each-ref refs/heads</code> to obtain them all.</p>
<p>By default, <code>git for-each-ref</code> prints three items: <c... | <p>The general scripting command for working with references is <code>git for-each-ref</code>.</p> <p>Branch references live in the <code>refs/heads/</code> part of the name-space, so use <code>git for-each-ref refs/heads</code> to obtain them all.</p> <p>By default, <code>git for-each-ref</code> prints three items: <c... | 119 | git | <h1>Name only option for `git branch --list`?</h1>
<p><code>git branch</code> outputs a list of branches, but also outputs other human-oriented fluff such as an asterisk (<code>*</code>) beside the current branch.</p>
<pre><code>$ git branch
* (HEAD detached at origin/master)
branch_foo
some/branch_bar
</code></pr... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,403 | git | # Name only option for `git branch --list`?
`git branch` outputs a list of branches, but also outputs other human-oriented fluff such as an asterisk (`*`) beside the current branch.
```
$ git branch
* (HEAD detached at origin/master)
branch_foo
some/branch_bar
```
How do I get a more machine parsable output (e.g... | The general scripting command for working with references is `git for-each-ref`.
Branch references live in the `refs/heads/` part of the name-space, so use `git for-each-ref refs/heads` to obtain them all.
By default, `git for-each-ref` prints three items: `'%(objectname) %(objecttype) %(refname)'`, Use a different `... |
13474218 | Git status shows file twice but different case | 17 | 2012-11-20 13:25:19 | <p>I tried to do a search for my issue and the closest thing that I could is this.</p>
<p><a href="https://stackoverflow.com/questions/5302468/git-status-shows-same-file-twice-but-with-different-path-slash-styles">git Status Shows Same File Twice - But with different path slash styles</a></p>
<p>But it doesn't seem t... | 5,201 | 1,838,856 | 2014-11-11 00:32:20 | 14,017,052 | 27 | 2012-12-24 04:24:36 | 1,002,260 | 2014-11-11 00:32:20 | https://stackoverflow.com/q/13474218 | https://stackoverflow.com/a/14017052 | <p>This can happen in Windows if you have a repo with <code>ignorecase = false</code> and rename a file without using git. To fix, this should work</p>
<pre class="lang-r prettyprint-override"><code>git mv -f Resource.h resource.h
git commit -m 'fix case'
</code></pre>
<p>and this should prevent it from happening aga... | <p>This can happen in Windows if you have a repo with <code>ignorecase = false</code> and rename a file without using git. To fix, this should work</p> <pre class="lang-r prettyprint-override"><code>git mv -f Resource.h resource.h git commit -m 'fix case' </code></pre> <p>and this should prevent it from happening aga... | 64, 119, 39597 | git, git-extensions, windows | <h1>Git status shows file twice but different case</h1>
<p>I tried to do a search for my issue and the closest thing that I could is this.</p>
<p><a href="https://stackoverflow.com/questions/5302468/git-status-shows-same-file-twice-but-with-different-path-slash-styles">git Status Shows Same File Twice - But with diffe... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,405 | git | # Git status shows file twice but different case
I tried to do a search for my issue and the closest thing that I could is this.
[git Status Shows Same File Twice - But with different path slash styles](https://stackoverflow.com/questions/5302468/git-status-shows-same-file-twice-but-with-different-path-slash-styles)
... | This can happen in Windows if you have a repo with `ignorecase = false` and rename a file without using git. To fix, this should work
```
git mv -f Resource.h resource.h
git commit -m 'fix case'
```
and this should prevent it from happening again.
```
git config core.ignorecase true
``` |
8488887 | Git error: Changes not staged for commit | 17 | 2011-12-13 12:01:47 | <p>I have my project + RestKit submodule. Error appeared when I changed RestKit settings. I added support armv6 and armv7 architecture. </p>
<pre><code>git add .
git add -u
git commit -m "new"
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# ... | 26,232 | 499,825 | 2012-10-01 00:22:08 | 8,489,054 | 27 | 2011-12-13 12:13:06 | 1,043,187 | 2011-12-13 12:49:37 | https://stackoverflow.com/q/8488887 | https://stackoverflow.com/a/8489054 | <p>You are apparently dealing with a submodule, so you should use the submodule workflow :</p>
<pre><code># Modification on RestKit, for instance :
cd RestKit
git add .
git commit -m "Support for armv6 & armv7"
cd ..
# RestKit submodule up-to-date, now update your project
git add RestKit
git commit -m "RestKit sub... | <p>You are apparently dealing with a submodule, so you should use the submodule workflow :</p> <pre><code># Modification on RestKit, for instance : cd RestKit git add . git commit -m "Support for armv6 & armv7" cd .. # RestKit submodule up-to-date, now update your project git add RestKit git commit -m "RestKit sub... | 119, 41612 | git, git-submodules | <h1>Git error: Changes not staged for commit</h1>
<p>I have my project + RestKit submodule. Error appeared when I changed RestKit settings. I added support armv6 and armv7 architecture. </p>
<pre><code>git add .
git add -u
git commit -m "new"
# On branch master
# Changes not staged for commit:
# (use "git add <f... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,406 | git | # Git error: Changes not staged for commit
I have my project + RestKit submodule. Error appeared when I changed RestKit settings. I added support armv6 and armv7 architecture.
```
git add .
git add -u
git commit -m "new"
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what ... | You are apparently dealing with a submodule, so you should use the submodule workflow :
```
# Modification on RestKit, for instance :
cd RestKit
git add .
git commit -m "Support for armv6 & armv7"
cd ..
# RestKit submodule up-to-date, now update your project
git add RestKit
git commit -m "RestKit submodule updated"
``... |
3418535 | How do I get just the head from gitosis? | 17 | 2010-08-05 19:41:28 | <p>I have gitosis running on my server. My build system needs to get a copy of the code from gitosis. Right now I clone the whole repository, which takes a long time.</p>
<p>How do I get just the head of a branch? (I've tried git archive, but can't seem to get an archive from gitosis.)</p>
<p>Can I create an archive ... | 6,988 | 204,402 | 2016-07-30 16:13:40 | 3,418,637 | 27 | 2010-08-05 19:54:31 | 28,804 | 2010-08-05 19:54:31 | https://stackoverflow.com/q/3418535 | https://stackoverflow.com/a/3418637 | <p>Pass the <code>--depth=1</code> flag to <code>git clone</code> to only get the HEAD commit. This creates a "shallow clone". Note that there are limitations with a shallow clone: you can't get the full history (obviously), you cannot clone or pull from it, and you cannot push from it.</p>
| <p>Pass the <code>--depth=1</code> flag to <code>git clone</code> to only get the HEAD commit. This creates a "shallow clone". Note that there are limitations with a shallow clone: you can't get the full history (obviously), you cannot clone or pull from it, and you cannot push from it.</p> | 119 | git | <h1>How do I get just the head from gitosis?</h1>
<p>I have gitosis running on my server. My build system needs to get a copy of the code from gitosis. Right now I clone the whole repository, which takes a long time.</p>
<p>How do I get just the head of a branch? (I've tried git archive, but can't seem to get an archi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,407 | git | # How do I get just the head from gitosis?
I have gitosis running on my server. My build system needs to get a copy of the code from gitosis. Right now I clone the whole repository, which takes a long time.
How do I get just the head of a branch? (I've tried git archive, but can't seem to get an archive from gitosis.... | Pass the `--depth=1` flag to `git clone` to only get the HEAD commit. This creates a "shallow clone". Note that there are limitations with a shallow clone: you can't get the full history (obviously), you cannot clone or pull from it, and you cannot push from it. |
51883141 | If git functions off of snapshots of files, why doesn't .git/ become huge over time? | 16 | 2018-08-16 18:18:16 | <p>I have been reading the git book. In this book I learned that git functions through taking snapshots of the files you work with, instead of deltas like other VCSs. This has some excellent benefits.</p>
<p>However, this leaves me wondering: over time, shouldn't the .git/ folder containing these snapshots blow up to ... | 3,837 | 3,186,072 | 2018-08-16 21:11:21 | 51,884,316 | 27 | 2018-08-16 19:44:43 | 1,256,452 | 2018-08-16 21:11:21 | https://stackoverflow.com/q/51883141 | https://stackoverflow.com/a/51884316 | <p>The trick here is that this claim:</p>
<blockquote>
<p>git functions through taking snapshots of the files you work with, instead of deltas like other VCSs</p>
</blockquote>
<p>is both true and false!</p>
<p>Git's main object database—a <a href="https://en.wikipedia.org/wiki/Key-value_database" rel="noreferrer"... | <p>The trick here is that this claim:</p> <blockquote> <p>git functions through taking snapshots of the files you work with, instead of deltas like other VCSs</p> </blockquote> <p>is both true and false!</p> <p>Git's main object database—a <a href="https://en.wikipedia.org/wiki/Key-value_database" rel="noreferrer"... | 119 | git | <h1>If git functions off of snapshots of files, why doesn't .git/ become huge over time?</h1>
<p>I have been reading the git book. In this book I learned that git functions through taking snapshots of the files you work with, instead of deltas like other VCSs. This has some excellent benefits.</p>
<p>However, this lea... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,410 | git | # If git functions off of snapshots of files, why doesn't .git/ become huge over time?
I have been reading the git book. In this book I learned that git functions through taking snapshots of the files you work with, instead of deltas like other VCSs. This has some excellent benefits.
However, this leaves me wondering... | The trick here is that this claim:
> git functions through taking snapshots of the files you work with, instead of deltas like other VCSs
is both true and false!
Git's main object database—a [key-value store](https://en.wikipedia.org/wiki/Key-value_database)—stores four object types. We don't need to go into all the... |
10067930 | Why is Git rejecting my pull simply because I have a commit on my local branch? | 16 | 2012-04-09 01:14:26 | <p>There is a Git repository on a server that my colleague and I both push to and pull from. It works fine as long as we pull before committing.</p>
<p>However, if he has pushed to the master branch, and in the mean time I have made a local commit, when I try to pull I get this:</p>
<pre><code>! [rejected] mas... | 22,533 | 1,319,622 | 2018-01-15 23:40:53 | 10,203,704 | 27 | 2012-04-18 06:05:49 | 19,563 | 2012-04-18 06:05:49 | https://stackoverflow.com/q/10067930 | https://stackoverflow.com/a/10203704 | <p>You probably meant to do:</p>
<pre><code>git pull web master
</code></pre>
<p>Using <code>master:master</code> is trying to directly update you local <code>master</code> branch in the fetch stage of the pull which is causing the non fast-forward error.</p>
<p>If you're on a branch that is set up to track <code>we... | <p>You probably meant to do:</p> <pre><code>git pull web master </code></pre> <p>Using <code>master:master</code> is trying to directly update you local <code>master</code> branch in the fetch stage of the pull which is causing the non fast-forward error.</p> <p>If you're on a branch that is set up to track <code>we... | 119 | git | <h1>Why is Git rejecting my pull simply because I have a commit on my local branch?</h1>
<p>There is a Git repository on a server that my colleague and I both push to and pull from. It works fine as long as we pull before committing.</p>
<p>However, if he has pushed to the master branch, and in the mean time I have ma... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,411 | git | # Why is Git rejecting my pull simply because I have a commit on my local branch?
There is a Git repository on a server that my colleague and I both push to and pull from. It works fine as long as we pull before committing.
However, if he has pushed to the master branch, and in the mean time I have made a local commi... | You probably meant to do:
```
git pull web master
```
Using `master:master` is trying to directly update you local `master` branch in the fetch stage of the pull which is causing the non fast-forward error.
If you're on a branch that is set up to track `web/master` then you only need `git pull web` and this will upd... |
7774801 | GIT: how to squash several commits that have been pushed to a remote repo? | 16 | 2011-10-15 00:07:56 | <p>I have a weird setup with Git. Basically I have:</p>
<pre><code>[client 1] <---> [remote repo] ----> [client 2]
</code></pre>
<p>[Client 1] is essentially the local repo I am working with, because I can't compile/build the project on my local machine.</p>
<p>[Client 2] is a remote server for building.</... | 32,903 | 109,704 | 2011-10-15 00:36:56 | 7,774,936 | 27 | 2011-10-15 00:36:56 | 526,535 | 2011-10-15 00:36:56 | https://stackoverflow.com/q/7774801 | https://stackoverflow.com/a/7774936 | <p>First of all, avoid squashing and in general rewriting history unless you absolutely have to. Having "trivial" commits is not reason to squash pushed commits. If they can stay, let them stay. And rewriting history is not straightforward in cvs at all, so since these commits would have made their way into the cvs rep... | <p>First of all, avoid squashing and in general rewriting history unless you absolutely have to. Having "trivial" commits is not reason to squash pushed commits. If they can stay, let them stay. And rewriting history is not straightforward in cvs at all, so since these commits would have made their way into the cvs rep... | 119 | git | <h1>GIT: how to squash several commits that have been pushed to a remote repo?</h1>
<p>I have a weird setup with Git. Basically I have:</p>
<pre><code>[client 1] <---> [remote repo] ----> [client 2]
</code></pre>
<p>[Client 1] is essentially the local repo I am working with, because I can't compile/build th... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,412 | git | # GIT: how to squash several commits that have been pushed to a remote repo?
I have a weird setup with Git. Basically I have:
```
[client 1] <---> [remote repo] ----> [client 2]
```
[Client 1] is essentially the local repo I am working with, because I can't compile/build the project on my local machine.
[Client 2] ... | First of all, avoid squashing and in general rewriting history unless you absolutely have to. Having "trivial" commits is not reason to squash pushed commits. If they can stay, let them stay. And rewriting history is not straightforward in cvs at all, so since these commits would have made their way into the cvs repo, ... |
63218716 | Branching off of squashed branches | 15 | 2020-08-02 16:56:16 | <p>Suppose I have the following git history: a master branch starting with commit <code>A</code>, a <code>feature-1</code> branch branched off of <code>A</code> with commits <code>B</code> and <code>C</code>, and a second feature branch <code>feature-2</code> that built off of commit <code>C</code> with commits <code>D... | 3,045 | 3,892,542 | 2023-01-23 01:54:24 | 63,221,323 | 27 | 2020-08-02 21:41:19 | 1,256,452 | 2020-08-02 21:47:53 | https://stackoverflow.com/q/63218716 | https://stackoverflow.com/a/63221323 | <blockquote>
<p>Now suppose that commit <code>C</code> has been tested and is ready to merge in, so we use <code>git switch master; git merge feature-1 --squash</code>.</p>
<pre><code>master A------C'
\ /
feature-1 B--C
\
feature-2 D--E
</code></pre>
</blockquote>
<p>This ... | <blockquote> <p>Now suppose that commit <code>C</code> has been tested and is ready to merge in, so we use <code>git switch master; git merge feature-1 --squash</code>.</p> <pre><code>master A------C' \ / feature-1 B--C \ feature-2 D--E </code></pre> </blockquote> <p>This ... | 119, 64512, 98455 | git, git-squash, pull-request | <h1>Branching off of squashed branches</h1>
<p>Suppose I have the following git history: a master branch starting with commit <code>A</code>, a <code>feature-1</code> branch branched off of <code>A</code> with commits <code>B</code> and <code>C</code>, and a second feature branch <code>feature-2</code> that built off o... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,414 | git | # Branching off of squashed branches
Suppose I have the following git history: a master branch starting with commit `A`, a `feature-1` branch branched off of `A` with commits `B` and `C`, and a second feature branch `feature-2` that built off of commit `C` with commits `D` and `E`.
```
master A
\
feat... | > Now suppose that commit `C` has been tested and is ready to merge in, so we use `git switch master; git merge feature-1 --squash`.
>
> ```
> master A------C'
> \ /
> feature-1 B--C
> \
> feature-2 D--E
> ```
This drawing isn't quite right: it should read the way I've dr... |
62554245 | How can I use `LF` line endings in Git for Windows in 2020 for good? | 15 | 2020-06-24 11:42:14 | <p>Our repository uses <code>LF</code>, my Git for Windows installation uses <strong>Checkout as-is, commit Unix-style line endings</strong>,</p>
<p><a href="https://i.sstatic.net/Ldvop.png" rel="noreferrer"><img src="https://i.sstatic.net/Ldvop.png" alt="enter image description here" /></a></p>
<p>but I still end up w... | 16,058 | 985,454 | 2020-06-25 11:25:53 | 62,554,246 | 27 | 2020-06-24 11:42:14 | 985,454 | 2020-06-25 11:25:53 | https://stackoverflow.com/q/62554245 | https://stackoverflow.com/a/62554246 | <p>There are two git config attributes that affect the line endings: <strong><code>core.autocrlf</code></strong> and <strong><code>core.eol</code></strong>.<br />
Previously, you were told to use <code>core.autocrlf = true</code> to be able to work on cross-platform projects, but it's not <code>true</code> any more.</p... | <p>There are two git config attributes that affect the line endings: <strong><code>core.autocrlf</code></strong> and <strong><code>core.eol</code></strong>.<br /> Previously, you were told to use <code>core.autocrlf = true</code> to be able to work on cross-platform projects, but it's not <code>true</code> any more.</p... | 119, 8329, 111684, 123373 | editorconfig, git, git-for-windows, line-endings | <h1>How can I use `LF` line endings in Git for Windows in 2020 for good?</h1>
<p>Our repository uses <code>LF</code>, my Git for Windows installation uses <strong>Checkout as-is, commit Unix-style line endings</strong>,</p>
<p><a href="https://i.sstatic.net/Ldvop.png" rel="noreferrer"><img src="https://i.sstatic.net/Ld... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,415 | git | # How can I use `LF` line endings in Git for Windows in 2020 for good?
Our repository uses `LF`, my Git for Windows installation uses **Checkout as-is, commit Unix-style line endings**,
[](https://i.sstatic.net/Ldvop.png)
but I still end up with wall of... | There are two git config attributes that affect the line endings: **`core.autocrlf`** and **`core.eol`**.
Previously, you were told to use `core.autocrlf = true` to be able to work on cross-platform projects, but it's not `true` any more.
If your system/IDE/tooling support `LF` and you **do want** to use `LF` as eve... |
49720604 | error: RPC failed; curl 56 OpenSSL SSL_read: error:140943FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record mac, errno 0 | 15 | 2018-04-08 17:22:31 | <p>I use <strong>Arch Linux</strong> and this problem appears when trying to push on my rip </p>
<p><code>
error: RPC failed; curl 56 OpenSSL SSL_read: error:140943FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record mac, errno 0
</code></p>
<p>this issue when writing</p>
<blockquote>
<blockquote>
<p>git pus... | 42,579 | 5,921,034 | 2024-04-08 12:07:33 | 49,784,244 | 27 | 2018-04-11 20:50:07 | 9,632,837 | 2019-07-10 00:28:10 | https://stackoverflow.com/q/49720604 | https://stackoverflow.com/a/49784244 | <p>So I ran into the same issue and contacted github.com/contact. In the end, they gave the hint that solved it for me. I needed to change the git config to use TLSv1.2 instead of SSLv3:</p>
<pre><code>git config http.sslVersion tlsv1.2
</code></pre>
<p>As GitHub support told me, in the beginning, the issue could be ... | <p>So I ran into the same issue and contacted github.com/contact. In the end, they gave the hint that solved it for me. I needed to change the git config to use TLSv1.2 instead of SSLv3:</p> <pre><code>git config http.sslVersion tlsv1.2 </code></pre> <p>As GitHub support told me, in the beginning, the issue could be ... | 58, 119, 1554, 1999, 43830 | archlinux, curl, git, linux, openssl | <h1>error: RPC failed; curl 56 OpenSSL SSL_read: error:140943FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record mac, errno 0</h1>
<p>I use <strong>Arch Linux</strong> and this problem appears when trying to push on my rip </p>
<p><code>
error: RPC failed; curl 56 OpenSSL SSL_read: error:140943FC:SSL routines:ssl3_... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,416 | git | # error: RPC failed; curl 56 OpenSSL SSL_read: error:140943FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record mac, errno 0
I use **Arch Linux** and this problem appears when trying to push on my rip
`error: RPC failed; curl 56 OpenSSL SSL_read: error:140943FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record ma... | So I ran into the same issue and contacted github.com/contact. In the end, they gave the hint that solved it for me. I needed to change the git config to use TLSv1.2 instead of SSLv3:
```
git config http.sslVersion tlsv1.2
```
As GitHub support told me, in the beginning, the issue could be related to a change which t... |
43520843 | How to clone from specific branch from Git using Gitpython | 15 | 2017-04-20 13:23:40 | <p>I tried to clone a repository from git using GitPython in python function.
I used GitPython library for cloning from git in my python function and my code snippet as follows:</p>
<blockquote>
<p>from git import Repo</p>
<p>Repo.clone_from('<a href="http://user:password@github.com/user/project.git" rel="noref... | 35,186 | 7,072,939 | 2021-07-17 22:27:40 | 43,521,573 | 27 | 2017-04-20 13:54:54 | 1,660,971 | 2017-04-20 13:54:54 | https://stackoverflow.com/q/43520843 | https://stackoverflow.com/a/43521573 | <p>just pass the branch name parameter, e.g. :-</p>
<pre><code>repo = Repo.clone_from(
'http://user:password@github.com/user/project.git',
'/home/antro/Project/',
branch='master'
)
</code></pre>
<p>see <a href="http://gitpython.readthedocs.io/en/stable/tutorial.html#examining-references" rel="noreferrer">... | <p>just pass the branch name parameter, e.g. :-</p> <pre><code>repo = Repo.clone_from( 'http://user:password@github.com/user/project.git', '/home/antro/Project/', branch='master' ) </code></pre> <p>see <a href="http://gitpython.readthedocs.io/en/stable/tutorial.html#examining-references" rel="noreferrer">... | 16, 119, 61013 | git, gitpython, python | <h1>How to clone from specific branch from Git using Gitpython</h1>
<p>I tried to clone a repository from git using GitPython in python function.
I used GitPython library for cloning from git in my python function and my code snippet as follows:</p>
<blockquote>
<p>from git import Repo</p>
<p>Repo.clone_from('<... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,417 | git | # How to clone from specific branch from Git using Gitpython
I tried to clone a repository from git using GitPython in python function.
I used GitPython library for cloning from git in my python function and my code snippet as follows:
> from git import Repo
>
> Repo.clone_from('<http://user:password@github.com/user/... | just pass the branch name parameter, e.g. :-
```
repo = Repo.clone_from(
'http://user:password@github.com/user/project.git',
'/home/antro/Project/',
branch='master'
)
```
see [here for more info](http://gitpython.readthedocs.io/en/stable/tutorial.html#examining-references) |
18168263 | Prevent connection string from being committed to repository | 15 | 2013-08-11 02:48:37 | <p>I'm using GIT repository for my project. In my web.config I have a debug connection string to my local SQL server database. It won't work for anyone else. I cannot just put entire Web.config in <strong>.gitignore</strong> - the project wouldn't even compile.</p>
<p>A perfect solution would be to put the connection ... | 4,326 | 672,018 | 2017-04-30 09:22:28 | 18,168,273 | 27 | 2013-08-11 02:50:18 | 34,397 | 2013-08-11 02:50:18 | https://stackoverflow.com/q/18168263 | https://stackoverflow.com/a/18168273 | <p>You can move a single section of Web.config to a separate file.</p>
<p>In Web.config, <a href="http://msdn.microsoft.com/en-us/library/system.configuration.sectioninformation.configsource" rel="noreferrer">write</a></p>
<pre><code><connectionStrings configSource="connectionStrings.config" />
</code></pre>
<... | <p>You can move a single section of Web.config to a separate file.</p> <p>In Web.config, <a href="http://msdn.microsoft.com/en-us/library/system.configuration.sectioninformation.configsource" rel="noreferrer">write</a></p> <pre><code><connectionStrings configSource="connectionStrings.config" /> </code></pre> <... | 1, 9, 119, 4528, 71051 | .net, asp.net-mvc-4, c#, git, web-config | <h1>Prevent connection string from being committed to repository</h1>
<p>I'm using GIT repository for my project. In my web.config I have a debug connection string to my local SQL server database. It won't work for anyone else. I cannot just put entire Web.config in <strong>.gitignore</strong> - the project wouldn't ev... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,419 | git | # Prevent connection string from being committed to repository
I'm using GIT repository for my project. In my web.config I have a debug connection string to my local SQL server database. It won't work for anyone else. I cannot just put entire Web.config in **.gitignore** - the project wouldn't even compile.
A perfect... | You can move a single section of Web.config to a separate file.
In Web.config, [write](http://msdn.microsoft.com/en-us/library/system.configuration.sectioninformation.configsource)
```
<connectionStrings configSource="connectionStrings.config" />
```
Then, move the original element to a separate `connectionStrings.c... |
10344493 | Android : How to set acceptable numbers and characters in EditText? | 15 | 2012-04-27 03:52:55 | <p>I have to set acceptable characters "0123456789" and "semicolon" in the EditText. Below is the code I'm using.</p>
<pre><code>android:digits="0123456789;"
android:inputType="number|text
</code></pre>
<p>The problem with that implementation is in HTC phones, semicolon can't be entered but in Samsung and Sony Ericss... | 26,470 | 504,470 | 2015-06-19 17:46:24 | 10,344,887 | 27 | 2012-04-27 04:50:28 | 1,286,723 | 2015-06-19 17:46:24 | https://stackoverflow.com/q/10344493 | https://stackoverflow.com/a/10344887 | <p>Android provides an easy way to edit text fields by modifying the layout xml and adding an android:inputType="text". This lets you easily create some basic validations like numbers, decimal, phone or emails. But there's no parameter for alphanumeric (i.e. no special characters). To do this, you need to use an input... | <p>Android provides an easy way to edit text fields by modifying the layout xml and adding an android:inputType="text". This lets you easily create some basic validations like numbers, decimal, phone or emails. But there's no parameter for alphanumeric (i.e. no special characters). To do this, you need to use an input... | 355, 1386, 9914, 64956 | android, android-edittext, digits, validation | <h1>Android : How to set acceptable numbers and characters in EditText?</h1>
<p>I have to set acceptable characters "0123456789" and "semicolon" in the EditText. Below is the code I'm using.</p>
<pre><code>android:digits="0123456789;"
android:inputType="number|text
</code></pre>
<p>The problem with that implementatio... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,420 | git | # Android : How to set acceptable numbers and characters in EditText?
I have to set acceptable characters "0123456789" and "semicolon" in the EditText. Below is the code I'm using.
```
android:digits="0123456789;"
android:inputType="number|text
```
The problem with that implementation is in HTC phones, semicolon can... | Android provides an easy way to edit text fields by modifying the layout xml and adding an android:inputType="text". This lets you easily create some basic validations like numbers, decimal, phone or emails. But there's no parameter for alphanumeric (i.e. no special characters). To do this, you need to use an input fil... |
4109136 | Configure a local branch for push to specific branch | 15 | 2010-11-05 18:57:56 | <p>Sorry if this question has been asked already.</p>
<p>Am cloning from a repo named "git_lab" which has a branch named "test"
When cloning i use "-b myname_test" to create a local branch named "myname_test" and local clone is named "myname_git_lab"</p>
<p>When i do "git pull" it automatically fetches and merges cha... | 18,947 | 289,715 | 2012-04-20 13:17:24 | 4,109,943 | 27 | 2010-11-05 20:48:53 | 119,963 | 2010-11-05 20:48:53 | https://stackoverflow.com/q/4109136 | https://stackoverflow.com/a/4109943 | <p>There are two things you can do here.</p>
<ul>
<li><p>Set <code>push.default</code> to <code>tracking</code>, so that it will push all branches to the remote branches they track, not the ones they have the same name as, then configure your branch with appropriate tracking information. (e.g. set <code>branch.master.... | <p>There are two things you can do here.</p> <ul> <li><p>Set <code>push.default</code> to <code>tracking</code>, so that it will push all branches to the remote branches they track, not the ones they have the same name as, then configure your branch with appropriate tracking information. (e.g. set <code>branch.master.... | 119, 28898, 31678, 32868, 76220 | git, git-branch, git-config, git-push, remote-branch | <h1>Configure a local branch for push to specific branch</h1>
<p>Sorry if this question has been asked already.</p>
<p>Am cloning from a repo named "git_lab" which has a branch named "test"
When cloning i use "-b myname_test" to create a local branch named "myname_test" and local clone is named "myname_git_lab"</p>
<... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,421 | git | # Configure a local branch for push to specific branch
Sorry if this question has been asked already.
Am cloning from a repo named "git_lab" which has a branch named "test"
When cloning i use "-b myname_test" to create a local branch named "myname_test" and local clone is named "myname_git_lab"
When i do "git pull" ... | There are two things you can do here.
- Set `push.default` to `tracking`, so that it will push all branches to the remote branches they track, not the ones they have the same name as, then configure your branch with appropriate tracking information. (e.g. set `branch.master.remote` to `origin` and `branch.master.merge... |
40633097 | gitpython: Command syntax for git commit | 14 | 2016-11-16 13:14:25 | <p>with using <strong>gitpython</strong> module, I am writing python script to check <em>git diff --> git add</em> of all modified files one by one. At the end I want to commit all these changes, but I didn't find the exact syntax of the command.</p>
<p>I'm trying with below code, 'git add' works perfectly but 'git co... | 19,473 | 4,045,933 | 2025-01-09 09:19:22 | 40,634,417 | 27 | 2016-11-16 14:16:55 | 4,045,933 | 2016-11-16 14:16:55 | https://stackoverflow.com/q/40633097 | https://stackoverflow.com/a/40634417 | <p>Resolved the issue, need to add "-m" flag in the commit command as below:</p>
<pre><code>repo.git.commit('-m', 'test commit', author='sunilt@xxx.com')
</code></pre>
| <p>Resolved the issue, need to add "-m" flag in the commit command as below:</p> <pre><code>repo.git.commit('-m', 'test commit', author='sunilt@xxx.com') </code></pre> | 16, 119, 59047, 61013 | git, gitpython, python, python-2.7 | <h1>gitpython: Command syntax for git commit</h1>
<p>with using <strong>gitpython</strong> module, I am writing python script to check <em>git diff --> git add</em> of all modified files one by one. At the end I want to commit all these changes, but I didn't find the exact syntax of the command.</p>
<p>I'm trying with... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,423 | git | # gitpython: Command syntax for git commit
with using **gitpython** module, I am writing python script to check *git diff --> git add* of all modified files one by one. At the end I want to commit all these changes, but I didn't find the exact syntax of the command.
I'm trying with below code, 'git add' works perfect... | Resolved the issue, need to add "-m" flag in the commit command as below:
```
repo.git.commit('-m', 'test commit', author='sunilt@xxx.com')
``` |
24680617 | How to extract the source files from a git repository? | 14 | 2014-07-10 15:32:25 | <p>I am very new to Git, but spent far too much time trying to achieve this. We had a contractor to do it for us a year ago for us, so unless i am missing something, this is doable.</p>
<p>We have a git repository (only the project.git and .git directories)
this project is a custom website. So we need to extract all t... | 78,919 | 3,826,027 | 2019-12-02 08:00:23 | 24,680,765 | 27 | 2014-07-10 15:39:59 | 1,830,736 | 2014-07-10 15:39:59 | https://stackoverflow.com/q/24680617 | https://stackoverflow.com/a/24680765 | <p>Your contractor left you a <em><a href="http://www.saintsjd.com/2011/01/what-is-a-bare-git-repository/" rel="noreferrer">bare repository</a>.</em> It is used by Git for remotes that don't have a working copy (for example, on a server).</p>
<p>Just clone from the bare repository:</p>
<pre><code>git clone project.g... | <p>Your contractor left you a <em><a href="http://www.saintsjd.com/2011/01/what-is-a-bare-git-repository/" rel="noreferrer">bare repository</a>.</em> It is used by Git for remotes that don't have a working copy (for example, on a server).</p> <p>Just clone from the bare repository:</p> <pre><code>git clone project.g... | 119 | git | <h1>How to extract the source files from a git repository?</h1>
<p>I am very new to Git, but spent far too much time trying to achieve this. We had a contractor to do it for us a year ago for us, so unless i am missing something, this is doable.</p>
<p>We have a git repository (only the project.git and .git directorie... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,424 | git | # How to extract the source files from a git repository?
I am very new to Git, but spent far too much time trying to achieve this. We had a contractor to do it for us a year ago for us, so unless i am missing something, this is doable.
We have a git repository (only the project.git and .git directories)
this project ... | Your contractor left you a *[bare repository](http://www.saintsjd.com/2011/01/what-is-a-bare-git-repository/).* It is used by Git for remotes that don't have a working copy (for example, on a server).
Just clone from the bare repository:
```
git clone project.git
```
You should end up with a directory called `projec... |
12700194 | git svn clone fails on Mac OS X: "Temp file with moniker 'svn_delta' already in use" | 14 | 2012-10-03 00:06:26 | <p>I've installed git-core (+svn) on my Mac from MacPorts. This has given me:</p>
<pre><code>git-core @1.7.12.2_0+credential_osxkeychain+doc+pcre+python27+svn
subversion @1.7.6_2
</code></pre>
<p>I'm attempting to call something like the following:</p>
<pre><code>git svn clone http://my.svn.com/svn/area/subarea/pr... | 1,866 | 1,637,252 | 2013-11-21 07:49:12 | 18,599,865 | 27 | 2013-09-03 19:20:11 | 193,210 | 2013-11-13 00:07:05 | https://stackoverflow.com/q/12700194 | https://stackoverflow.com/a/18599865 | <p>Add this setting to your <code>~/.subversion/servers</code> file:</p>
<pre><code>[global]
http-bulk-updates=on
</code></pre>
<p>I had this issue on Linux, and saw the above workaround on <a href="http://mail-archives.apache.org/mod_mbox/subversion-users/201307.mbox/%3C51D79BDD.5020106@wandisco.com%3E">this thread<... | <p>Add this setting to your <code>~/.subversion/servers</code> file:</p> <pre><code>[global] http-bulk-updates=on </code></pre> <p>I had this issue on Linux, and saw the above workaround on <a href="http://mail-archives.apache.org/mod_mbox/subversion-users/201307.mbox/%3C51D79BDD.5020106@wandisco.com%3E">this thread<... | 63, 119, 369, 580, 8199 | git, macos, macports, perl, svn | <h1>git svn clone fails on Mac OS X: "Temp file with moniker 'svn_delta' already in use"</h1>
<p>I've installed git-core (+svn) on my Mac from MacPorts. This has given me:</p>
<pre><code>git-core @1.7.12.2_0+credential_osxkeychain+doc+pcre+python27+svn
subversion @1.7.6_2
</code></pre>
<p>I'm attempting to call som... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,425 | git | # git svn clone fails on Mac OS X: "Temp file with moniker 'svn_delta' already in use"
I've installed git-core (+svn) on my Mac from MacPorts. This has given me:
```
git-core @1.7.12.2_0+credential_osxkeychain+doc+pcre+python27+svn
subversion @1.7.6_2
```
I'm attempting to call something like the following:
```
git... | Add this setting to your `~/.subversion/servers` file:
```
[global]
http-bulk-updates=on
```
I had this issue on Linux, and saw the above workaround on [this thread](http://mail-archives.apache.org/mod_mbox/subversion-users/201307.mbox/%3C51D79BDD.5020106@wandisco.com%3E). I **think** I ran into this because I forced... |
14233939 | git submodule commit/push/pull | 14 | 2013-01-09 11:11:28 | <p>I'd like to use git submodule. </p>
<p>The steps I need to take to push my changes to my project are</p>
<blockquote>
<ol>
<li>add/commit/push from submodule directory</li>
<li>add/commit/push from parent directory</li>
</ol>
</blockquote>
<p>Steps I need to take to pull changes of my project.</p>
<bloc... | 38,682 | 433,570 | 2013-01-11 00:46:38 | 14,259,250 | 27 | 2013-01-10 13:39:39 | 201,648 | 2013-01-11 00:46:38 | https://stackoverflow.com/q/14233939 | https://stackoverflow.com/a/14259250 | <p>I'd like to share my experiences with you as someone who works with external projects in Visual Studio solutions trying to solve a similar problem. I'm relatively new to git, so if anyone has any constructive criticism I would appreciate that.</p>
<p>If you're using Visual Studio, the Git Source Control Provider ex... | <p>I'd like to share my experiences with you as someone who works with external projects in Visual Studio solutions trying to solve a similar problem. I'm relatively new to git, so if anyone has any constructive criticism I would appreciate that.</p> <p>If you're using Visual Studio, the Git Source Control Provider ex... | 119, 41612 | git, git-submodules | <h1>git submodule commit/push/pull</h1>
<p>I'd like to use git submodule. </p>
<p>The steps I need to take to push my changes to my project are</p>
<blockquote>
<ol>
<li>add/commit/push from submodule directory</li>
<li>add/commit/push from parent directory</li>
</ol>
</blockquote>
<p>Steps I need to take t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,426 | git | # git submodule commit/push/pull
I'd like to use git submodule.
The steps I need to take to push my changes to my project are
> 1. add/commit/push from submodule directory
> 2. add/commit/push from parent directory
Steps I need to take to pull changes of my project.
> 1. git pull from parent directory
> 2. git sub... | I'd like to share my experiences with you as someone who works with external projects in Visual Studio solutions trying to solve a similar problem. I'm relatively new to git, so if anyone has any constructive criticism I would appreciate that.
If you're using Visual Studio, the Git Source Control Provider extension is... |
9876179 | What's the status of my git submodule, and how can I clean it up? | 14 | 2012-03-26 16:42:08 | <p>Being a relative submodules noob, I wanted to update my submodule with from its origin, and did:</p>
<pre><code>git pull
</code></pre>
<p>This resulted in:</p>
<pre><code>remote: Counting objects: 111, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 57 (delta 54), reused 57 (delta 54)
Unpacking... | 7,919 | 248,220 | 2012-03-26 17:31:26 | 9,876,844 | 27 | 2012-03-26 17:31:26 | 1,119,701 | 2012-03-26 17:31:26 | https://stackoverflow.com/q/9876179 | https://stackoverflow.com/a/9876844 | <p>After a <code>git submodule update</code>, the <code>HEAD</code> in the submodule is set to the submodule commit-hash saved in the super project. If you want to reset the <code>HEAD</code> in the submodule to track the new commits in <code>origin/master</code> you first have to checkout to <code>master</code> and th... | <p>After a <code>git submodule update</code>, the <code>HEAD</code> in the submodule is set to the submodule commit-hash saved in the super project. If you want to reset the <code>HEAD</code> in the submodule to track the new commits in <code>origin/master</code> you first have to checkout to <code>master</code> and th... | 119, 28896, 41612 | git, git-pull, git-submodules | <h1>What's the status of my git submodule, and how can I clean it up?</h1>
<p>Being a relative submodules noob, I wanted to update my submodule with from its origin, and did:</p>
<pre><code>git pull
</code></pre>
<p>This resulted in:</p>
<pre><code>remote: Counting objects: 111, done.
remote: Compressing objects: 10... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,427 | git | # What's the status of my git submodule, and how can I clean it up?
Being a relative submodules noob, I wanted to update my submodule with from its origin, and did:
```
git pull
```
This resulted in:
```
remote: Counting objects: 111, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 57 (delta 54),... | After a `git submodule update`, the `HEAD` in the submodule is set to the submodule commit-hash saved in the super project. If you want to reset the `HEAD` in the submodule to track the new commits in `origin/master` you first have to checkout to `master` and then to pull the changes:
In the submodule directory:
```
... |
1651985 | git-merge with repository on local filesystem | 14 | 2009-10-30 19:59:05 | <p>For some context: I just upgraded Ubuntu which broke my existing gitosis installation (see here: <a href="https://bugs.launchpad.net/ubuntu/+source/gitosis/+bug/368895" rel="noreferrer">bug #368895</a>), and have just reinstalled gitosis from packages. I now want to migrate my whole config and set of repositories fr... | 22,051 | 40,834 | 2009-10-30 23:25:27 | 1,652,769 | 27 | 2009-10-30 23:25:27 | 46,058 | 2009-10-30 23:25:27 | https://stackoverflow.com/q/1651985 | https://stackoverflow.com/a/1652769 | <p>You need to use <code>git pull</code> with repository, not <code>git merge</code> (which is for branches):</p>
<pre><code>git pull ../gitosis-admin-old/
</code></pre>
<p>You might need to select a branch in remote to merge, e.g.:</p>
<pre><code>git pull ../gitosis-admin-old/ master
</code></pre>
<p>If you need t... | <p>You need to use <code>git pull</code> with repository, not <code>git merge</code> (which is for branches):</p> <pre><code>git pull ../gitosis-admin-old/ </code></pre> <p>You might need to select a branch in remote to merge, e.g.:</p> <pre><code>git pull ../gitosis-admin-old/ master </code></pre> <p>If you need t... | 119, 24526, 28897 | git, git-merge, gitosis | <h1>git-merge with repository on local filesystem</h1>
<p>For some context: I just upgraded Ubuntu which broke my existing gitosis installation (see here: <a href="https://bugs.launchpad.net/ubuntu/+source/gitosis/+bug/368895" rel="noreferrer">bug #368895</a>), and have just reinstalled gitosis from packages. I now wan... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,428 | git | # git-merge with repository on local filesystem
For some context: I just upgraded Ubuntu which broke my existing gitosis installation (see here: [bug #368895](https://bugs.launchpad.net/ubuntu/+source/gitosis/+bug/368895)), and have just reinstalled gitosis from packages. I now want to migrate my whole config and set ... | You need to use `git pull` with repository, not `git merge` (which is for branches):
```
git pull ../gitosis-admin-old/
```
You might need to select a branch in remote to merge, e.g.:
```
git pull ../gitosis-admin-old/ master
```
If you need to do this merge only once, then using `git remote add` like in [jamessan ... |
60414753 | How to install git+https:// from setup.py using install_requires | 13 | 2020-02-26 13:12:13 | <p>I have a project in which I have to install from git+https:</p>
<p>I can make it to work in this way:</p>
<pre><code>virtualenv -p python3.5 bla
. bla/bin/activate
pip install numpy # must have numpy before the following pkg...
pip install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
</c... | 9,502 | 3,512,538 | 2022-09-23 23:13:53 | 60,415,489 | 27 | 2020-02-26 13:53:24 | 7,976,758 | 2022-09-23 23:13:53 | https://stackoverflow.com/q/60414753 | https://stackoverflow.com/a/60415489 | <p><code>install_requires</code> must be a string or a list of strings with names and optionally URLs to get the package from:</p>
<pre><code>install_requires=[
'pycocotools @ git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
]
</code></pre>
<p>See <a href="https://pip.pypa.io/en/stable/referen... | <p><code>install_requires</code> must be a string or a list of strings with names and optionally URLs to get the package from:</p> <pre><code>install_requires=[ 'pycocotools @ git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI' ] </code></pre> <p>See <a href="https://pip.pypa.io/en/stable/referen... | 16, 119, 5119, 11066, 41044 | git, pip, python, setup.py, setuptools | <h1>How to install git+https:// from setup.py using install_requires</h1>
<p>I have a project in which I have to install from git+https:</p>
<p>I can make it to work in this way:</p>
<pre><code>virtualenv -p python3.5 bla
. bla/bin/activate
pip install numpy # must have numpy before the following pkg...
pip install '... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,429 | git | # How to install git+https:// from setup.py using install_requires
I have a project in which I have to install from git+https:
I can make it to work in this way:
```
virtualenv -p python3.5 bla
. bla/bin/activate
pip install numpy # must have numpy before the following pkg...
pip install 'git+https://github.com/coco... | `install_requires` must be a string or a list of strings with names and optionally URLs to get the package from:
```
install_requires=[
'pycocotools @ git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
]
```
See <https://pip.pypa.io/en/stable/reference/requirement-specifiers/> and <https://www... |
28724057 | git blame of particular lines inside all files filtered with grep command | 13 | 2015-02-25 16:17:21 | <p>I know how to run gblame inside a file.</p>
<p>I know how to grep a content inside all files in a directory.</p>
<p>I'd like to see gblame of particular lines around that one that contains a content. Example:</p>
<pre><code>$ blame -R "content" ./
</code></pre>
<p>I see a list of files. I want to gblame all of t... | 5,178 | 1,420,625 | 2025-09-26 21:16:46 | 41,359,384 | 27 | 2016-12-28 09:47:11 | 4,166,721 | 2025-09-26 21:16:46 | https://stackoverflow.com/q/28724057 | https://stackoverflow.com/a/41359384 | <p>You can do it with Perl:</p>
<pre><code>git grep -n 'content' | perl -F':' -anpe '$_=`git blame -L$F[1],+1 $F[0]`'
</code></pre>
<p>and if you want to create a custom command you can add something like this to your gitconfig in the alias section:</p>
<pre><code>gb = "!f() { git grep -n \"$1\" | perl -... | <p>You can do it with Perl:</p> <pre><code>git grep -n 'content' | perl -F':' -anpe '$_=`git blame -L$F[1],+1 $F[0]`' </code></pre> <p>and if you want to create a custom command you can add something like this to your gitconfig in the alias section:</p> <pre><code>gb = "!f() { git grep -n \"$1\" | perl -... | 119, 21455, 88389, 105902, 119258 | blame, git, git-blame, git-grep, vim-fugitive | <h1>git blame of particular lines inside all files filtered with grep command</h1>
<p>I know how to run gblame inside a file.</p>
<p>I know how to grep a content inside all files in a directory.</p>
<p>I'd like to see gblame of particular lines around that one that contains a content. Example:</p>
<pre><code>$ blame... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,430 | git | # git blame of particular lines inside all files filtered with grep command
I know how to run gblame inside a file.
I know how to grep a content inside all files in a directory.
I'd like to see gblame of particular lines around that one that contains a content. Example:
```
$ blame -R "content" ./
```
I see a list... | You can do it with Perl:
```
git grep -n 'content' | perl -F':' -anpe '$_=`git blame -L$F[1],+1 $F[0]`'
```
and if you want to create a custom command you can add something like this to your gitconfig in the alias section:
```
gb = "!f() { git grep -n \"$1\" | perl -F':' -anpe '$_=`git blame -L$F[1],+1 $F[0]`'; }; f... |
14876728 | fatal: bad config file line 1 in /home/trx/.gitconfig | 13 | 2013-02-14 14:11:47 | <p>I know this question has been asked a million times, but my ~/.gitconfig consists of only two lines, that are character correct with the tutorial.</p>
<pre><code>git config --global user.name "trx"
git config --global user.email chazx@live.com
</code></pre>
<p>What could be the issue here?</p>
| 23,418 | 1,470,311 | 2013-02-14 14:16:14 | 14,876,762 | 27 | 2013-02-14 14:13:47 | 258,289 | 2013-02-14 14:13:47 | https://stackoverflow.com/q/14876728 | https://stackoverflow.com/a/14876762 | <p>This is my ~/.gitconfig:</p>
<pre><code>[user]
name = Luigi R. Viggiano
email = luigi.viggiano@...
[color]
ui = true
[merge]
tool = p4merge
[diff]
tool = p4merge
[push]
default = simple
</code></pre>
<p>your <code>~/.gitconfig</code> is not in the correct format.</p>
<p>You don't need to p... | <p>This is my ~/.gitconfig:</p> <pre><code>[user] name = Luigi R. Viggiano email = luigi.viggiano@... [color] ui = true [merge] tool = p4merge [diff] tool = p4merge [push] default = simple </code></pre> <p>your <code>~/.gitconfig</code> is not in the correct format.</p> <p>You don't need to p... | 58, 119, 549 | git, linux, ubuntu | <h1>fatal: bad config file line 1 in /home/trx/.gitconfig</h1>
<p>I know this question has been asked a million times, but my ~/.gitconfig consists of only two lines, that are character correct with the tutorial.</p>
<pre><code>git config --global user.name "trx"
git config --global user.email chazx@live.com
</code></... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,431 | git | # fatal: bad config file line 1 in /home/trx/.gitconfig
I know this question has been asked a million times, but my ~/.gitconfig consists of only two lines, that are character correct with the tutorial.
```
git config --global user.name "trx"
git config --global user.email chazx@live.com
```
What could be the issue ... | This is my ~/.gitconfig:
```
[user]
name = Luigi R. Viggiano
email = luigi.viggiano@...
[color]
ui = true
[merge]
tool = p4merge
[diff]
tool = p4merge
[push]
default = simple
```
your `~/.gitconfig` is not in the correct format.
You don't need to put the commands:
```
git config --global use... |
5469619 | How move all commits from specific user to a new branch? | 13 | 2011-03-29 08:10:16 | <p>I have 'commits' from many users. I want to move all commits of some user to a new branch.</p>
<p>How can i do this?</p>
| 4,260 | 507,759 | 2015-08-31 15:09:06 | 5,469,802 | 27 | 2011-03-29 08:30:42 | 43,582 | 2015-08-31 15:09:06 | https://stackoverflow.com/q/5469619 | https://stackoverflow.com/a/5469802 | <p>Find all commits by one author and save their hash to a file:</p>
<pre><code>git log --author=<author> --format=%H > /tmp/commit-by-x
</code></pre>
<p>Create a new branch that does not contain this particular's author commit since you don't want to apply them twice. For this, you can create a new empty br... | <p>Find all commits by one author and save their hash to a file:</p> <pre><code>git log --author=<author> --format=%H > /tmp/commit-by-x </code></pre> <p>Create a new branch that does not contain this particular's author commit since you don't want to apply them twice. For this, you can create a new empty br... | 119, 1879, 5597 | branch, commit, git | <h1>How move all commits from specific user to a new branch?</h1>
<p>I have 'commits' from many users. I want to move all commits of some user to a new branch.</p>
<p>How can i do this?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,433 | git | # How move all commits from specific user to a new branch?
I have 'commits' from many users. I want to move all commits of some user to a new branch.
How can i do this? | Find all commits by one author and save their hash to a file:
```
git log --author=<author> --format=%H > /tmp/commit-by-x
```
Create a new branch that does not contain this particular's author commit since you don't want to apply them twice. For this, you can create a new empty branch:
```
git checkout --orphan com... |
2348292 | Lost Last Git Commit | 13 | 2010-02-27 17:33:24 | <p>I lost my last commit because I accidentally ran "git reset --hard HEAD^". Note: I didn't want to put the "^" at the end.</p>
<p>Is there any way to get it back? It was 2 days of work :(</p>
| 4,360 | 282,773 | 2011-02-21 16:59:50 | 2,348,302 | 27 | 2010-02-27 17:37:07 | 234,944 | 2011-02-21 16:59:50 | https://stackoverflow.com/q/2348292 | https://stackoverflow.com/a/2348302 | <p>I think that <a href="http://www.gitready.com/advanced/2009/01/17/restoring-lost-commits.html" rel="noreferrer" title="restoring lost commits">this article</a> is what you are looking for. According to the article, your commit is "gone," but not garbage collected - sort of like the recycle bin in Windows.</p>
<p>Yo... | <p>I think that <a href="http://www.gitready.com/advanced/2009/01/17/restoring-lost-commits.html" rel="noreferrer" title="restoring lost commits">this article</a> is what you are looking for. According to the article, your commit is "gone," but not garbage collected - sort of like the recycle bin in Windows.</p> <p>Yo... | 119, 456, 5597 | commit, git, version-control | <h1>Lost Last Git Commit</h1>
<p>I lost my last commit because I accidentally ran "git reset --hard HEAD^". Note: I didn't want to put the "^" at the end.</p>
<p>Is there any way to get it back? It was 2 days of work :(</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,434 | git | # Lost Last Git Commit
I lost my last commit because I accidentally ran "git reset --hard HEAD^". Note: I didn't want to put the "^" at the end.
Is there any way to get it back? It was 2 days of work :( | I think that [this article](http://www.gitready.com/advanced/2009/01/17/restoring-lost-commits.html "restoring lost commits") is what you are looking for. According to the article, your commit is "gone," but not garbage collected - sort of like the recycle bin in Windows.
You run `git fsck --lost-found` to find the 'd... |
1058342 | rough estimate of the time offset from GMT from latitude longitude | 13 | 2009-06-29 13:34:28 | <p>Is there a way to estimate the offset from GMT (or time zone) from a latitude/longitude? I've seen geonames, but this would need to work long term and we don't really want to rely on a web service. It'd just be used for determining whether to display "today" or "tonight" when giving information to various users so... | 13,559 | 108,546 | 2018-06-21 15:35:07 | 1,058,373 | 27 | 2009-06-29 13:40:08 | 115,866 | 2009-06-29 13:40:08 | https://stackoverflow.com/q/1058342 | https://stackoverflow.com/a/1058373 | <pre><code>offset = direction * longitude * 24 / 360
</code></pre>
<p>where direction is 1 for east, -1 for west, and longitude is in (-180,180)</p>
| <pre><code>offset = direction * longitude * 24 / 360 </code></pre> <p>where direction is 1 for east, -1 for west, and longitude is in (-180,180)</p> | 603, 20007, 20301 | latitude-longitude, offset, time | <h1>rough estimate of the time offset from GMT from latitude longitude</h1>
<p>Is there a way to estimate the offset from GMT (or time zone) from a latitude/longitude? I've seen geonames, but this would need to work long term and we don't really want to rely on a web service. It'd just be used for determining whether... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,435 | git | # rough estimate of the time offset from GMT from latitude longitude
Is there a way to estimate the offset from GMT (or time zone) from a latitude/longitude? I've seen geonames, but this would need to work long term and we don't really want to rely on a web service. It'd just be used for determining whether to display... | ```
offset = direction * longitude * 24 / 360
```
where direction is 1 for east, -1 for west, and longitude is in (-180,180) |
34796075 | How to paginate Git output only when necessary | 12 | 2016-01-14 17:33:57 | <p>Is there a way to configure Git to pipe its output into a paper <em>only when it exceeds the terminal size</em> (or at least a specific number of lines)?</p>
<p>I think it's rather annoying that, e.g., a six-line diff is shown in the pager - hiding any previous output, and requiring me to explicitly press <kbd>Q</kb... | 2,765 | 293,003 | 2025-05-04 17:31:01 | 34,796,854 | 27 | 2016-01-14 18:17:04 | 2,295,034 | 2016-01-14 18:17:04 | https://stackoverflow.com/q/34796075 | https://stackoverflow.com/a/34796854 | <p>On most systems, <a href="http://linux.die.net/man/1/less" rel="noreferrer"><code>less</code></a> is the default pager that Git uses and you can configure less to behave like you describe with:</p>
<pre><code>git config --global core.pager "less -X -F"
</code></pre>
<blockquote>
<p><strong>-F or --quit-if-one-sc... | <p>On most systems, <a href="http://linux.die.net/man/1/less" rel="noreferrer"><code>less</code></a> is the default pager that Git uses and you can configure less to behave like you describe with:</p> <pre><code>git config --global core.pager "less -X -F" </code></pre> <blockquote> <p><strong>-F or --quit-if-one-sc... | 119 | git | <h1>How to paginate Git output only when necessary</h1>
<p>Is there a way to configure Git to pipe its output into a paper <em>only when it exceeds the terminal size</em> (or at least a specific number of lines)?</p>
<p>I think it's rather annoying that, e.g., a six-line diff is shown in the pager - hiding any previous... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,436 | git | # How to paginate Git output only when necessary
Is there a way to configure Git to pipe its output into a paper *only when it exceeds the terminal size* (or at least a specific number of lines)?
I think it's rather annoying that, e.g., a six-line diff is shown in the pager - hiding any previous output, and requiring... | On most systems, [`less`](http://linux.die.net/man/1/less) is the default pager that Git uses and you can configure less to behave like you describe with:
```
git config --global core.pager "less -X -F"
```
> **-F or --quit-if-one-screen** Causes less to automatically exit if the entire file can be displayed on the f... |
24348657 | Are gitignore files being automatically created in my project? | 12 | 2014-06-22 06:18:29 | <p>I have been trying to manage the local copy of the project I am working on using EGit. </p>
<p>I make a pull once there is a push from the other guys. However, there are files that show that I have uncommitted changes in my local repository, but I haven't made any change. I try to resolve these by manually identify... | 11,560 | 3,398,989 | 2018-01-17 08:21:14 | 24,360,124 | 27 | 2014-06-23 07:00:37 | 6,309 | 2014-06-23 07:00:37 | https://stackoverflow.com/q/24348657 | https://stackoverflow.com/a/24360124 | <p>It is possible that the settings "Automatically ignore derived resources" triggers the generation/modification of <code>.gitignore</code>.<br>
This is a consequence of <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=297674" rel="noreferrer">bug 297674</a>, adding that feature in EGit 2.3 (Q2 2013).</p>
<p>Se... | <p>It is possible that the settings "Automatically ignore derived resources" triggers the generation/modification of <code>.gitignore</code>.<br> This is a consequence of <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=297674" rel="noreferrer">bug 297674</a>, adding that feature in EGit 2.3 (Q2 2013).</p> <p>Se... | 53, 119, 43702 | eclipse, egit, git | <h1>Are gitignore files being automatically created in my project?</h1>
<p>I have been trying to manage the local copy of the project I am working on using EGit. </p>
<p>I make a pull once there is a push from the other guys. However, there are files that show that I have uncommitted changes in my local repository, bu... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,438 | git | # Are gitignore files being automatically created in my project?
I have been trying to manage the local copy of the project I am working on using EGit.
I make a pull once there is a push from the other guys. However, there are files that show that I have uncommitted changes in my local repository, but I haven't made ... | It is possible that the settings "Automatically ignore derived resources" triggers the generation/modification of `.gitignore`.
This is a consequence of [bug 297674](https://bugs.eclipse.org/bugs/show_bug.cgi?id=297674), adding that feature in EGit 2.3 (Q2 2013).
See the [EGit tutorial](http://www.vogella.com/tutori... |
6869705 | Git Rebase seems to have worked but all commits are still showing in the log... what state am I in? | 12 | 2011-07-29 07:01:54 | <p>I think I squashed the last 40 commits using rebase.
I was following this guide to make sure I didn't do anything stupid - <a href="http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html" rel="noreferrer">http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html</a></p>
<p>The p... | 8,469 | 43,453 | 2011-07-29 10:25:10 | 6,869,737 | 27 | 2011-07-29 07:07:14 | 54,249 | 2011-07-29 07:07:14 | https://stackoverflow.com/q/6869705 | https://stackoverflow.com/a/6869737 | <p>If the rebase "todo list" couldn't be saved, your rebase didn't work.</p>
<p>The easiest way to squash that many commits would be to do <code>git reset --soft HEAD~40</code> and then <code>git commit</code> with your new message - assuming you want to squash all of them.</p>
| <p>If the rebase "todo list" couldn't be saved, your rebase didn't work.</p> <p>The easiest way to squash that many commits would be to do <code>git reset --soft HEAD~40</code> and then <code>git commit</code> with your new message - assuming you want to squash all of them.</p> | 119, 8974 | git, rebase | <h1>Git Rebase seems to have worked but all commits are still showing in the log... what state am I in?</h1>
<p>I think I squashed the last 40 commits using rebase.
I was following this guide to make sure I didn't do anything stupid - <a href="http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html" ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,439 | git | # Git Rebase seems to have worked but all commits are still showing in the log... what state am I in?
I think I squashed the last 40 commits using rebase.
I was following this guide to make sure I didn't do anything stupid - <http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html>
The problem is, ... | If the rebase "todo list" couldn't be saved, your rebase didn't work.
The easiest way to squash that many commits would be to do `git reset --soft HEAD~40` and then `git commit` with your new message - assuming you want to squash all of them. |
1786692 | bulk delete in GIT? | 12 | 2009-11-23 23:07:03 | <p>If I manually go into windows explorer and delete a bunch of files, is there any way to bulk commit the change?</p>
<p>I believe even after doing a :</p>
<p>git add .</p>
<p>it still tells me I have to do a:</p>
<p>git rm /path/to/file</p>
<p>Which will be a bit annoying if I have tons of files to delete?</p>
| 2,539 | 68,183 | 2013-09-10 18:36:29 | 1,786,698 | 27 | 2009-11-23 23:08:01 | 19,563 | 2009-11-23 23:08:01 | https://stackoverflow.com/q/1786692 | https://stackoverflow.com/a/1786698 | <p><code>git add -u</code> will stage all changes to all tracked files, including deletes.</p>
<p>If you have changes that aren't deletes that you don't want to stage you have to do something like:</p>
<pre><code>git diff --name-only --diff-filter=D -z | xargs -0 git rm --
</code></pre>
| <p><code>git add -u</code> will stage all changes to all tracked files, including deletes.</p> <p>If you have changes that aren't deletes that you don't want to stage you have to do something like:</p> <pre><code>git diff --name-only --diff-filter=D -z | xargs -0 git rm -- </code></pre> | 119 | git | <h1>bulk delete in GIT?</h1>
<p>If I manually go into windows explorer and delete a bunch of files, is there any way to bulk commit the change?</p>
<p>I believe even after doing a :</p>
<p>git add .</p>
<p>it still tells me I have to do a:</p>
<p>git rm /path/to/file</p>
<p>Which will be a bit annoying if I have t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,441 | git | # bulk delete in GIT?
If I manually go into windows explorer and delete a bunch of files, is there any way to bulk commit the change?
I believe even after doing a :
git add .
it still tells me I have to do a:
git rm /path/to/file
Which will be a bit annoying if I have tons of files to delete? | `git add -u` will stage all changes to all tracked files, including deletes.
If you have changes that aren't deletes that you don't want to stage you have to do something like:
```
git diff --name-only --diff-filter=D -z | xargs -0 git rm --
``` |
37678725 | GitKraken config file (Windows) | 11 | 2016-06-07 11:56:47 | <p>Where can I find the config files for GitKraken on Windows?</p>
<p>GitKraken shows many repositories, which I would not like to be listed in the "recently opened repos" list. </p>
| 16,160 | 6,430,941 | 2023-05-21 14:58:01 | 37,679,677 | 27 | 2016-06-07 12:40:44 | 2,631,715 | 2019-01-25 10:33:38 | https://stackoverflow.com/q/37678725 | https://stackoverflow.com/a/37679677 | <p>GitKraken saves its configuration in <code>%AppData%/.gitkraken</code>. Despite missing a file ending, all files here are JSON, so you can open them directly in a text editor. <code>config</code> for instance seems to store general settings such as window location and size.</p>
<p>You can remove a repo from "recent... | <p>GitKraken saves its configuration in <code>%AppData%/.gitkraken</code>. Despite missing a file ending, all files here are JSON, so you can open them directly in a text editor. <code>config</code> for instance seems to store general settings such as window location and size.</p> <p>You can remove a repo from "recent... | 64, 119, 119628 | git, gitkraken, windows | <h1>GitKraken config file (Windows)</h1>
<p>Where can I find the config files for GitKraken on Windows?</p>
<p>GitKraken shows many repositories, which I would not like to be listed in the "recently opened repos" list. </p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,443 | git | # GitKraken config file (Windows)
Where can I find the config files for GitKraken on Windows?
GitKraken shows many repositories, which I would not like to be listed in the "recently opened repos" list. | GitKraken saves its configuration in `%AppData%/.gitkraken`. Despite missing a file ending, all files here are JSON, so you can open them directly in a text editor. `config` for instance seems to store general settings such as window location and size.
You can remove a repo from "recently opened repos" by removing it ... |
31555624 | How to add files to another branch? | 11 | 2015-07-22 06:38:20 | <p>For some reason I want to abandon my <code>branch_A</code> but I have some files just committed in that <code>branch_A</code>. I want to add them to <code>branch_B</code>.</p>
<p>How can I do that?</p>
| 21,313 | 3,449,534 | 2023-02-14 13:13:29 | 31,556,245 | 27 | 2015-07-22 07:12:23 | 440,564 | 2015-07-22 07:12:23 | https://stackoverflow.com/q/31555624 | https://stackoverflow.com/a/31556245 | <p>Switch on the branch B:</p>
<pre><code>git checkout branch_B
</code></pre>
<p>Then, checkout the files you want to keep:</p>
<pre><code>git checkout branch_A file1 file2 file3 [...]
</code></pre>
<p>At last, commit your changes</p>
<pre><code>git commit -m "Backport changes from branch A for reasons"
</code></p... | <p>Switch on the branch B:</p> <pre><code>git checkout branch_B </code></pre> <p>Then, checkout the files you want to keep:</p> <pre><code>git checkout branch_A file1 file2 file3 [...] </code></pre> <p>At last, commit your changes</p> <pre><code>git commit -m "Backport changes from branch A for reasons" </code></p... | 119 | git | <h1>How to add files to another branch?</h1>
<p>For some reason I want to abandon my <code>branch_A</code> but I have some files just committed in that <code>branch_A</code>. I want to add them to <code>branch_B</code>.</p>
<p>How can I do that?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,444 | git | # How to add files to another branch?
For some reason I want to abandon my `branch_A` but I have some files just committed in that `branch_A`. I want to add them to `branch_B`.
How can I do that? | Switch on the branch B:
```
git checkout branch_B
```
Then, checkout the files you want to keep:
```
git checkout branch_A file1 file2 file3 [...]
```
At last, commit your changes
```
git commit -m "Backport changes from branch A for reasons"
``` |
15043450 | Git branch from remote tag | 11 | 2013-02-23 17:32:24 | <p>I've created a new local git repository mirrored from another remote repository:</p>
<pre><code>git init
git remote add original {url}
git pull original master
git remote add origin {url}
git push -u origin master
</code></pre>
<p>This would create a mirror of <code>original</code>s master branch.
Now I would like... | 36,882 | 1,163,457 | 2016-12-09 07:38:27 | 15,043,574 | 27 | 2013-02-23 17:45:37 | 228,353 | 2013-02-23 17:50:57 | https://stackoverflow.com/q/15043450 | https://stackoverflow.com/a/15043574 | <p>You need to wrap this in two instructions</p>
<pre><code>git checkout tagname && git checkout -b newbranch
</code></pre>
<p>Alternatively</p>
<pre><code>git checkout tagname -b newbranch
</code></pre>
| <p>You need to wrap this in two instructions</p> <pre><code>git checkout tagname && git checkout -b newbranch </code></pre> <p>Alternatively</p> <pre><code>git checkout tagname -b newbranch </code></pre> | 119, 60718, 76220 | git, git-branch, git-tag | <h1>Git branch from remote tag</h1>
<p>I've created a new local git repository mirrored from another remote repository:</p>
<pre><code>git init
git remote add original {url}
git pull original master
git remote add origin {url}
git push -u origin master
</code></pre>
<p>This would create a mirror of <code>original</co... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,445 | git | # Git branch from remote tag
I've created a new local git repository mirrored from another remote repository:
```
git init
git remote add original {url}
git pull original master
git remote add origin {url}
git push -u origin master
```
This would create a mirror of `original`s master branch.
Now I would like to crea... | You need to wrap this in two instructions
```
git checkout tagname && git checkout -b newbranch
```
Alternatively
```
git checkout tagname -b newbranch
``` |
13074389 | git fetch insufficient permission for adding an object to repository database .git/objects? | 11 | 2012-10-25 17:54:36 | <p>In my repo in my home directory (on an Ubuntu box) I did</p>
<pre><code> git fetch
</code></pre>
<p>I unfortunately got an error about: </p>
<pre><code> insufficient permission for adding an object to repository database .git/objects
</code></pre>
<p>There's a gazillion directories in .git/objects and all of the... | 7,726 | 1,426,193 | 2017-08-14 19:30:58 | 13,074,470 | 27 | 2012-10-25 18:00:30 | 64,004 | 2012-10-25 18:00:30 | https://stackoverflow.com/q/13074389 | https://stackoverflow.com/a/13074470 | <p>Are you the owner of all the files? </p>
<p>Try </p>
<pre><code>chown -R you:you .git
</code></pre>
<p>Then chmod them to "normal"</p>
<pre><code>chmod -R u=rwX,g=rwX,o=
</code></pre>
| <p>Are you the owner of all the files? </p> <p>Try </p> <pre><code>chown -R you:you .git </code></pre> <p>Then chmod them to "normal"</p> <pre><code>chmod -R u=rwX,g=rwX,o= </code></pre> | 119, 359, 2120, 32784, 33720 | directory-permissions, file-permissions, git, git-fetch, permissions | <h1>git fetch insufficient permission for adding an object to repository database .git/objects?</h1>
<p>In my repo in my home directory (on an Ubuntu box) I did</p>
<pre><code> git fetch
</code></pre>
<p>I unfortunately got an error about: </p>
<pre><code> insufficient permission for adding an object to repository d... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,446 | git | # git fetch insufficient permission for adding an object to repository database .git/objects?
In my repo in my home directory (on an Ubuntu box) I did
```
git fetch
```
I unfortunately got an error about:
```
insufficient permission for adding an object to repository database .git/objects
```
There's a gazillion... | Are you the owner of all the files?
Try
```
chown -R you:you .git
```
Then chmod them to "normal"
```
chmod -R u=rwX,g=rwX,o=
``` |
5053679 | Git switch to master and bring untracked files along | 11 | 2011-02-19 21:33:06 | <p>While I was working on a feature_branch I ended up fixing a bug for the whole site. I want to commit the bug fix to master, not my feature_branch. The fix involved adding some new files so when I try to checkout master it aborts and warns me that the untracked files would be overwritten.</p>
<p>How can I switch to ... | 19,337 | 80,559 | 2011-02-19 21:50:39 | 5,053,749 | 27 | 2011-02-19 21:47:32 | 94,102 | 2011-02-19 21:47:32 | https://stackoverflow.com/q/5053679 | https://stackoverflow.com/a/5053749 | <p>Something's not right. Normally when you switch branches the untracked files are brought along with you without any notice. That's why they're called "untracked". However, you say that the untracked files would be overwritten. This implies that you have created an <em>untracked file</em> in the new branch which... | <p>Something's not right. Normally when you switch branches the untracked files are brought along with you without any notice. That's why they're called "untracked". However, you say that the untracked files would be overwritten. This implies that you have created an <em>untracked file</em> in the new branch which... | 119 | git | <h1>Git switch to master and bring untracked files along</h1>
<p>While I was working on a feature_branch I ended up fixing a bug for the whole site. I want to commit the bug fix to master, not my feature_branch. The fix involved adding some new files so when I try to checkout master it aborts and warns me that the untr... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,447 | git | # Git switch to master and bring untracked files along
While I was working on a feature_branch I ended up fixing a bug for the whole site. I want to commit the bug fix to master, not my feature_branch. The fix involved adding some new files so when I try to checkout master it aborts and warns me that the untracked fil... | Something's not right. Normally when you switch branches the untracked files are brought along with you without any notice. That's why they're called "untracked". However, you say that the untracked files would be overwritten. This implies that you have created an *untracked file* in the new branch which already exists... |
39312699 | Showing complete git hash -- not the compressed hash | 10 | 2016-09-04 01:10:48 | <p>How do we get a list with full hashes ?</p>
<pre><code>git reflog
</code></pre>
<p>I could not find about it in the docs.</p>
<pre><code>5826591 HEAD@{0}: commit : Forgot password
c8a98d1 HEAD@{1}: commit : cleaned
02338ed HEAD@{2}: commit : forward to login page
528bec8 HEAD@{3}: commit : password changed
</code... | 3,871 | 896,561 | 2020-11-03 23:18:54 | 39,312,760 | 27 | 2016-09-04 01:27:38 | 4,653,675 | 2016-09-04 01:27:38 | https://stackoverflow.com/q/39312699 | https://stackoverflow.com/a/39312760 | <p>Just execute:</p>
<pre><code>> git reflog --no-abbrev
</code></pre>
| <p>Just execute:</p> <pre><code>> git reflog --no-abbrev </code></pre> | 119 | git | <h1>Showing complete git hash -- not the compressed hash</h1>
<p>How do we get a list with full hashes ?</p>
<pre><code>git reflog
</code></pre>
<p>I could not find about it in the docs.</p>
<pre><code>5826591 HEAD@{0}: commit : Forgot password
c8a98d1 HEAD@{1}: commit : cleaned
02338ed HEAD@{2}: commit : forward to... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,450 | git | # Showing complete git hash -- not the compressed hash
How do we get a list with full hashes ?
```
git reflog
```
I could not find about it in the docs.
```
5826591 HEAD@{0}: commit : Forgot password
c8a98d1 HEAD@{1}: commit : cleaned
02338ed HEAD@{2}: commit : forward to login page
528bec8 HEAD@{3}: commit : passw... | Just execute:
```
> git reflog --no-abbrev
``` |
8839247 | Unresolvable Git error: The following untracked working tree files would be overwritten by checkout | 10 | 2012-01-12 17:14:00 | <p>I am using Git alone for my local software project in Visual Studio 2010. Recently I created a new branch to do a larger refactoring of one of the dialogue windows. I did the following modifications:</p>
<ul>
<li>Rename Form1 to Form1a (including all depending files)</li>
<li>Add new Form1</li>
</ul>
<p>I checked ... | 15,995 | 143,684 | 2018-09-05 17:06:34 | 9,471,730 | 27 | 2012-02-27 20:22:15 | 143,684 | 2012-02-27 20:22:15 | https://stackoverflow.com/q/8839247 | https://stackoverflow.com/a/9471730 | <p>The core.ignorecase config option was not set and Visual Studio had renamed the .Designer.cs file in case, switching from a capital to lower "D" (or vice versa). That was the problem in the end. It took me some file history breakup (deleting and re-adding files) to resolve this error after setting the option to true... | <p>The core.ignorecase config option was not set and Visual Studio had renamed the .Designer.cs file in case, switching from a capital to lower "D" (or vice versa). That was the problem in the end. It took me some file history breakup (deleting and re-adding files) to resolve this error after setting the option to true... | 119, 1879 | branch, git | <h1>Unresolvable Git error: The following untracked working tree files would be overwritten by checkout</h1>
<p>I am using Git alone for my local software project in Visual Studio 2010. Recently I created a new branch to do a larger refactoring of one of the dialogue windows. I did the following modifications:</p>
<ul... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,451 | git | # Unresolvable Git error: The following untracked working tree files would be overwritten by checkout
I am using Git alone for my local software project in Visual Studio 2010. Recently I created a new branch to do a larger refactoring of one of the dialogue windows. I did the following modifications:
- Rename Form1 t... | The core.ignorecase config option was not set and Visual Studio had renamed the .Designer.cs file in case, switching from a capital to lower "D" (or vice versa). That was the problem in the end. It took me some file history breakup (deleting and re-adding files) to resolve this error after setting the option to true. A... |
1678032 | Exporting / Archiving changed files only in Git | 10 | 2009-11-05 02:54:12 | <p>Is there a simple way to export / archive only the changed files from a given commit or series of commits in git? I can't seem to find clear instructions to do this (and I'm new to Linux/Git).</p>
<p>I am using msysgit, and for the most part I'm fine with deploying entire repositories but in many cases it is much m... | 9,073 | 203,121 | 2014-08-17 05:03:27 | 1,678,056 | 27 | 2009-11-05 02:58:11 | 893 | 2009-11-05 03:06:57 | https://stackoverflow.com/q/1678032 | https://stackoverflow.com/a/1678056 | <p>I don't think there's any need to involve git-archive. Using <code>--name-only</code>, you could tar up the files:</p>
<pre><code>tar czf new-files.tar.gz `git diff --name-only [diff options]`
</code></pre>
<p>Since you're new to Linux, this might need some explanation:</p>
<p>The backticks in the command line ca... | <p>I don't think there's any need to involve git-archive. Using <code>--name-only</code>, you could tar up the files:</p> <pre><code>tar czf new-files.tar.gz `git diff --name-only [diff options]` </code></pre> <p>Since you're new to Linux, this might need some explanation:</p> <p>The backticks in the command line ca... | 119, 4167, 9655, 21628 | archive, export, git, msysgit | <h1>Exporting / Archiving changed files only in Git</h1>
<p>Is there a simple way to export / archive only the changed files from a given commit or series of commits in git? I can't seem to find clear instructions to do this (and I'm new to Linux/Git).</p>
<p>I am using msysgit, and for the most part I'm fine with dep... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,452 | git | # Exporting / Archiving changed files only in Git
Is there a simple way to export / archive only the changed files from a given commit or series of commits in git? I can't seem to find clear instructions to do this (and I'm new to Linux/Git).
I am using msysgit, and for the most part I'm fine with deploying entire re... | I don't think there's any need to involve git-archive. Using `--name-only`, you could tar up the files:
```
tar czf new-files.tar.gz `git diff --name-only [diff options]`
```
Since you're new to Linux, this might need some explanation:
The backticks in the command line cause the shell to first execute the command wi... |
24074208 | git svn fetch: Could not unmemoize function `check_cherry_pick', because it was not memoized to begin with | 9 | 2014-06-06 04:33:41 | <p>I'm hitting the following error while running <code>git svn fetch</code>:</p>
<pre><code>Complex regular subexpression recursion limit (32766) exceeded at /usr/share/perl5/vendor_perl/YAML/Loader.pm line 517, <$IN> line 1.
YAML Error: Can't parse double quoted string
Code: YAML_PARSE_ERR_BAD_DOUBLE
Line... | 1,449 | 441,652 | 2014-06-06 04:50:28 | 24,074,379 | 27 | 2014-06-06 04:50:28 | 441,652 | 2014-06-06 04:50:28 | https://stackoverflow.com/q/24074208 | https://stackoverflow.com/a/24074379 | <p>Googling led me to <a href="https://groups.google.com/d/msg/git-version-control/KWD-LUyMYbA/TJIbf4c1on8J">the following solution</a>:</p>
<pre><code>rm -rf .git/svn/.caches
</code></pre>
| <p>Googling led me to <a href="https://groups.google.com/d/msg/git-version-control/KWD-LUyMYbA/TJIbf4c1on8J">the following solution</a>:</p> <pre><code>rm -rf .git/svn/.caches </code></pre> | 119, 6452 | git, git-svn | <h1>git svn fetch: Could not unmemoize function `check_cherry_pick', because it was not memoized to begin with</h1>
<p>I'm hitting the following error while running <code>git svn fetch</code>:</p>
<pre><code>Complex regular subexpression recursion limit (32766) exceeded at /usr/share/perl5/vendor_perl/YAML/Loader.pm l... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,453 | git | # git svn fetch: Could not unmemoize function `check_cherry_pick', because it was not memoized to begin with
I'm hitting the following error while running `git svn fetch`:
```
Complex regular subexpression recursion limit (32766) exceeded at /usr/share/perl5/vendor_perl/YAML/Loader.pm line 517, <$IN> line 1.
YAML Err... | Googling led me to [the following solution](https://groups.google.com/d/msg/git-version-control/KWD-LUyMYbA/TJIbf4c1on8J):
```
rm -rf .git/svn/.caches
``` |
57555550 | How to change the URL on a local repository from GitLab to GitHub? | 8 | 2019-08-19 11:09:50 | <p>I had a repository on GitLab which I also published on GitHub.</p>
<p>As of now all the Git commands I am using are making changes on GitLab. However, I want those commits on GitHub.</p>
<p>I tried the command:</p>
<pre><code>git remote set-url origin git@github.com:repo-url
</code></pre>
<p>Can someone suggest me h... | 11,917 | 8,716,649 | 2021-08-30 16:54:00 | 57,555,833 | 27 | 2019-08-19 11:28:36 | 2,764,486 | 2019-08-19 12:29:15 | https://stackoverflow.com/q/57555550 | https://stackoverflow.com/a/57555833 | <p><strong>If you want to use both GitHub and GitLab:</strong></p>
<pre><code>git remote add github <your-github-url> # create a remote for GitHub
git remote add gitlab <your-gitlab-url> # create another remote for GitLab
git push -u github <local_branch_name> # set the default upstream to GitHub... | <p><strong>If you want to use both GitHub and GitLab:</strong></p> <pre><code>git remote add github <your-github-url> # create a remote for GitHub git remote add gitlab <your-gitlab-url> # create another remote for GitLab git push -u github <local_branch_name> # set the default upstream to GitHub... | 119, 28896, 28898, 33720, 41346 | git, git-fetch, git-pull, git-push, git-remote | <h1>How to change the URL on a local repository from GitLab to GitHub?</h1>
<p>I had a repository on GitLab which I also published on GitHub.</p>
<p>As of now all the Git commands I am using are making changes on GitLab. However, I want those commits on GitHub.</p>
<p>I tried the command:</p>
<pre><code>git remote set-... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,454 | git | # How to change the URL on a local repository from GitLab to GitHub?
I had a repository on GitLab which I also published on GitHub.
As of now all the Git commands I am using are making changes on GitLab. However, I want those commits on GitHub.
I tried the command:
```
git remote set-url origin git@github.com:repo-... | **If you want to use both GitHub and GitLab:**
```
git remote add github <your-github-url> # create a remote for GitHub
git remote add gitlab <your-gitlab-url> # create another remote for GitLab
git push -u github <local_branch_name> # set the default upstream to GitHub
```
**If you want to change your remote URL... |
68867420 | How to install git-lfs on WSL2? | 7 | 2021-08-20 19:47:19 | <pre><code>fatal: 'lfs' appears to be a git command, but we were not
able to execute it. Maybe git-lfs is broken?
</code></pre>
<p>Installing git-lfs on kali or ubuntu is simple, but steps are not easy to find. In my case it was because I needed it for git subrepo</p>
<pre><code>This repository is configured for Git LF... | 13,775 | 11,468,263 | 2023-04-27 09:46:52 | 68,867,421 | 27 | 2021-08-20 19:47:19 | 11,468,263 | 2023-04-27 09:46:52 | https://stackoverflow.com/q/68867420 | https://stackoverflow.com/a/68867421 | <p>You can install git-lfs on WSL through your linux distribution's package manager. For example, in Debian or Ubuntu on WSL you would type:</p>
<ol>
<li><code>sudo apt-get install git-lfs</code></li>
<li><code>git lfs install</code></li>
</ol>
<p><a href="https://github.com/git-lfs/git-lfs/wiki/Installation" rel="nore... | <p>You can install git-lfs on WSL through your linux distribution's package manager. For example, in Debian or Ubuntu on WSL you would type:</p> <ol> <li><code>sudo apt-get install git-lfs</code></li> <li><code>git lfs install</code></li> </ol> <p><a href="https://github.com/git-lfs/git-lfs/wiki/Installation" rel="nore... | 115244, 119526 | git-lfs, windows-subsystem-for-linux | <h1>How to install git-lfs on WSL2?</h1>
<pre><code>fatal: 'lfs' appears to be a git command, but we were not
able to execute it. Maybe git-lfs is broken?
</code></pre>
<p>Installing git-lfs on kali or ubuntu is simple, but steps are not easy to find. In my case it was because I needed it for git subrepo</p>
<pre><code... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,456 | git | # How to install git-lfs on WSL2?
```
fatal: 'lfs' appears to be a git command, but we were not
able to execute it. Maybe git-lfs is broken?
```
Installing git-lfs on kali or ubuntu is simple, but steps are not easy to find. In my case it was because I needed it for git subrepo
```
This repository is configured for ... | You can install git-lfs on WSL through your linux distribution's package manager. For example, in Debian or Ubuntu on WSL you would type:
1. `sudo apt-get install git-lfs`
2. `git lfs install`
[Readme](https://github.com/git-lfs/git-lfs/wiki/Installation)
If you instead want to install git-lfs it on Windows directly... |
1918111 | My Git repository is in the wrong root directory. Can I move it? (../ instead of ./) | 149 | 2009-12-16 22:03:16 | <p>Somehow when I <code>git init</code>ed my latest project a month or so ago I ran the command in the directory one directory higher than the root of my project.</p>
<p>So my repository is in the <code>./project</code> directory and not the <code>./project/my-new-project</code> directory. I don't know how I didn't r... | 96,432 | 192,714 | 2024-01-29 08:40:22 | 1,918,233 | 26 | 2009-12-16 22:24:22 | 29,639 | 2016-10-28 18:26:41 | https://stackoverflow.com/q/1918111 | https://stackoverflow.com/a/1918233 | <p>Probably the simplest thing, unless you have already created some history you want to save, would be to just delete the <code>.git</code> subdirectory and redo the init in the correct directory.</p>
<p>If you used git to solve the problem, any solution would necessarily leave behind a lot of "moved this file here" ... | <p>Probably the simplest thing, unless you have already created some history you want to save, would be to just delete the <code>.git</code> subdirectory and redo the init in the correct directory.</p> <p>If you used git to solve the problem, any solution would necessarily leave behind a lot of "moved this file here" ... | 119 | git | <h1>My Git repository is in the wrong root directory. Can I move it? (../ instead of ./)</h1>
<p>Somehow when I <code>git init</code>ed my latest project a month or so ago I ran the command in the directory one directory higher than the root of my project.</p>
<p>So my repository is in the <code>./project</code> direc... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,458 | git | # My Git repository is in the wrong root directory. Can I move it? (../ instead of ./)
Somehow when I `git init`ed my latest project a month or so ago I ran the command in the directory one directory higher than the root of my project.
So my repository is in the `./project` directory and not the `./project/my-new-pro... | Probably the simplest thing, unless you have already created some history you want to save, would be to just delete the `.git` subdirectory and redo the init in the correct directory.
If you used git to solve the problem, any solution would necessarily leave behind a lot of "moved this file here" history entries that ... |
2298556 | Branches have apparently diverged, but commit history is identical | 48 | 2010-02-19 18:09:20 | <p><code>git status</code> tells me that my branch and the one I started from on another repository have diverged:</p>
<pre><code># On branch master
# Your branch and 'origin/master' have diverged,
# and have 13 and 13 different commit(s) each, respectively.
</code></pre>
<p>but the commit history for each is identic... | 50,012 | 277,208 | 2012-05-30 20:25:15 | 2,379,277 | 26 | 2010-03-04 12:40:22 | 225,718 | 2010-03-04 12:40:22 | https://stackoverflow.com/q/2298556 | https://stackoverflow.com/a/2379277 | <p>It looks like you also forgot to update remote repositories. So do <code>git remote update</code> in rep_A (it will probably warn it is not fast-forward update as you seem to do rebase on both ends) and then the histories should be identical.</p>
| <p>It looks like you also forgot to update remote repositories. So do <code>git remote update</code> in rep_A (it will probably warn it is not fast-forward update as you seem to do rebase on both ends) and then the histories should be identical.</p> | 119 | git | <h1>Branches have apparently diverged, but commit history is identical</h1>
<p><code>git status</code> tells me that my branch and the one I started from on another repository have diverged:</p>
<pre><code># On branch master
# Your branch and 'origin/master' have diverged,
# and have 13 and 13 different commit(s) each... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,459 | git | # Branches have apparently diverged, but commit history is identical
`git status` tells me that my branch and the one I started from on another repository have diverged:
```
# On branch master
# Your branch and 'origin/master' have diverged,
# and have 13 and 13 different commit(s) each, respectively.
```
but the co... | It looks like you also forgot to update remote repositories. So do `git remote update` in rep_A (it will probably warn it is not fast-forward update as you seem to do rebase on both ends) and then the histories should be identical. |
17097263 | Automatic versioning of Android build using git describe with Gradle | 45 | 2013-06-13 21:19:13 | <p>I have searched extensively, but likely due to the newness of Android Studio and Gradle. I haven't found any description of how to do this. I want to do basically exactly what is described in <a href="https://stackoverflow.com/questions/14895123/auto-version-numbering-your-android-app-using-git-and-eclipse-on-linux... | 28,409 | 1,452,472 | 2022-01-05 08:18:37 | 32,245,036 | 26 | 2015-08-27 09:03:43 | 813,810 | 2022-01-05 08:18:37 | https://stackoverflow.com/q/17097263 | https://stackoverflow.com/a/32245036 | <p>A more proper and lean way to achieve the result which gained traction lately would be to use <a href="https://github.com/ajoberstar/grgit" rel="nofollow noreferrer">grgit integration</a>, which uses <a href="https://www.eclipse.org/jgit/" rel="nofollow noreferrer">JGit Java libray</a>. As it uses JGit it doesn't ev... | <p>A more proper and lean way to achieve the result which gained traction lately would be to use <a href="https://github.com/ajoberstar/grgit" rel="nofollow noreferrer">grgit integration</a>, which uses <a href="https://www.eclipse.org/jgit/" rel="nofollow noreferrer">JGit Java libray</a>. As it uses JGit it doesn't ev... | 119, 1386, 12039, 32307, 47737 | android, android-build, auto-versioning, git, gradle | <h1>Automatic versioning of Android build using git describe with Gradle</h1>
<p>I have searched extensively, but likely due to the newness of Android Studio and Gradle. I haven't found any description of how to do this. I want to do basically exactly what is described in <a href="https://stackoverflow.com/questions/1... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,460 | git | # Automatic versioning of Android build using git describe with Gradle
I have searched extensively, but likely due to the newness of Android Studio and Gradle. I haven't found any description of how to do this. I want to do basically exactly what is described in [this post](https://stackoverflow.com/questions/14895123... | A more proper and lean way to achieve the result which gained traction lately would be to use [grgit integration](https://github.com/ajoberstar/grgit), which uses [JGit Java libray](https://www.eclipse.org/jgit/). As it uses JGit it doesn't even require git to be installed to work (which simplifies things in build pipe... |
49917616 | What is the git clone --filter option's syntax? | 44 | 2018-04-19 09:34:15 | <p>The Git 2.17 <a href="https://github.com/git/git/blob/master/Documentation/RelNotes/2.17.0.txt" rel="noreferrer">changelog</a> describes this option:</p>
<blockquote>
<ul>
<li>The machinery to clone & fetch, which in turn involves packing and
unpacking objects, has been told how to omit certain objects u... | 55,486 | 1,682,146 | 2023-03-02 17:24:13 | 51,411,174 | 26 | 2018-07-18 21:23:04 | 3,195,526 | 2023-03-02 17:24:13 | https://stackoverflow.com/q/49917616 | https://stackoverflow.com/a/51411174 | <p>The format for filter-spec is defined in the options section of <code>git rev-list --help</code>. You can also <a href="https://git-scm.com/docs/git-rev-list#Documentation/git-rev-list.txt---filterltfilter-specgt" rel="noreferrer">see it in the docs</a>. Here's what it currently says:</p>
<blockquote>
<h3>--filter=... | <p>The format for filter-spec is defined in the options section of <code>git rev-list --help</code>. You can also <a href="https://git-scm.com/docs/git-rev-list#Documentation/git-rev-list.txt---filterltfilter-specgt" rel="noreferrer">see it in the docs</a>. Here's what it currently says:</p> <blockquote> <h3>--filter=... | 119 | git | <h1>What is the git clone --filter option's syntax?</h1>
<p>The Git 2.17 <a href="https://github.com/git/git/blob/master/Documentation/RelNotes/2.17.0.txt" rel="noreferrer">changelog</a> describes this option:</p>
<blockquote>
<ul>
<li>The machinery to clone & fetch, which in turn involves packing and
unpac... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,461 | git | # What is the git clone --filter option's syntax?
The Git 2.17 [changelog](https://github.com/git/git/blob/master/Documentation/RelNotes/2.17.0.txt) describes this option:
> - The machinery to clone & fetch, which in turn involves packing and
> unpacking objects, has been told how to omit certain objects using
> ... | The format for filter-spec is defined in the options section of `git rev-list --help`. You can also [see it in the docs](https://git-scm.com/docs/git-rev-list#Documentation/git-rev-list.txt---filterltfilter-specgt). Here's what it currently says:
> ### --filter=<filter-spec>
>
> Only useful with one of the --objects*;... |
5916565 | Define a Git alias with the same name, to shadow the original command | 39 | 2011-05-06 20:16:55 | <p>I'm trying to use to use the same name for an alias as the existing command, so that the alias shadows the original command (preventing me from deleting files off the working tree).</p>
<pre class="lang-none prettyprint-override"><code>[alias]
rm = rm --cached
diff = diff --color
</code></pre>
<p>Unfortunately... | 6,202 | 432,113 | 2025-12-09 00:45:47 | 5,917,211 | 26 | 2011-05-06 21:29:27 | 28,804 | 2017-07-10 21:50:25 | https://stackoverflow.com/q/5916565 | https://stackoverflow.com/a/5917211 | <p>For commands like <code>rm --cached</code> that don't have configurable options, your best bet is to just make an alias named differently. For example:</p>
<pre><code>[alias]
rmc = rm --cached
</code></pre>
<p>You may have already figured this out, but Git aliases cannot shadow existing Git commands. From ... | <p>For commands like <code>rm --cached</code> that don't have configurable options, your best bet is to just make an alias named differently. For example:</p> <pre><code>[alias] rmc = rm --cached </code></pre> <p>You may have already figured this out, but Git aliases cannot shadow existing Git commands. From ... | 119, 1448 | alias, git | <h1>Define a Git alias with the same name, to shadow the original command</h1>
<p>I'm trying to use to use the same name for an alias as the existing command, so that the alias shadows the original command (preventing me from deleting files off the working tree).</p>
<pre class="lang-none prettyprint-override"><code>[a... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,462 | git | # Define a Git alias with the same name, to shadow the original command
I'm trying to use to use the same name for an alias as the existing command, so that the alias shadows the original command (preventing me from deleting files off the working tree).
```
[alias]
rm = rm --cached
diff = diff --color
```
Unfo... | For commands like `rm --cached` that don't have configurable options, your best bet is to just make an alias named differently. For example:
```
[alias]
rmc = rm --cached
```
You may have already figured this out, but Git aliases cannot shadow existing Git commands. From the [`git-config` man page](https://ww... |
33428099 | What is the difference between Git for Windows and Github Desktop? | 37 | 2015-10-30 03:19:27 | <p>As a programming neophyte, I have recently installed Github Desktop on Windows 10. However, upon using npm, I have discovered that some packages, like <a href="https://www.npmjs.com/package/bower" rel="noreferrer">bower</a>, require the user to install <a href="https://git-for-windows.github.io/" rel="noreferrer">Gi... | 52,588 | 4,616,609 | 2017-09-12 12:03:50 | 35,129,798 | 26 | 2016-02-01 11:49:38 | 6,309 | 2016-02-01 11:49:38 | https://stackoverflow.com/q/33428099 | https://stackoverflow.com/a/35129798 | <blockquote>
<p>Would it be necessary to uninstall my current git and Github Desktop installation in order to to adjust my git command-line tools? </p>
</blockquote>
<p>No both are completely independent.</p>
<ul>
<li><a href="https://github.com/git-for-windows/git/releases" rel="noreferrer">git for Windows</a> del... | <blockquote> <p>Would it be necessary to uninstall my current git and Github Desktop installation in order to to adjust my git command-line tools? </p> </blockquote> <p>No both are completely independent.</p> <ul> <li><a href="https://github.com/git-for-windows/git/releases" rel="noreferrer">git for Windows</a> del... | 119 | git | <h1>What is the difference between Git for Windows and Github Desktop?</h1>
<p>As a programming neophyte, I have recently installed Github Desktop on Windows 10. However, upon using npm, I have discovered that some packages, like <a href="https://www.npmjs.com/package/bower" rel="noreferrer">bower</a>, require the user... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,463 | git | # What is the difference between Git for Windows and Github Desktop?
As a programming neophyte, I have recently installed Github Desktop on Windows 10. However, upon using npm, I have discovered that some packages, like [bower](https://www.npmjs.com/package/bower), require the user to install [Git for Windows](https:/... | > Would it be necessary to uninstall my current git and Github Desktop installation in order to to adjust my git command-line tools?
No both are completely independent.
- [git for Windows](https://github.com/git-for-windows/git/releases) delivers MSys2-based Git builds (see "[How are msys, msys2, and msysgit related ... |
4860166 | How to synchronize two git repositories | 36 | 2011-02-01 07:55:00 | <p>I have two git repositories on different PCs. I have some local branches on every one of them. I don`t want to send this branches to remote server, just keep them local. How can I synchronize then without using a web? Can I just zip repository on one PC and move to another? Is that safe? Maybe I can export somehow n... | 39,829 | 205,234 | 2023-04-12 22:13:23 | 4,860,455 | 26 | 2011-02-01 08:40:31 | 6,309 | 2023-04-12 22:13:23 | https://stackoverflow.com/q/4860166 | https://stackoverflow.com/a/4860455 | <p>Rather than making a bare clone, I prefer making a <strong><a href="https://schacon.github.io/git/git-bundle.html" rel="nofollow noreferrer">bundle</a></strong> (see "<a href="https://stackoverflow.com/questions/2545765/how-can-i-email-someone-a-git-repository/2545784#2545784">How can I email someone a git repo... | <p>Rather than making a bare clone, I prefer making a <strong><a href="https://schacon.github.io/git/git-bundle.html" rel="nofollow noreferrer">bundle</a></strong> (see "<a href="https://stackoverflow.com/questions/2545765/how-can-i-email-someone-a-git-repository/2545784#2545784">How can I email someone a git repo... | 119, 6936 | git, offline-mode | <h1>How to synchronize two git repositories</h1>
<p>I have two git repositories on different PCs. I have some local branches on every one of them. I don`t want to send this branches to remote server, just keep them local. How can I synchronize then without using a web? Can I just zip repository on one PC and move to an... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,465 | git | # How to synchronize two git repositories
I have two git repositories on different PCs. I have some local branches on every one of them. I don`t want to send this branches to remote server, just keep them local. How can I synchronize then without using a web? Can I just zip repository on one PC and move to another? Is... | Rather than making a bare clone, I prefer making a **[bundle](https://schacon.github.io/git/git-bundle.html)** (see "[How can I email someone a git repository?](https://stackoverflow.com/questions/2545765/how-can-i-email-someone-a-git-repository/2545784#2545784)"), which generates *one* file, easier to copy around (on ... |
1271449 | How to set Subversion properties with git-svn | 35 | 2009-08-13 11:36:05 | <p>Is there a way to set subversion properties on a git repository that was created by git-svn?</p>
<p>In my case, I want to edit the version of <code>svn:external</code>, <code>svn:ignore</code> and
<code>svn:executable</code>.</p>
<p>However, the only way to do so seems to involve a check-out with the subversion cl... | 10,537 | 25,234 | 2015-02-01 21:21:24 | 28,268,059 | 26 | 2015-02-01 21:21:24 | 6,309 | 2015-02-01 21:21:24 | https://stackoverflow.com/q/1271449 | https://stackoverflow.com/a/28268059 | <p>Note: git 2.3.0 (February 2015) supports proset with <a href="http://git-scm.com/docs/git-svn" rel="noreferrer"><code>git svn</code></a>.<br />
See <a href="https://github.com/git/git/commit/83c9433e679635f8fbf8961081ea3581c93ca778" rel="noreferrer">commit 83c9433</a> by <a href="https://github.com/splbio" rel="nore... | <p>Note: git 2.3.0 (February 2015) supports proset with <a href="http://git-scm.com/docs/git-svn" rel="noreferrer"><code>git svn</code></a>.<br /> See <a href="https://github.com/git/git/commit/83c9433e679635f8fbf8961081ea3581c93ca778" rel="noreferrer">commit 83c9433</a> by <a href="https://github.com/splbio" rel="nore... | 63, 119, 131, 6452 | collaboration, git, git-svn, svn | <h1>How to set Subversion properties with git-svn</h1>
<p>Is there a way to set subversion properties on a git repository that was created by git-svn?</p>
<p>In my case, I want to edit the version of <code>svn:external</code>, <code>svn:ignore</code> and
<code>svn:executable</code>.</p>
<p>However, the only way to do... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,466 | git | # How to set Subversion properties with git-svn
Is there a way to set subversion properties on a git repository that was created by git-svn?
In my case, I want to edit the version of `svn:external`, `svn:ignore` and
`svn:executable`.
However, the only way to do so seems to involve a check-out with the subversion cli... | Note: git 2.3.0 (February 2015) supports proset with [`git svn`](http://git-scm.com/docs/git-svn).
See [commit 83c9433](https://github.com/git/git/commit/83c9433e679635f8fbf8961081ea3581c93ca778) by [Alfred Perlstein (`splbio`)](https://github.com/splbio):
> ### `git-svn`: support for `git-svn propset`
>
> This chan... |
27529191 | How to update code from Git to a Docker container | 33 | 2014-12-17 15:35:43 | <p>I have a Docker file trying to deploy Django code to a container</p>
<pre><code>FROM ubuntu:latest
MAINTAINER { myname }
#RUN echo "deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -sc) main universe" >> /etc/apt/sou$
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tar git curl ... | 31,742 | 1,008,459 | 2017-11-29 22:42:08 | 27,530,136 | 26 | 2014-12-17 16:23:42 | 1,162,501 | 2017-11-29 22:40:42 | https://stackoverflow.com/q/27529191 | https://stackoverflow.com/a/27530136 | <p>There are a couple of approaches you can use.</p>
<ol>
<li>You can use <code>docker build --no-cache</code> to avoid using the cache of the Git clone.</li>
<li>The startup command calls <code>git pull</code>. So instead of running <code>python manage.py</code>, you'd have something like <code>CMD cd /repo &&... | <p>There are a couple of approaches you can use.</p> <ol> <li>You can use <code>docker build --no-cache</code> to avoid using the cache of the Git clone.</li> <li>The startup command calls <code>git pull</code>. So instead of running <code>python manage.py</code>, you'd have something like <code>CMD cd /repo &&... | 16, 119, 190, 1066, 90304 | continuous-integration, deployment, docker, git, python | <h1>How to update code from Git to a Docker container</h1>
<p>I have a Docker file trying to deploy Django code to a container</p>
<pre><code>FROM ubuntu:latest
MAINTAINER { myname }
#RUN echo "deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -sc) main universe" >> /etc/apt/sou$
RUN apt-get update
RUN DEBI... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,467 | git | # How to update code from Git to a Docker container
I have a Docker file trying to deploy Django code to a container
```
FROM ubuntu:latest
MAINTAINER { myname }
#RUN echo "deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -sc) main universe" >> /etc/apt/sou$
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive... | There are a couple of approaches you can use.
1. You can use `docker build --no-cache` to avoid using the cache of the Git clone.
2. The startup command calls `git pull`. So instead of running `python manage.py`, you'd have something like `CMD cd /repo && git pull && python manage.py` or use a start script if things a... |
2671296 | hudson+git FATAL: Could not apply tag | 33 | 2010-04-19 22:15:11 | <p>I'm trying to set up hudson with git according to <a href="http://luhman.org/blog/2009/12/16/installing-hudson-phing-phpunit-and-git-ubuntu" rel="noreferrer">this article</a>,
but I still get git errors during build:</p>
<pre><code>FATAL: Could not apply tag-PROJECTNAME-ID
...
Caused by: hudson.plugins.git.GitExcep... | 15,512 | 234,780 | 2013-10-02 09:13:35 | 2,673,064 | 26 | 2010-04-20 06:35:10 | 6,309 | 2010-04-20 06:44:40 | https://stackoverflow.com/q/2671296 | https://stackoverflow.com/a/2673064 | <p>If might need both <code>user.name</code> and <code>user.email</code>.<br>
There is actually an <a href="http://issues.hudson-ci.org/browse/HUDSON-2754" rel="noreferrer">open ticket to set them automatically</a>.</p>
<p>It might also be a <a href="http://forthedeveloper.com/2010/git-config-with-hudson-on-ubuntus-to... | <p>If might need both <code>user.name</code> and <code>user.email</code>.<br> There is actually an <a href="http://issues.hudson-ci.org/browse/HUDSON-2754" rel="noreferrer">open ticket to set them automatically</a>.</p> <p>It might also be a <a href="http://forthedeveloper.com/2010/git-config-with-hudson-on-ubuntus-to... | 119, 1066, 3858, 50785, 64999 | continuous-integration, git, hudson, hudson-plugins, jenkins | <h1>hudson+git FATAL: Could not apply tag</h1>
<p>I'm trying to set up hudson with git according to <a href="http://luhman.org/blog/2009/12/16/installing-hudson-phing-phpunit-and-git-ubuntu" rel="noreferrer">this article</a>,
but I still get git errors during build:</p>
<pre><code>FATAL: Could not apply tag-PROJECTNAM... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,468 | git | # hudson+git FATAL: Could not apply tag
I'm trying to set up hudson with git according to [this article](http://luhman.org/blog/2009/12/16/installing-hudson-phing-phpunit-and-git-ubuntu),
but I still get git errors during build:
```
FATAL: Could not apply tag-PROJECTNAME-ID
...
Caused by: hudson.plugins.git.GitExcept... | If might need both `user.name` and `user.email`.
There is actually an [open ticket to set them automatically](http://issues.hudson-ci.org/browse/HUDSON-2754).
It might also be a [Hudson server issue](http://forthedeveloper.com/2010/git-config-with-hudson-on-ubuntus-tomcat/):
> I was a little confused to see this me... |
1464642 | Git merge squash repeatedly | 31 | 2009-09-23 08:12:41 | <p>I'm trying to have two branches with binary files in git - one "development" and one "stable". The development branch can have several changes of these files before I want to "release" them to the stable branch (and the stable branch has those files renamed, in case that's relevant).</p>
<p>I could do a normal merg... | 11,230 | 27,610 | 2017-12-03 17:22:04 | 4,481,621 | 26 | 2010-12-19 04:40:45 | 445,619 | 2010-12-19 04:40:45 | https://stackoverflow.com/q/1464642 | https://stackoverflow.com/a/4481621 | <p>Starting with</p>
<pre><code> X stable
/
a---b---c---d---e---f---g development
</code></pre>
<p>You can use the following steps to copy the last commit from your development branch to your stable branch:</p>
<pre><code>git checkout development@{0} # get working tree from "development... | <p>Starting with</p> <pre><code> X stable / a---b---c---d---e---f---g development </code></pre> <p>You can use the following steps to copy the last commit from your development branch to your stable branch:</p> <pre><code>git checkout development@{0} # get working tree from "development... | 119, 456, 717 | git, merge, version-control | <h1>Git merge squash repeatedly</h1>
<p>I'm trying to have two branches with binary files in git - one "development" and one "stable". The development branch can have several changes of these files before I want to "release" them to the stable branch (and the stable branch has those files renamed, in case that's releva... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,471 | git | # Git merge squash repeatedly
I'm trying to have two branches with binary files in git - one "development" and one "stable". The development branch can have several changes of these files before I want to "release" them to the stable branch (and the stable branch has those files renamed, in case that's relevant).
I c... | Starting with
```
X stable
/
a---b---c---d---e---f---g development
```
You can use the following steps to copy the last commit from your development branch to your stable branch:
```
git checkout development@{0} # get working tree from "development", detach HEAD
git reset --soft stable... |
4164874 | git commit -a confusion | 30 | 2010-11-12 13:03:45 | <p>I am using Git Bash and am trying to figure out what is happening when I type 'git commit -a'.</p>
<p>Looks like VIM opens up to edit my commit message but how do I save and actually complete this commit? I type in the editor and hit enter but it just creates another line. </p>
<p>FYI: I am using VM Fusion on my ... | 42,484 | 34,548 | 2012-04-02 18:51:34 | 4,164,912 | 26 | 2010-11-12 13:09:03 | 252,591 | 2012-04-02 18:51:34 | https://stackoverflow.com/q/4164874 | https://stackoverflow.com/a/4164912 | <p>Just leave VIM (<em>command mode</em> -> <code>:wq</code>).</p>
<p><code>-a</code> flag works like:</p>
<pre><code>git add -u
git commit ...
</code></pre>
<p><code>-m</code> flag specifies commit message. That message is mandatory so if you don't pass that (<code>git commit -m "My message"</code>) the default tex... | <p>Just leave VIM (<em>command mode</em> -> <code>:wq</code>).</p> <p><code>-a</code> flag works like:</p> <pre><code>git add -u git commit ... </code></pre> <p><code>-m</code> flag specifies commit message. That message is mandatory so if you don't pass that (<code>git commit -m "My message"</code>) the default tex... | 119, 370 | git, vim | <h1>git commit -a confusion</h1>
<p>I am using Git Bash and am trying to figure out what is happening when I type 'git commit -a'.</p>
<p>Looks like VIM opens up to edit my commit message but how do I save and actually complete this commit? I type in the editor and hit enter but it just creates another line. </p>
<p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,474 | git | # git commit -a confusion
I am using Git Bash and am trying to figure out what is happening when I type 'git commit -a'.
Looks like VIM opens up to edit my commit message but how do I save and actually complete this commit? I type in the editor and hit enter but it just creates another line.
FYI: I am using VM Fusio... | Just leave VIM (*command mode* -> `:wq`).
`-a` flag works like:
```
git add -u
git commit ...
```
`-m` flag specifies commit message. That message is mandatory so if you don't pass that (`git commit -m "My message"`) the default text editor will be opened (you can change it in git configuration) and you'll have to w... |
32538639 | Cannot find gitconfig file | 29 | 2015-09-12 12:12:08 | <p>I just started learning about Linux and Git.
Im using Linux Mint. I have Git and emacs installed via apt-get.</p>
<p>Im using the following tutorial
<a href="https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup" rel="noreferrer">https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup</a>... | 96,122 | 5,328,300 | 2022-06-16 18:15:22 | 32,538,857 | 26 | 2015-09-12 12:36:10 | 6,309 | 2022-06-16 18:15:22 | https://stackoverflow.com/q/32538639 | https://stackoverflow.com/a/32538857 | <p>As confirmed by the OP, any <code>git config --global</code> command will create/update <code>~/.gitconfig</code>.</p>
<p>But as it is an hidden file by default, you would need a <code>ls -alrt</code> to see it.<br />
<code>git config --global -l</code> will list its content.</p>
<p>More generally, <code>git config ... | <p>As confirmed by the OP, any <code>git config --global</code> command will create/update <code>~/.gitconfig</code>.</p> <p>But as it is an hidden file by default, you would need a <code>ls -alrt</code> to see it.<br /> <code>git config --global -l</code> will list its content.</p> <p>More generally, <code>git config ... | 119, 54708 | git, linux-mint | <h1>Cannot find gitconfig file</h1>
<p>I just started learning about Linux and Git.
Im using Linux Mint. I have Git and emacs installed via apt-get.</p>
<p>Im using the following tutorial
<a href="https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup" rel="noreferrer">https://git-scm.com/book/en/v2/Gett... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,476 | git | # Cannot find gitconfig file
I just started learning about Linux and Git.
Im using Linux Mint. I have Git and emacs installed via apt-get.
Im using the following tutorial
<https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup>
it says that there are configuration files in three different places:
1. `/... | As confirmed by the OP, any `git config --global` command will create/update `~/.gitconfig`.
But as it is an hidden file by default, you would need a `ls -alrt` to see it.
`git config --global -l` will list its content.
More generally, `git config --list --show-origin` shows all config files (and each line of the c... |
20586992 | Heroku: Your account example@email.com does not have access to <app-name> | 29 | 2013-12-14 18:57:19 | <p>I am having trouble pushing code to Heroku. I have an account but I've forgotten the password. I created a new account and tried to push with it but now it shows me this error:</p>
<pre><code>Your account someoneelse@gmail.com does not have access to
! SSH Key Fingerprint:
</code></pre>
<p>How can I log in with the... | 15,997 | 2,279,018 | 2025-09-20 11:46:13 | 20,592,890 | 26 | 2013-12-15 09:02:33 | 6,309 | 2016-07-03 04:41:10 | https://stackoverflow.com/q/20586992 | https://stackoverflow.com/a/20592890 | <p>You need to:</p>
<ul>
<li>clean any extra ssh key in your Heroku app that you don't have locally (See <a href="https://stackoverflow.com/users/2279018/ssr">SSR</a>'s <a href="https://stackoverflow.com/posts/20586992/revisions">edit</a>)</li>
<li><p>register your new account (as described in "<a href="http://martyha... | <p>You need to:</p> <ul> <li>clean any extra ssh key in your Heroku app that you don't have locally (See <a href="https://stackoverflow.com/users/2279018/ssr">SSR</a>'s <a href="https://stackoverflow.com/posts/20586992/revisions">edit</a>)</li> <li><p>register your new account (as described in "<a href="http://martyha... | 119, 8279, 85786 | git, heroku, ruby-on-rails-4 | <h1>Heroku: Your account example@email.com does not have access to <app-name></h1>
<p>I am having trouble pushing code to Heroku. I have an account but I've forgotten the password. I created a new account and tried to push with it but now it shows me this error:</p>
<pre><code>Your account someoneelse@gmail.com does no... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,477 | git | # Heroku: Your account example@email.com does not have access to
I am having trouble pushing code to Heroku. I have an account but I've forgotten the password. I created a new account and tried to push with it but now it shows me this error:
```
Your account someoneelse@gmail.com does not have access to
! SSH Key Fin... | You need to:
- clean any extra ssh key in your Heroku app that you don't have locally (See [SSR](https://stackoverflow.com/users/2279018/ssr)'s [edit](https://stackoverflow.com/posts/20586992/revisions))
- register your new account (as described in "[Managing Multiple Heroku Accounts](http://martyhaught.com/articles/2... |
12138207 | Is the Git staging area just an index? | 29 | 2012-08-27 07:59:43 | <p>The book Pro Git says that the staging area is just a list, or index, that says which files will be committed when a <code>git commit</code> is done, and now the name <code>index</code> is more commonly known as the "staging area".</p>
<p>But if we modify the file <code>foo.txt</code> that is already part of the re... | 12,862 | 325,418 | 2023-09-05 05:59:13 | 12,138,284 | 26 | 2012-08-27 08:05:53 | 526,535 | 2017-10-03 15:41:25 | https://stackoverflow.com/q/12138207 | https://stackoverflow.com/a/12138284 | <p>Index is a view of your working directory that is ready for commit. It can be seen as a pre-commit state and is not as simple as a "list of files". When you do <code>git add</code>, the file (with the change) is added to the index and the newer changes will not be see until you add them too.</p>
| <p>Index is a view of your working directory that is ready for commit. It can be seen as a pre-commit state and is not as simple as a "list of files". When you do <code>git add</code>, the file (with the change) is added to the index and the newer changes will not be see until you add them too.</p> | 119, 68400 | git, git-index | <h1>Is the Git staging area just an index?</h1>
<p>The book Pro Git says that the staging area is just a list, or index, that says which files will be committed when a <code>git commit</code> is done, and now the name <code>index</code> is more commonly known as the "staging area".</p>
<p>But if we modify the file <co... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,479 | git | # Is the Git staging area just an index?
The book Pro Git says that the staging area is just a list, or index, that says which files will be committed when a `git commit` is done, and now the name `index` is more commonly known as the "staging area".
But if we modify the file `foo.txt` that is already part of the rep... | Index is a view of your working directory that is ready for commit. It can be seen as a pre-commit state and is not as simple as a "list of files". When you do `git add`, the file (with the change) is added to the index and the newer changes will not be see until you add them too. |
43183495 | How to dynamically pick a git branch to use in Jenkins build | 27 | 2017-04-03 11:30:01 | <p>I'm trying to create a new project configuration for Jenkins build server. To simplify what I'm trying to do, I will use only two components to describe the problem.</p>
<p>ComponentA</p>
<ul>
<li>Change in this component triggers the build of this project on CI server. </li>
<li>CI server has statically configure... | 60,290 | 413,501 | 2017-04-24 20:35:49 | 43,518,421 | 26 | 2017-04-20 11:34:57 | 2,788,297 | 2017-04-24 20:35:49 | https://stackoverflow.com/q/43183495 | https://stackoverflow.com/a/43518421 | <p>One option to achieve what you want is to use the following setup:</p>
<p>Create two Jenkins jobs:</p>
<ul>
<li>"Component A" (automatically triggered on SCM changes)</li>
<li>"Component B" ("manually" triggered)</li>
</ul>
<h2>Step #1</h2>
<p>Define the <code>branch</code> <a href="htt... | <p>One option to achieve what you want is to use the following setup:</p> <p>Create two Jenkins jobs:</p> <ul> <li>"Component A" (automatically triggered on SCM changes)</li> <li>"Component B" ("manually" triggered)</li> </ul> <h2>Step #1</h2> <p>Define the <code>branch</code> <a href="htt... | 119, 1066, 5647, 64999 | build, continuous-integration, git, jenkins | <h1>How to dynamically pick a git branch to use in Jenkins build</h1>
<p>I'm trying to create a new project configuration for Jenkins build server. To simplify what I'm trying to do, I will use only two components to describe the problem.</p>
<p>ComponentA</p>
<ul>
<li>Change in this component triggers the build of t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,480 | git | # How to dynamically pick a git branch to use in Jenkins build
I'm trying to create a new project configuration for Jenkins build server. To simplify what I'm trying to do, I will use only two components to describe the problem.
ComponentA
- Change in this component triggers the build of this project on CI server.
-... | One option to achieve what you want is to use the following setup:
Create two Jenkins jobs:
- "Component A" (automatically triggered on SCM changes)
- "Component B" ("manually" triggered)
## Step #1
Define the `branch` [build parameter](https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build) for "Component... |
13692429 | Cannot Pull b/c "You have unstaged changes", but status says there are no changes | 27 | 2012-12-03 21:53:36 | <p>I'm working with a developer here who is seeing a weird issue that I've never encountered before. He's working on a repository and needs to pull the latest changes from someone else before he can push. All of his changes are committed.</p>
<pre><code>$ git pull
Cannot pull with rebase: You have unstaged changes.
Pl... | 40,735 | 1,665 | 2021-07-06 08:46:40 | 13,694,625 | 26 | 2012-12-04 01:16:37 | 337,297 | 2012-12-04 18:14:00 | https://stackoverflow.com/q/13692429 | https://stackoverflow.com/a/13694625 | <p>Instead of</p>
<pre><code>git pull
</code></pre>
<p>try</p>
<pre><code>git fetch
git rebase -p origin/master
</code></pre>
<p>If that doesn't work you can try</p>
<pre><code>git pull --no-rebase
</code></pre>
<p><strong><em>How to check why this message occurs</em></strong></p>
<p>Make sure you on a branch, n... | <p>Instead of</p> <pre><code>git pull </code></pre> <p>try</p> <pre><code>git fetch git rebase -p origin/master </code></pre> <p>If that doesn't work you can try</p> <pre><code>git pull --no-rebase </code></pre> <p><strong><em>How to check why this message occurs</em></strong></p> <p>Make sure you on a branch, n... | 119 | git | <h1>Cannot Pull b/c "You have unstaged changes", but status says there are no changes</h1>
<p>I'm working with a developer here who is seeing a weird issue that I've never encountered before. He's working on a repository and needs to pull the latest changes from someone else before he can push. All of his changes are c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,481 | git | # Cannot Pull b/c "You have unstaged changes", but status says there are no changes
I'm working with a developer here who is seeing a weird issue that I've never encountered before. He's working on a repository and needs to pull the latest changes from someone else before he can push. All of his changes are committed.... | Instead of
```
git pull
```
try
```
git fetch
git rebase -p origin/master
```
If that doesn't work you can try
```
git pull --no-rebase
```
***How to check why this message occurs***
Make sure you on a branch, not a detached head. Rebasing doesn't work on a detached head.
Run the following commands, the result ... |
5518349 | Using Git to track mysql schema - some questions | 27 | 2011-04-01 20:14:01 | <p>If this is recommended ? </p>
<p>Can I ask some git command examples about how to track versions of mysql schema?</p>
<p>Should we use another repository other then the one we normally use on our application root ?</p>
<p>Should I use something called hook ? </p>
<p><strong>Update:</strong></p>
<p><strong>1)</s... | 20,492 | 378,170 | 2018-01-14 14:44:30 | 5,518,976 | 26 | 2011-04-01 21:18:10 | 25,844 | 2011-04-01 22:20:23 | https://stackoverflow.com/q/5518349 | https://stackoverflow.com/a/5518976 | <p>Assuming you have a git repo already, do the following in a shell script or whatever:</p>
<pre><code>#!/bin/bash -e
# -e means exit if any command fails
DBHOST=dbhost.yourdomain.com
DBUSER=dbuser
DBPASS=dbpass # do this in a more secure fashion
DBNAME=dbname
GITREPO=/path/to/git/repo
cd $GITREPO
mysqldump -h $DBHOS... | <p>Assuming you have a git repo already, do the following in a shell script or whatever:</p> <pre><code>#!/bin/bash -e # -e means exit if any command fails DBHOST=dbhost.yourdomain.com DBUSER=dbuser DBPASS=dbpass # do this in a more secure fashion DBNAME=dbname GITREPO=/path/to/git/repo cd $GITREPO mysqldump -h $DBHOS... | 21, 119 | git, mysql | <h1>Using Git to track mysql schema - some questions</h1>
<p>If this is recommended ? </p>
<p>Can I ask some git command examples about how to track versions of mysql schema?</p>
<p>Should we use another repository other then the one we normally use on our application root ?</p>
<p>Should I use something called hook... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,482 | git | # Using Git to track mysql schema - some questions
If this is recommended ?
Can I ask some git command examples about how to track versions of mysql schema?
Should we use another repository other then the one we normally use on our application root ?
Should I use something called hook ?
**Update:**
**1)** We navi... | Assuming you have a git repo already, do the following in a shell script or whatever:
```
#!/bin/bash -e
# -e means exit if any command fails
DBHOST=dbhost.yourdomain.com
DBUSER=dbuser
DBPASS=dbpass # do this in a more secure fashion
DBNAME=dbname
GITREPO=/path/to/git/repo
cd $GITREPO
mysqldump -h $DBHOST -u $DBUSER -... |
32742865 | No console colors if using npm script inside a Git bash (mintty) | 26 | 2015-09-23 14:53:01 | <h2>Introduction</h2>
<p>Using <a href="https://github.com/sindresorhus/chalk"><strong>chalk</strong></a> I have written a small console program for printing colored text, which I execute with <a href="http://nodejs.org"><strong>NodeJS</strong></a>:</p>
<pre class="lang-js prettyprint-override"><code>console.log(requ... | 11,041 | 664,033 | 2020-08-21 21:18:14 | 42,111,672 | 26 | 2017-02-08 11:18:35 | 878,329 | 2017-02-08 11:18:35 | https://stackoverflow.com/q/32742865 | https://stackoverflow.com/a/42111672 | <p>The current work around seems to be (on windows) to set an environment variable:</p>
<p><code>FORCE_COLOR=true</code></p>
<p>src: <a href="https://github.com/gulpjs/gulp/issues/1292#issuecomment-258090062" rel="noreferrer">Color support detection problem in git bash on windows</a></p>
| <p>The current work around seems to be (on windows) to set an environment variable:</p> <p><code>FORCE_COLOR=true</code></p> <p>src: <a href="https://github.com/gulpjs/gulp/issues/1292#issuecomment-258090062" rel="noreferrer">Color support detection problem in git bash on windows</a></p> | 64, 119, 46426, 61387, 70136 | git, mintty, node.js, npm, windows | <h1>No console colors if using npm script inside a Git bash (mintty)</h1>
<h2>Introduction</h2>
<p>Using <a href="https://github.com/sindresorhus/chalk"><strong>chalk</strong></a> I have written a small console program for printing colored text, which I execute with <a href="http://nodejs.org"><strong>NodeJS</strong><... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,483 | git | # No console colors if using npm script inside a Git bash (mintty)
## Introduction
Using [**chalk**](https://github.com/sindresorhus/chalk) I have written a small console program for printing colored text, which I execute with [**NodeJS**](http://nodejs.org):
```
console.log(require('chalk').yellow('yellow text'));
... | The current work around seems to be (on windows) to set an environment variable:
`FORCE_COLOR=true`
src: [Color support detection problem in git bash on windows](https://github.com/gulpjs/gulp/issues/1292#issuecomment-258090062) |
62905914 | Turning a git branch name into a valid docker image tag | 25 | 2020-07-15 00:38:22 | <p>Part of our CI/CD workflow tags Docker images with the git branch's name. However, the set of valid characters for docker tags is smaller than the set of valid characters for a git branch name.</p>
<p>As a very simple example, the branch name <code>bugfix/my_awesome_feature</code> is not a valid tag:</p>
<pre><code>... | 16,097 | 256,798 | 2020-12-16 08:20:15 | 62,906,041 | 26 | 2020-07-15 00:57:19 | 3,288,890 | 2020-12-16 08:20:15 | https://stackoverflow.com/q/62905914 | https://stackoverflow.com/a/62906041 | <p>Docker tag does not allow most of the special character except <code>-,_,.</code>.</p>
<blockquote>
<p>A tag name must be valid ASCII and may contain lowercase and uppercase
letters, digits, underscores, periods and dashes. A tag name may not
start with a period or a dash and may contain a maximum of 128
characters.... | <p>Docker tag does not allow most of the special character except <code>-,_,.</code>.</p> <blockquote> <p>A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods and dashes. A tag name may not start with a period or a dash and may contain a maximum of 128 characters.... | 119, 90304 | docker, git | <h1>Turning a git branch name into a valid docker image tag</h1>
<p>Part of our CI/CD workflow tags Docker images with the git branch's name. However, the set of valid characters for docker tags is smaller than the set of valid characters for a git branch name.</p>
<p>As a very simple example, the branch name <code>bug... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,485 | git | # Turning a git branch name into a valid docker image tag
Part of our CI/CD workflow tags Docker images with the git branch's name. However, the set of valid characters for docker tags is smaller than the set of valid characters for a git branch name.
As a very simple example, the branch name `bugfix/my_awesome_featu... | Docker tag does not allow most of the special character except `-,_,.`.
> A tag name must be valid ASCII and may contain lowercase and uppercase
> letters, digits, underscores, periods and dashes. A tag name may not
> start with a period or a dash and may contain a maximum of 128
> characters.
[docker valid image tag... |
38627184 | Pycharm to show current working branch name | 25 | 2016-07-28 04:37:04 | <p>When viewing VCS window in Pycharm IDE, I have no idea what <em>git local branch</em> I'm working on as well as its mapped <em>git remote branch</em>.</p>
<p>So how to show <strong>current working branch name</strong> in Pycharm?</p>
<p>p.s.</p>
<p>I'm using PyCharm Community Edition 2016.2</p>
| 15,380 | 248,616 | 2022-01-20 08:40:50 | 38,628,749 | 26 | 2016-07-28 06:36:17 | 6,309 | 2016-07-28 06:56:15 | https://stackoverflow.com/q/38627184 | https://stackoverflow.com/a/38628749 | <h1>Local Working Branch</h1>
<p>The section "<a href="https://confluence.jetbrains.com/display/PYH/Using+PyCharm%27s+Git+integration+locally#UsingPyCharm%27sGitintegrationlocally-Whichbranchweareworkingin?" rel="noreferrer">Which branch we are working in?</a>" is quite clear:</p>
<blockquote>
<p>Actually, th... | <h1>Local Working Branch</h1> <p>The section "<a href="https://confluence.jetbrains.com/display/PYH/Using+PyCharm%27s+Git+integration+locally#UsingPyCharm%27sGitintegrationlocally-Whichbranchweareworkingin?" rel="noreferrer">Which branch we are working in?</a>" is quite clear:</p> <blockquote> <p>Actually, th... | 119, 51298 | git, pycharm | <h1>Pycharm to show current working branch name</h1>
<p>When viewing VCS window in Pycharm IDE, I have no idea what <em>git local branch</em> I'm working on as well as its mapped <em>git remote branch</em>.</p>
<p>So how to show <strong>current working branch name</strong> in Pycharm?</p>
<p>p.s.</p>
<p>I'm using Py... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,486 | git | # Pycharm to show current working branch name
When viewing VCS window in Pycharm IDE, I have no idea what *git local branch* I'm working on as well as its mapped *git remote branch*.
So how to show **current working branch name** in Pycharm?
p.s.
I'm using PyCharm Community Edition 2016.2 | # Local Working Branch
The section "[Which branch we are working in?](https://confluence.jetbrains.com/display/PYH/Using+PyCharm%27s+Git+integration+locally#UsingPyCharm%27sGitintegrationlocally-Whichbranchweareworkingin?)" is quite clear:
> Actually, this information is available in the Logs tab, but there are two a... |
50391577 | Can I move pushed commits from one branch to another existing branch? | 24 | 2018-05-17 12:32:18 | <p>I have 3 branches: <code>develop</code>, <code>feature-1</code> and <code>feature-2</code>. I was working on <code>feature-1</code>, then switched to work on <code>feature-2</code>. I then finished work on <code>feature-2</code>, committed and pushed to the repo, then created a merge request for that feature. I then... | 26,527 | 519,497 | 2018-05-17 13:37:25 | 50,391,650 | 26 | 2018-05-17 12:36:08 | 4,487,833 | 2018-05-17 12:45:15 | https://stackoverflow.com/q/50391577 | https://stackoverflow.com/a/50391650 | <p><code>git cherry-pick <commit-id></code> is your friend dear.</p>
<ol>
<li>Go on feature-2 branch</li>
<li>Copy <code>commit-id(s)</code> you want to move from <code>feature-2</code> to <code>feature-1</code></li>
<li>Switch to feature-1 branch</li>
<li><p>Now cherry pick all the commits you have copied in st... | <p><code>git cherry-pick <commit-id></code> is your friend dear.</p> <ol> <li>Go on feature-2 branch</li> <li>Copy <code>commit-id(s)</code> you want to move from <code>feature-2</code> to <code>feature-1</code></li> <li>Switch to feature-1 branch</li> <li><p>Now cherry pick all the commits you have copied in st... | 119, 76220 | git, git-branch | <h1>Can I move pushed commits from one branch to another existing branch?</h1>
<p>I have 3 branches: <code>develop</code>, <code>feature-1</code> and <code>feature-2</code>. I was working on <code>feature-1</code>, then switched to work on <code>feature-2</code>. I then finished work on <code>feature-2</code>, committe... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,488 | git | # Can I move pushed commits from one branch to another existing branch?
I have 3 branches: `develop`, `feature-1` and `feature-2`. I was working on `feature-1`, then switched to work on `feature-2`. I then finished work on `feature-2`, committed and pushed to the repo, then created a merge request for that feature. I ... | `git cherry-pick <commit-id>` is your friend dear.
1. Go on feature-2 branch
2. Copy `commit-id(s)` you want to move from `feature-2` to `feature-1`
3. Switch to feature-1 branch
4. Now cherry pick all the commits you have copied in step-2 above.
`git cherry-pick <commit-id>`
In case you have more than one com... |
26971727 | How can I squash commits without tracking a remote branch? | 24 | 2014-11-17 11:29:47 | <p>I have a brand new git repo. It has three commits. </p>
<p>I'd like to squash them together so my project history looks clean, and others don't see my hacky commits.</p>
<p>Obviously nobody else has seen the repo, as it's brand new, so changing history is not a problem. I am the only user.</p>
<p>However <code>gi... | 4,186 | 123,671 | 2014-11-17 11:42:22 | 26,971,936 | 26 | 2014-11-17 11:42:22 | 1,640,038 | 2014-11-17 11:42:22 | https://stackoverflow.com/q/26971727 | https://stackoverflow.com/a/26971936 | <p>You can skip tracking a remote branch by specifying the last <code>n</code> commits you want to squash.</p>
<p>For eg. if you have 4 commits in your branch and you want to squash the last 3 commits effectively making a single commit, you can do <code>git rebase -i HEAD~4</code>. You can then either fixup or squash ... | <p>You can skip tracking a remote branch by specifying the last <code>n</code> commits you want to squash.</p> <p>For eg. if you have 4 commits in your branch and you want to squash the last 3 commits effectively making a single commit, you can do <code>git rebase -i HEAD~4</code>. You can then either fixup or squash ... | 119, 84381 | git, git-interactive-rebase | <h1>How can I squash commits without tracking a remote branch?</h1>
<p>I have a brand new git repo. It has three commits. </p>
<p>I'd like to squash them together so my project history looks clean, and others don't see my hacky commits.</p>
<p>Obviously nobody else has seen the repo, as it's brand new, so changing hi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,490 | git | # How can I squash commits without tracking a remote branch?
I have a brand new git repo. It has three commits.
I'd like to squash them together so my project history looks clean, and others don't see my hacky commits.
Obviously nobody else has seen the repo, as it's brand new, so changing history is not a problem. ... | You can skip tracking a remote branch by specifying the last `n` commits you want to squash.
For eg. if you have 4 commits in your branch and you want to squash the last 3 commits effectively making a single commit, you can do `git rebase -i HEAD~4`. You can then either fixup or squash the commits as you wish. |
13719676 | Gradle: how to clone a git repo in a task? | 24 | 2012-12-05 09:13:38 | <p>Suppose I have a gradle build script and want to write a task to clone a remote git repository. How do I do that?</p>
| 34,849 | 1,466,535 | 2014-06-13 00:19:44 | 13,720,769 | 26 | 2012-12-05 10:12:58 | 1,466,535 | 2012-12-06 09:40:15 | https://stackoverflow.com/q/13719676 | https://stackoverflow.com/a/13720769 | <p>The cloning can be done using the <a href="https://github.com/ajoberstar/gradle-git">Gradle-git plugin</a>. To use the plugin you should download it first:</p>
<pre><code>buildscript {
repositories { mavenCentral() }
dependencies { classpath 'org.ajoberstar:gradle-git:0.2.3' }
}
</code></pre>
<p>Then write a t... | <p>The cloning can be done using the <a href="https://github.com/ajoberstar/gradle-git">Gradle-git plugin</a>. To use the plugin you should download it first:</p> <pre><code>buildscript { repositories { mavenCentral() } dependencies { classpath 'org.ajoberstar:gradle-git:0.2.3' } } </code></pre> <p>Then write a t... | 119, 32307 | git, gradle | <h1>Gradle: how to clone a git repo in a task?</h1>
<p>Suppose I have a gradle build script and want to write a task to clone a remote git repository. How do I do that?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,491 | git | # Gradle: how to clone a git repo in a task?
Suppose I have a gradle build script and want to write a task to clone a remote git repository. How do I do that? | The cloning can be done using the [Gradle-git plugin](https://github.com/ajoberstar/gradle-git). To use the plugin you should download it first:
```
buildscript {
repositories { mavenCentral() }
dependencies { classpath 'org.ajoberstar:gradle-git:0.2.3' }
}
```
Then write a task like this one:
```
import org.ajo... |
9416926 | Are the character digits ['0'..'9'] required to have contiguous numeric values? | 24 | 2012-02-23 16:20:51 | <p>Must a C++ implementation set the chars '0'-'9' to have contiguous numeric values, i.e. so that:</p>
<pre><code>'0' -> 0+n
'1' -> 1+n
m -> m+n
'9' -> 9+n
</code></pre>
<p>I cannot find it mentioned in the documentation of <code>isdigit</code> ([classification] (22.3.3.1 Character classification)) <su... | 1,556 | 76,722 | 2012-02-24 09:53:40 | 9,416,946 | 26 | 2012-02-23 16:22:00 | 76,722 | 2012-02-24 06:44:06 | https://stackoverflow.com/q/9416926 | https://stackoverflow.com/a/9416946 | <p>Indeed not looked hard enough: In 2.3. Character sets, item 3:</p>
<blockquote>
<p>In both the source and execution basic character sets, <em>the value of each character after 0 in the
above <strong>list of decimal digits</strong> shall be <strong>one greater than</strong> the value of <strong>the previous</str... | <p>Indeed not looked hard enough: In 2.3. Character sets, item 3:</p> <blockquote> <p>In both the source and execution basic character sets, <em>the value of each character after 0 in the above <strong>list of decimal digits</strong> shall be <strong>one greater than</strong> the value of <strong>the previous</str... | 10, 1843, 1906, 3496, 9914 | ascii, c++, digits, numbers, numerical | <h1>Are the character digits ['0'..'9'] required to have contiguous numeric values?</h1>
<p>Must a C++ implementation set the chars '0'-'9' to have contiguous numeric values, i.e. so that:</p>
<pre><code>'0' -> 0+n
'1' -> 1+n
m -> m+n
'9' -> 9+n
</code></pre>
<p>I cannot find it mentioned in the documen... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,492 | git | # Are the character digits ['0'..'9'] required to have contiguous numeric values?
Must a C++ implementation set the chars '0'-'9' to have contiguous numeric values, i.e. so that:
```
'0' -> 0+n
'1' -> 1+n
m -> m+n
'9' -> 9+n
```
I cannot find it mentioned in the documentation of `isdigit` ([classification] (22.3.3... | Indeed not looked hard enough: In 2.3. Character sets, item 3:
> In both the source and execution basic character sets, *the value of each character after 0 in the
> above **list of decimal digits** shall be **one greater than** the value of **the previous**.*
And this is above list of decimal digits:
```
0 1 2 3 4 ... |
4169017 | Why does `git remote` not list anything on my git-svn repo? | 24 | 2010-11-12 21:03:21 | <p>After doing <code>git svn init -s <url to repo></code>, <code>git remote</code> doesn't list any remotes. Why?</p>
| 3,360 | 168,143 | 2014-08-25 16:24:20 | 4,169,308 | 26 | 2010-11-12 21:43:35 | 4,596 | 2010-11-12 21:43:35 | https://stackoverflow.com/q/4169017 | https://stackoverflow.com/a/4169308 | <p>Because a subversion "remote" is not a real git remote. Try <code>git svn info</code> to see the remote information for the subversion repository.</p>
| <p>Because a subversion "remote" is not a real git remote. Try <code>git svn info</code> to see the remote information for the subversion repository.</p> | 63, 119, 6452 | git, git-svn, svn | <h1>Why does `git remote` not list anything on my git-svn repo?</h1>
<p>After doing <code>git svn init -s <url to repo></code>, <code>git remote</code> doesn't list any remotes. Why?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,493 | git | # Why does `git remote` not list anything on my git-svn repo?
After doing `git svn init -s <url to repo>`, `git remote` doesn't list any remotes. Why? | Because a subversion "remote" is not a real git remote. Try `git svn info` to see the remote information for the subversion repository. |
55929417 | How to securely git clone/pip install a private repository into my docker image? | 23 | 2019-04-30 22:24:10 | <p>I have a private repo that contains packages I want to pip install. I've spent quite a bit of time reading over various forums and articles about different ways to securely do this. There doesn't seem to be a a consensus on how to best do this (if at all possible). I obviously don't want to expose any ssh keys/secre... | 35,449 | 11,234,774 | 2024-01-27 03:34:51 | 55,931,932 | 26 | 2019-05-01 05:21:17 | 6,309 | 2019-05-07 22:03:59 | https://stackoverflow.com/q/55929417 | https://stackoverflow.com/a/55931932 | <p>As explained in "<a href="https://medium.com/@amimahloof/securely-build-small-python-docker-image-from-private-git-repos-c3e6d5da4626" rel="noreferrer">Securely build small python docker image from private git repos</a>", you would need to use, with Docker 18.09+</p>
<blockquote>
<ul>
<li><p><strong><code>--ssh... | <p>As explained in "<a href="https://medium.com/@amimahloof/securely-build-small-python-docker-image-from-private-git-repos-c3e6d5da4626" rel="noreferrer">Securely build small python docker image from private git repos</a>", you would need to use, with Docker 18.09+</p> <blockquote> <ul> <li><p><strong><code>--ssh... | 119, 25308, 115133 | docker-image, git, ssh-keys | <h1>How to securely git clone/pip install a private repository into my docker image?</h1>
<p>I have a private repo that contains packages I want to pip install. I've spent quite a bit of time reading over various forums and articles about different ways to securely do this. There doesn't seem to be a a consensus on how... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,494 | git | # How to securely git clone/pip install a private repository into my docker image?
I have a private repo that contains packages I want to pip install. I've spent quite a bit of time reading over various forums and articles about different ways to securely do this. There doesn't seem to be a a consensus on how to best ... | As explained in "[Securely build small python docker image from private git repos](https://medium.com/@amimahloof/securely-build-small-python-docker-image-from-private-git-repos-c3e6d5da4626)", you would need to use, with Docker 18.09+
> - **`--ssh`**
> You can use the `--ssh` flag to forward your existing SSH age... |
42489421 | How to push a "git replace --graft" | 23 | 2017-02-27 15:23:33 | <p>I've used <code>git replace --graft</code> to record that a version was actually a (manually performed) merge between two versions:</p>
<pre><code> git replace --graft <merged-version> <predecessor-version> <version-merged-from>
</code></pre>
<p>That made a change to my (local, private) repositor... | 6,563 | 545,127 | 2023-03-10 16:56:51 | 42,494,208 | 26 | 2017-02-27 19:31:34 | 1,256,452 | 2017-06-19 15:00:30 | https://stackoverflow.com/q/42489421 | https://stackoverflow.com/a/42494208 | <p>Grafts exist inside the <code>refs/replace/</code> hierarchy. (Or, it might be better to say, "owe their existence to" such references.) To transfer them from one repository to another, then, you must push or fetch such references.</p>
<p>For instance:</p>
<pre><code>git push origin refs/replace/5c714d7798d1dc9c... | <p>Grafts exist inside the <code>refs/replace/</code> hierarchy. (Or, it might be better to say, "owe their existence to" such references.) To transfer them from one repository to another, then, you must push or fetch such references.</p> <p>For instance:</p> <pre><code>git push origin refs/replace/5c714d7798d1dc9c... | 119, 28898 | git, git-push | <h1>How to push a "git replace --graft"</h1>
<p>I've used <code>git replace --graft</code> to record that a version was actually a (manually performed) merge between two versions:</p>
<pre><code> git replace --graft <merged-version> <predecessor-version> <version-merged-from>
</code></pre>
<p>That m... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,495 | git | # How to push a "git replace --graft"
I've used `git replace --graft` to record that a version was actually a (manually performed) merge between two versions:
```
git replace --graft <merged-version> <predecessor-version> <version-merged-from>
```
That made a change to my (local, private) repository.
I now want to... | Grafts exist inside the `refs/replace/` hierarchy. (Or, it might be better to say, "owe their existence to" such references.) To transfer them from one repository to another, then, you must push or fetch such references.
For instance:
```
git push origin refs/replace/5c714d7798d1dc9c18d194fa6448680515c0ccdb
```
when... |
30088693 | What happens to orphaned commits? | 22 | 2015-05-06 22:20:38 | <p>I have a repo with four commits:</p>
<pre><code>$ git log --oneline --decorate
6c35831 (HEAD, master) C4
974073b C3
e27b22c C2
9f2d694 C1
</code></pre>
<p>I <code>reset -- soft</code> to the <code>C2</code> commit and now I have a repo like so:</p>
<pre><code>$ git reset e27b22c --soft
$ git log --oneline --deco... | 7,687 | 442,351 | 2023-04-25 10:30:11 | 30,105,190 | 26 | 2015-05-07 15:15:14 | 649,852 | 2015-05-07 15:15:14 | https://stackoverflow.com/q/30088693 | https://stackoverflow.com/a/30105190 | <p>Short answer: Commits <code>C3</code> and <code>C4</code> will remain in the Git object database until they are garbage collected.</p>
<p>Long answer: Garbage collection will occur automatically by different Git porcelain commands or when explicitly garbage collected. There are many scenarios that could trigger an... | <p>Short answer: Commits <code>C3</code> and <code>C4</code> will remain in the Git object database until they are garbage collected.</p> <p>Long answer: Garbage collection will occur automatically by different Git porcelain commands or when explicitly garbage collected. There are many scenarios that could trigger an... | 119, 51381, 53850 | git, git-commit, git-reset | <h1>What happens to orphaned commits?</h1>
<p>I have a repo with four commits:</p>
<pre><code>$ git log --oneline --decorate
6c35831 (HEAD, master) C4
974073b C3
e27b22c C2
9f2d694 C1
</code></pre>
<p>I <code>reset -- soft</code> to the <code>C2</code> commit and now I have a repo like so:</p>
<pre><code>$ git reset... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,498 | git | # What happens to orphaned commits?
I have a repo with four commits:
```
$ git log --oneline --decorate
6c35831 (HEAD, master) C4
974073b C3
e27b22c C2
9f2d694 C1
```
I `reset -- soft` to the `C2` commit and now I have a repo like so:
```
$ git reset e27b22c --soft
$ git log --oneline --decorate
e27b22c (HEAD, mas... | Short answer: Commits `C3` and `C4` will remain in the Git object database until they are garbage collected.
Long answer: Garbage collection will occur automatically by different Git porcelain commands or when explicitly garbage collected. There are many scenarios that could trigger an automatic garbage collection; ta... |
16957454 | Why doesn't "git status" display unpushed commits in a branch? | 22 | 2013-06-06 08:40:48 | <p>Everything is in the title...</p>
<p>I read this question: <a href="https://stackoverflow.com/questions/2016901/viewing-unpushed-git-commits">Viewing Unpushed Git Commits</a></p>
<p>But I don't understand why <code>git status</code> displays all unpushed commits in the master branch, but does not display anything ... | 5,743 | 1,856,816 | 2015-08-13 18:22:35 | 16,957,508 | 26 | 2013-06-06 08:44:02 | 2,038 | 2013-06-07 09:42:45 | https://stackoverflow.com/q/16957454 | https://stackoverflow.com/a/16957508 | <p>The reason is that your master branch actually has a remote branch, on origin/master that your branch has been set up to track.</p>
<p>What this means is that each time you do a commit to master, and then do a <code>git status</code> git will tell you which commits are different between your local branch and the re... | <p>The reason is that your master branch actually has a remote branch, on origin/master that your branch has been set up to track.</p> <p>What this means is that each time you do a commit to master, and then do a <code>git status</code> git will tell you which commits are different between your local branch and the re... | 119, 54839 | git, git-status | <h1>Why doesn't "git status" display unpushed commits in a branch?</h1>
<p>Everything is in the title...</p>
<p>I read this question: <a href="https://stackoverflow.com/questions/2016901/viewing-unpushed-git-commits">Viewing Unpushed Git Commits</a></p>
<p>But I don't understand why <code>git status</code> displays a... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,500 | git | # Why doesn't "git status" display unpushed commits in a branch?
Everything is in the title...
I read this question: [Viewing Unpushed Git Commits](https://stackoverflow.com/questions/2016901/viewing-unpushed-git-commits)
But I don't understand why `git status` displays all unpushed commits in the master branch, but... | The reason is that your master branch actually has a remote branch, on origin/master that your branch has been set up to track.
What this means is that each time you do a commit to master, and then do a `git status` git will tell you which commits are different between your local branch and the remote branch.
When yo... |
8488365 | Git compare "base" version with "theirs" version of a conflicted file? | 21 | 2011-12-13 11:25:43 | <p>Given a conflicted file <code>foo.txt</code>, how to tell <code>git diff</code> to show changes between the base version of the file and "their" version of the file?</p>
<p>I can see each of the versions via <code>git show :1:foo.txt</code> or <code>git show:3:foo.txt</code> - is there a simple way to compare the t... | 7,569 | 12,166 | 2023-08-26 07:07:27 | 15,107,363 | 26 | 2013-02-27 08:30:57 | 1,875,092 | 2023-08-26 07:07:27 | https://stackoverflow.com/q/8488365 | https://stackoverflow.com/a/15107363 | <pre><code>git diff :1:foo.txt :3:foo.txt
</code></pre>
<p>More info at <a href="https://gitirc.eu/gitrevisions.html" rel="nofollow noreferrer">man gitrevisions</a>; look for <code>:[<n>:]<path></code>.</p>
| <pre><code>git diff :1:foo.txt :3:foo.txt </code></pre> <p>More info at <a href="https://gitirc.eu/gitrevisions.html" rel="nofollow noreferrer">man gitrevisions</a>; look for <code>:[<n>:]<path></code>.</p> | 119, 62599 | git, merge-conflict-resolution | <h1>Git compare "base" version with "theirs" version of a conflicted file?</h1>
<p>Given a conflicted file <code>foo.txt</code>, how to tell <code>git diff</code> to show changes between the base version of the file and "their" version of the file?</p>
<p>I can see each of the versions via <code>git show :1:foo.txt</c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,501 | git | # Git compare "base" version with "theirs" version of a conflicted file?
Given a conflicted file `foo.txt`, how to tell `git diff` to show changes between the base version of the file and "their" version of the file?
I can see each of the versions via `git show :1:foo.txt` or `git show:3:foo.txt` - is there a simple ... | ```
git diff :1:foo.txt :3:foo.txt
```
More info at [man gitrevisions](https://gitirc.eu/gitrevisions.html); look for `:[<n>:]<path>`. |
12734760 | jGit - how to add all files to staging area | 21 | 2012-10-04 19:47:10 | <p>I tried in a lot of ways to clone a repo with jGit (it works).
Then, I write some archive in the repository, and tried to add all (a <code>git add *</code>, <code>git add -A</code> or something like it).. but it don't work. The files simple are not added to the staging area.</p>
<p>My code is like this:</p>
<pre><... | 19,486 | 405,013 | 2022-05-30 05:48:32 | 12,735,412 | 26 | 2012-10-04 20:32:06 | 6,309 | 2015-07-02 17:15:58 | https://stackoverflow.com/q/12734760 | https://stackoverflow.com/a/12735412 | <p>One easy way to debug this is to look at the tests of the <a href="https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java" rel="noreferrer">AddCommand</a> in the <a href="https://github.com/eclipse/jgit" rel="noreferrer">JGit repo</a>: <a href="https://github.com/eclips... | <p>One easy way to debug this is to look at the tests of the <a href="https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java" rel="noreferrer">AddCommand</a> in the <a href="https://github.com/eclipse/jgit" rel="noreferrer">JGit repo</a>: <a href="https://github.com/eclips... | 17, 119, 61058 | git, java, jgit | <h1>jGit - how to add all files to staging area</h1>
<p>I tried in a lot of ways to clone a repo with jGit (it works).
Then, I write some archive in the repository, and tried to add all (a <code>git add *</code>, <code>git add -A</code> or something like it).. but it don't work. The files simple are not added to the st... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,503 | git | # jGit - how to add all files to staging area
I tried in a lot of ways to clone a repo with jGit (it works).
Then, I write some archive in the repository, and tried to add all (a `git add *`, `git add -A` or something like it).. but it don't work. The files simple are not added to the staging area.
My code is like th... | One easy way to debug this is to look at the tests of the [AddCommand](https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java) in the [JGit repo](https://github.com/eclipse/jgit): [`AddCommandTest.java`](https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit.test/tst... |
6482436 | List of authors in git since a given commit | 21 | 2011-06-26 06:07:12 | <p>I want a way to list all git authors that</p>
<ol>
<li>Is only since a given commit.</li>
<li>Is unique.</li>
</ol>
<p>These two are easy, and I've seen some solutions to this online, most using <code>git log --format</code>. But none that I saw fits the additional requirements:</p>
<ol>
<li>Is ordered by commit... | 8,343 | 161,801 | 2023-11-28 15:27:48 | 6,482,473 | 26 | 2011-06-26 06:19:13 | 402,715 | 2011-06-26 06:19:13 | https://stackoverflow.com/q/6482436 | https://stackoverflow.com/a/6482473 | <p>The following format specifiers will solve your second concern:</p>
<p>%aN: author name (respecting .mailmap)<br>
%aE: author email (respecting .mailmap)<br>
%cN: committer name (respecting .mailmap)<br>
%cE: committer email (respecting .mailmap)</p>
<p>So discounting the duplicate author part, you want something ... | <p>The following format specifiers will solve your second concern:</p> <p>%aN: author name (respecting .mailmap)<br> %aE: author email (respecting .mailmap)<br> %cN: committer name (respecting .mailmap)<br> %cE: committer email (respecting .mailmap)</p> <p>So discounting the duplicate author part, you want something ... | 119 | git | <h1>List of authors in git since a given commit</h1>
<p>I want a way to list all git authors that</p>
<ol>
<li>Is only since a given commit.</li>
<li>Is unique.</li>
</ol>
<p>These two are easy, and I've seen some solutions to this online, most using <code>git log --format</code>. But none that I saw fits the additi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,504 | git | # List of authors in git since a given commit
I want a way to list all git authors that
1. Is only since a given commit.
2. Is unique.
These two are easy, and I've seen some solutions to this online, most using `git log --format`. But none that I saw fits the additional requirements:
1. Is ordered by commit date. S... | The following format specifiers will solve your second concern:
%aN: author name (respecting .mailmap)
%aE: author email (respecting .mailmap)
%cN: committer name (respecting .mailmap)
%cE: committer email (respecting .mailmap)
So discounting the duplicate author part, you want something like
```
git log <comm... |
4219570 | Prevent git from writing empty merge commits | 21 | 2010-11-18 21:03:44 | <p>Accustomed to SVN, I always do an 'update' before sharing any changes, so before making any pushes I always pull first.</p>
<p>It's annoying when I pull (even though there weren't any changes to the remote) and see a commit for a merge with <code>0 changed files with 0 additions and 0 deletions</code>. Commits lik... | 17,776 | 286,519 | 2016-05-03 20:55:13 | 4,219,611 | 26 | 2010-11-18 21:10:08 | 501,250 | 2010-11-18 21:10:08 | https://stackoverflow.com/q/4219570 | https://stackoverflow.com/a/4219611 | <p>The very definition of <code>git pull</code> is essentially "fetch and merge with the new remote HEAD for my current branch." If you want to rebase instead, just <code>git pull --rebase</code>. This modifies pull to rebase your commits on top of the new remote HEAD.</p>
<p>Personally, I like to <code>git fetch</c... | <p>The very definition of <code>git pull</code> is essentially "fetch and merge with the new remote HEAD for my current branch." If you want to rebase instead, just <code>git pull --rebase</code>. This modifies pull to rebase your commits on top of the new remote HEAD.</p> <p>Personally, I like to <code>git fetch</c... | 119 | git | <h1>Prevent git from writing empty merge commits</h1>
<p>Accustomed to SVN, I always do an 'update' before sharing any changes, so before making any pushes I always pull first.</p>
<p>It's annoying when I pull (even though there weren't any changes to the remote) and see a commit for a merge with <code>0 changed files... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,505 | git | # Prevent git from writing empty merge commits
Accustomed to SVN, I always do an 'update' before sharing any changes, so before making any pushes I always pull first.
It's annoying when I pull (even though there weren't any changes to the remote) and see a commit for a merge with `0 changed files with 0 additions and... | The very definition of `git pull` is essentially "fetch and merge with the new remote HEAD for my current branch." If you want to rebase instead, just `git pull --rebase`. This modifies pull to rebase your commits on top of the new remote HEAD.
Personally, I like to `git fetch` (download new objects from the remote, b... |
2335343 | How to tell Git to always pull the master branch? | 21 | 2010-02-25 15:51:30 | <p>I find git docs very cryptic regarding this issue. I want to do a simple thing, but it seems doing it is not simple at all. </p>
<p>I have the following situation:</p>
<pre><code>$ git remote -v
origin git://192.168.0.49/mnt/repos
stick /mnt/titanium/podaci/repos
</code></pre>
<p>I can use <strong>git pull</st... | 23,804 | 14,690 | 2014-07-10 15:58:46 | 2,335,429 | 26 | 2010-02-25 16:02:15 | 28,804 | 2012-01-23 18:31:11 | https://stackoverflow.com/q/2335343 | https://stackoverflow.com/a/2335429 | <blockquote>
<p>What does "your configuration file" mean here?</p>
</blockquote>
<p>Your repo's configuration file, found at <code>.git/config</code> at the root of your repo. (There's also a per-user global config file at <code>~/.gitconfig</code>, but you don't want to put repo-specific settings there.)</p>
<bloc... | <blockquote> <p>What does "your configuration file" mean here?</p> </blockquote> <p>Your repo's configuration file, found at <code>.git/config</code> at the root of your repo. (There's also a per-user global config file at <code>~/.gitconfig</code>, but you don't want to put repo-specific settings there.)</p> <bloc... | 119, 76220 | git, git-branch | <h1>How to tell Git to always pull the master branch?</h1>
<p>I find git docs very cryptic regarding this issue. I want to do a simple thing, but it seems doing it is not simple at all. </p>
<p>I have the following situation:</p>
<pre><code>$ git remote -v
origin git://192.168.0.49/mnt/repos
stick /mnt/titanium/po... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,506 | git | # How to tell Git to always pull the master branch?
I find git docs very cryptic regarding this issue. I want to do a simple thing, but it seems doing it is not simple at all.
I have the following situation:
```
$ git remote -v
origin git://192.168.0.49/mnt/repos
stick /mnt/titanium/podaci/repos
```
I can use **... | > What does "your configuration file" mean here?
Your repo's configuration file, found at `.git/config` at the root of your repo. (There's also a per-user global config file at `~/.gitconfig`, but you don't want to put repo-specific settings there.)
> Which file should I edit, and what exactly should I type in?
You ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.