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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
48392440 | git lfs clone vs git clone | 47 | 2018-01-23 00:34:23 | <p>If I have git lfs installed on the client and I run:</p>
<pre><code>git clone
</code></pre>
<p>is this equivalent to </p>
<pre><code>git lfs clone
</code></pre>
<p>or will different results occur?</p>
<p>Thank you!</p>
<p>The answer to this question: </p>
<p><a href="https://stackoverflow.com/questions/39691... | 113,278 | 4,775,020 | 2022-08-19 21:30:42 | 48,406,866 | 41 | 2018-01-23 16:46:09 | 4,775,020 | 2022-08-19 21:30:42 | https://stackoverflow.com/q/48392440 | https://stackoverflow.com/a/48406866 | <p>I updated the git client from 2.10.0 to 2.16.1 and it now says:</p>
<pre><code>WARNING: 'git lfs clone' is deprecated and will not be updated
with new flags from 'git clone'
'git clone' has been updated in upstream Git to have comparable
speeds to 'git lfs clone'.
</code></pre>
<p>I suppose the answer is that <code... | <p>I updated the git client from 2.10.0 to 2.16.1 and it now says:</p> <pre><code>WARNING: 'git lfs clone' is deprecated and will not be updated with new flags from 'git clone' 'git clone' has been updated in upstream Git to have comparable speeds to 'git lfs clone'. </code></pre> <p>I suppose the answer is that <code... | 119, 115244 | git, git-lfs | <h1>git lfs clone vs git clone</h1>
<p>If I have git lfs installed on the client and I run:</p>
<pre><code>git clone
</code></pre>
<p>is this equivalent to </p>
<pre><code>git lfs clone
</code></pre>
<p>or will different results occur?</p>
<p>Thank you!</p>
<p>The answer to this question: </p>
<p><a href="https... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,954 | git | # git lfs clone vs git clone
If I have git lfs installed on the client and I run:
```
git clone
```
is this equivalent to
```
git lfs clone
```
or will different results occur?
Thank you!
The answer to this question:
[Can one clone a Git LFS repo without installing Git LFS?](https://stackoverflow.com/questions/... | I updated the git client from 2.10.0 to 2.16.1 and it now says:
```
WARNING: 'git lfs clone' is deprecated and will not be updated
with new flags from 'git clone'
'git clone' has been updated in upstream Git to have comparable
speeds to 'git lfs clone'.
```
I suppose the answer is that `git lfs clone` is now pretty ... |
44546718 | Should package-lock.json also be published? | 46 | 2017-06-14 13:49:18 | <p>npm 5 introduced <code>package-lock.json</code>, of which the documentation is <a href="https://docs.npmjs.com/files/package-lock.json" rel="noreferrer">here</a>.</p>
<p>It states that the file is intended to be included with version control, so anyone cloning your package and installing it will have the same depend... | 11,126 | 2,204,864 | 2020-09-29 20:43:21 | 44,546,912 | 41 | 2017-06-14 13:57:05 | 2,344,348 | 2018-06-26 17:50:37 | https://stackoverflow.com/q/44546718 | https://stackoverflow.com/a/44546912 | <p>It cannot be published.</p>
<p>From the npm documentation:</p>
<blockquote>
<p>One key detail about package-lock.json is that it <strong>cannot be published</strong>, and it will be ignored if found in any place other than the toplevel package</p>
</blockquote>
<p><a href="https://docs.npmjs.com/files/package-l... | <p>It cannot be published.</p> <p>From the npm documentation:</p> <blockquote> <p>One key detail about package-lock.json is that it <strong>cannot be published</strong>, and it will be ignored if found in any place other than the toplevel package</p> </blockquote> <p><a href="https://docs.npmjs.com/files/package-l... | 25056, 46426, 61387, 112853, 126671 | gitignore, node.js, npm, npmignore, package-lock.json | <h1>Should package-lock.json also be published?</h1>
<p>npm 5 introduced <code>package-lock.json</code>, of which the documentation is <a href="https://docs.npmjs.com/files/package-lock.json" rel="noreferrer">here</a>.</p>
<p>It states that the file is intended to be included with version control, so anyone cloning you... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,955 | git | # Should package-lock.json also be published?
npm 5 introduced `package-lock.json`, of which the documentation is [here](https://docs.npmjs.com/files/package-lock.json).
It states that the file is intended to be included with version control, so anyone cloning your package and installing it will have the same depende... | It cannot be published.
From the npm documentation:
> One key detail about package-lock.json is that it **cannot be published**, and it will be ignored if found in any place other than the toplevel package
[See package-lock.json documentation on docs.npmjs.com](https://docs.npmjs.com/files/package-lock.json).
Howev... |
4273175 | Undoing a bad pull | 46 | 2010-11-25 02:05:00 | <p>First of all, Git sucks. I know, I know, it's supposed to be the best thing since sliced bread, but it sucks. It's like trying to shave with a chainsaw: one slight mistake and there are blood and teeth everywhere. Perhaps, if I could actually make an exact distinction between a head, a ref, a commit, a branch, a ... | 8,559 | 238,884 | 2014-03-21 02:15:33 | 4,273,782 | 41 | 2010-11-25 04:39:51 | 509,939 | 2010-11-25 04:39:51 | https://stackoverflow.com/q/4273175 | https://stackoverflow.com/a/4273782 | <p>Use <code>git reflog</code> to see what your HEAD pointed to before you screwed it up.</p>
<p>You should see something like:</p>
<pre><code>48ab8d HEAD@{0}: pull: Fast-forward
a34bda HEAD@{5}: commit: my last commit message
</code></pre>
<p>Now, point your master branch back at the commit before the bad pull:</p>... | <p>Use <code>git reflog</code> to see what your HEAD pointed to before you screwed it up.</p> <p>You should see something like:</p> <pre><code>48ab8d HEAD@{0}: pull: Fast-forward a34bda HEAD@{5}: commit: my last commit message </code></pre> <p>Now, point your master branch back at the commit before the bad pull:</p>... | 119 | git | <h1>Undoing a bad pull</h1>
<p>First of all, Git sucks. I know, I know, it's supposed to be the best thing since sliced bread, but it sucks. It's like trying to shave with a chainsaw: one slight mistake and there are blood and teeth everywhere. Perhaps, if I could actually make an exact distinction between a head, a... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,956 | git | # Undoing a bad pull
First of all, Git sucks. I know, I know, it's supposed to be the best thing since sliced bread, but it sucks. It's like trying to shave with a chainsaw: one slight mistake and there are blood and teeth everywhere. Perhaps, if I could actually make an exact distinction between a head, a ref, a comm... | Use `git reflog` to see what your HEAD pointed to before you screwed it up.
You should see something like:
```
48ab8d HEAD@{0}: pull: Fast-forward
a34bda HEAD@{5}: commit: my last commit message
```
Now, point your master branch back at the commit before the bad pull:
`git reset --hard a34bda`
Done. Like it never ... |
3774439 | Stage file by its file name, regardless of directory--Git | 43 | 2010-09-22 23:42:22 | <p>I have <em>very</em> nested directories in a project, and I'm a lazy programmer. </p>
<p>Let's say I have a file name <code>EventEditor.foo</code> I want to stage my file regardless of whether it's in the root directory or <code>./src/holy/sweet/mother/of/baby/raptor/jesus/this/is/a/long/hiearchy/EventEditor.foo</c... | 9,269 | 66,584 | 2017-06-09 17:15:06 | 3,774,481 | 41 | 2010-09-22 23:53:35 | 69,755 | 2010-09-23 23:54:42 | https://stackoverflow.com/q/3774439 | https://stackoverflow.com/a/3774481 | <p>If you would like to match a glob recursively when using <a href="http://www.kernel.org/pub/software/scm/git/docs/git-add.html" rel="noreferrer"><code>git add</code></a>, start the glob you pass in to <code>git add</code> with a directory name (such as <code>.</code> for the current directory), and make sure that th... | <p>If you would like to match a glob recursively when using <a href="http://www.kernel.org/pub/software/scm/git/docs/git-add.html" rel="noreferrer"><code>git add</code></a>, start the glob you pass in to <code>git add</code> with a directory name (such as <code>.</code> for the current directory), and make sure that th... | 119 | git | <h1>Stage file by its file name, regardless of directory--Git</h1>
<p>I have <em>very</em> nested directories in a project, and I'm a lazy programmer. </p>
<p>Let's say I have a file name <code>EventEditor.foo</code> I want to stage my file regardless of whether it's in the root directory or <code>./src/holy/sweet/mot... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,957 | git | # Stage file by its file name, regardless of directory--Git
I have *very* nested directories in a project, and I'm a lazy programmer.
Let's say I have a file name `EventEditor.foo` I want to stage my file regardless of whether it's in the root directory or `./src/holy/sweet/mother/of/baby/raptor/jesus/this/is/a/long/... | If you would like to match a glob recursively when using [`git add`](http://www.kernel.org/pub/software/scm/git/docs/git-add.html), start the glob you pass in to `git add` with a directory name (such as `.` for the current directory), and make sure that the glob is in quotes so that Git can interpret it instead of the ... |
30625213 | How do I use Git's interactive rebase with a local-only repository (no remote / origin)? | 42 | 2015-06-03 16:03:22 | <p>I use git as a local source control system mostly for history and diff tracking. I still want to use rebase to do fixup / squash on WIP commits that I will make periodically. When I try to do <code>git rebase -i</code> though, I get the following: </p>
<pre><code>There is no tracking information for the current b... | 13,016 | 3,782 | 2018-10-24 08:16:05 | 30,625,614 | 41 | 2015-06-03 16:21:59 | 1,646,320 | 2018-10-24 08:16:05 | https://stackoverflow.com/q/30625213 | https://stackoverflow.com/a/30625614 | <p><code>git rebase -i</code> in shorthand, without specifying a destination branch, will make git assume that you are trying to rebase against a remote branch tracked by your branch. That's why the error message is mentioning stuff about remotes.</p>
<p>When you do specify a target, git will rebase against that <a hr... | <p><code>git rebase -i</code> in shorthand, without specifying a destination branch, will make git assume that you are trying to rebase against a remote branch tracked by your branch. That's why the error message is mentioning stuff about remotes.</p> <p>When you do specify a target, git will rebase against that <a hr... | 119, 1879, 8974, 29934, 31678 | branch, git, git-rebase, rebase, remote-branch | <h1>How do I use Git's interactive rebase with a local-only repository (no remote / origin)?</h1>
<p>I use git as a local source control system mostly for history and diff tracking. I still want to use rebase to do fixup / squash on WIP commits that I will make periodically. When I try to do <code>git rebase -i</code... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,958 | git | # How do I use Git's interactive rebase with a local-only repository (no remote / origin)?
I use git as a local source control system mostly for history and diff tracking. I still want to use rebase to do fixup / squash on WIP commits that I will make periodically. When I try to do `git rebase -i` though, I get the fo... | `git rebase -i` in shorthand, without specifying a destination branch, will make git assume that you are trying to rebase against a remote branch tracked by your branch. That's why the error message is mentioning stuff about remotes.
When you do specify a target, git will rebase against that [commit-ish](https://stack... |
2927672 | How can I get 'git status' to always use short format? | 42 | 2010-05-28 08:48:54 | <p>I'd like <code>git status</code> to always use the short format:</p>
<pre><code>$ git status --short
M file1
M dir/file2
?? file_untracked3
?? dir/file_untracked4
</code></pre>
<p>There doesn't seem to exist a configuration option for this, and <code>git config --global alias.status "status --short"</code> does ... | 10,988 | 2,457 | 2016-06-15 12:47:30 | 17,282,874 | 41 | 2013-06-24 18:53:33 | 6,309 | 2014-09-12 17:39:09 | https://stackoverflow.com/q/2927672 | https://stackoverflow.com/a/17282874 | <p>Starting <a href="https://github.com/git/git/blob/master/Documentation/RelNotes/1.8.4.txt#L42-L44" rel="noreferrer">git1.8.4 (July 2013)</a>, you can configure <code>git status</code> to use short by default.<br>
See <a href="https://github.com/git/git/commit/50e4f757f4adda096239c1ad60499cf606bf2c6f" rel="noreferrer... | <p>Starting <a href="https://github.com/git/git/blob/master/Documentation/RelNotes/1.8.4.txt#L42-L44" rel="noreferrer">git1.8.4 (July 2013)</a>, you can configure <code>git status</code> to use short by default.<br> See <a href="https://github.com/git/git/commit/50e4f757f4adda096239c1ad60499cf606bf2c6f" rel="noreferrer... | 119, 3791, 6951 | git, status, zsh | <h1>How can I get 'git status' to always use short format?</h1>
<p>I'd like <code>git status</code> to always use the short format:</p>
<pre><code>$ git status --short
M file1
M dir/file2
?? file_untracked3
?? dir/file_untracked4
</code></pre>
<p>There doesn't seem to exist a configuration option for this, and <cod... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,959 | git | # How can I get 'git status' to always use short format?
I'd like `git status` to always use the short format:
```
$ git status --short
M file1
M dir/file2
?? file_untracked3
?? dir/file_untracked4
```
There doesn't seem to exist a configuration option for this, and `git config --global alias.status "status --shor... | Starting [git1.8.4 (July 2013)](https://github.com/git/git/blob/master/Documentation/RelNotes/1.8.4.txt#L42-L44), you can configure `git status` to use short by default.
See [commit 50e4f757f4adda096239c1ad60499cf606bf2c6f](https://github.com/git/git/commit/50e4f757f4adda096239c1ad60499cf606bf2c6f):
> Some people al... |
16951267 | How to get the path of a file relative to the Git repository root? | 40 | 2013-06-05 23:00:58 | <p>Example:</p>
<pre><code>$ cd lib
$ git absolute-path test.c # how to do this?
lib/test.c
</code></pre>
| 26,064 | 525,872 | 2022-08-05 11:43:26 | 16,951,268 | 41 | 2013-06-05 23:00:58 | 525,872 | 2022-08-05 11:43:26 | https://stackoverflow.com/q/16951267 | https://stackoverflow.com/a/16951268 | <p>Use <a href="https://www.git-scm.com/docs/git-ls-files" rel="nofollow noreferrer"><code>git ls-files</code></a>:</p>
<pre><code>$ cd lib
$ git ls-files --full-name test.c
lib/test.c
</code></pre>
<p>This only works for files that have been committed into the repo, but it's better than nothing.</p>
| <p>Use <a href="https://www.git-scm.com/docs/git-ls-files" rel="nofollow noreferrer"><code>git ls-files</code></a>:</p> <pre><code>$ cd lib $ git ls-files --full-name test.c lib/test.c </code></pre> <p>This only works for files that have been committed into the repo, but it's better than nothing.</p> | 119, 6268 | git, path | <h1>How to get the path of a file relative to the Git repository root?</h1>
<p>Example:</p>
<pre><code>$ cd lib
$ git absolute-path test.c # how to do this?
lib/test.c
</code></pre>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,961 | git | # How to get the path of a file relative to the Git repository root?
Example:
```
$ cd lib
$ git absolute-path test.c # how to do this?
lib/test.c
``` | Use [`git ls-files`](https://www.git-scm.com/docs/git-ls-files):
```
$ cd lib
$ git ls-files --full-name test.c
lib/test.c
```
This only works for files that have been committed into the repo, but it's better than nothing. |
8709001 | Git asks me to commit or stash changes on checkout master, even though all changes were committed? | 40 | 2012-01-03 07:07:55 | <p>I have two branches locally, <code>master</code> and <code>Berislav</code>. The latter is currently active, and I have committed all the changes. When I try to checkout to <code>master</code>, I get the following message:</p>
<blockquote>
<p>error: Your local changes to the following files would be overwritten
... | 66,935 | 122,033 | 2019-07-12 08:13:45 | 11,860,766 | 41 | 2012-08-08 08:39:32 | 856,465 | 2016-03-29 21:02:25 | https://stackoverflow.com/q/8709001 | https://stackoverflow.com/a/11860766 | <p>I encountered a similar problem today. <code>git status</code> wasn't listing the files which checkout was complaining about. I did a:</p>
<pre><code>git checkout -- path/to/file
</code></pre>
<p>And that undoes any changes to the file.</p>
<p>An even easier way to undo all unstaged changes on current working dir... | <p>I encountered a similar problem today. <code>git status</code> wasn't listing the files which checkout was complaining about. I did a:</p> <pre><code>git checkout -- path/to/file </code></pre> <p>And that undoes any changes to the file.</p> <p>An even easier way to undo all unstaged changes on current working dir... | 119 | git | <h1>Git asks me to commit or stash changes on checkout master, even though all changes were committed?</h1>
<p>I have two branches locally, <code>master</code> and <code>Berislav</code>. The latter is currently active, and I have committed all the changes. When I try to checkout to <code>master</code>, I get the follow... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,962 | git | # Git asks me to commit or stash changes on checkout master, even though all changes were committed?
I have two branches locally, `master` and `Berislav`. The latter is currently active, and I have committed all the changes. When I try to checkout to `master`, I get the following message:
> error: Your local changes ... | I encountered a similar problem today. `git status` wasn't listing the files which checkout was complaining about. I did a:
```
git checkout -- path/to/file
```
And that undoes any changes to the file.
An even easier way to undo all unstaged changes on current working directory **[1]**:
```
git checkout -- .
```
*... |
3666953 | Showing Git branch structure | 39 | 2010-09-08 10:54:40 | <p>Is there a way to show only the branch structure in Git? There are a number of tools that show the commits graphically, but in my case the list is so long that it's impossible to see the structure. I guess git-log could be the answer, but I can't find any switches that only show the branching commits. This along wit... | 50,842 | 94,895 | 2020-10-11 08:19:53 | 3,667,139 | 41 | 2010-09-08 11:19:13 | 6,309 | 2010-09-10 04:20:23 | https://stackoverflow.com/q/3666953 | https://stackoverflow.com/a/3667139 | <p>I am not sure about what you mean by "branch structure".<br>
<code>git log</code> can help visualize the branches made through commits (See this <a href="http://www.jukie.net/bart/blog/pimping-out-git-log" rel="noreferrer">blog post</a>):</p>
<pre><code>[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -... | <p>I am not sure about what you mean by "branch structure".<br> <code>git log</code> can help visualize the branches made through commits (See this <a href="http://www.jukie.net/bart/blog/pimping-out-git-log" rel="noreferrer">blog post</a>):</p> <pre><code>[alias] lg = log --graph --pretty=format:'%Cred%h%Creset -... | 119, 1879, 76220 | branch, git, git-branch | <h1>Showing Git branch structure</h1>
<p>Is there a way to show only the branch structure in Git? There are a number of tools that show the commits graphically, but in my case the list is so long that it's impossible to see the structure. I guess git-log could be the answer, but I can't find any switches that only show... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,963 | git | # Showing Git branch structure
Is there a way to show only the branch structure in Git? There are a number of tools that show the commits graphically, but in my case the list is so long that it's impossible to see the structure. I guess git-log could be the answer, but I can't find any switches that only show the bran... | I am not sure about what you mean by "branch structure".
`git log` can help visualize the branches made through commits (See this [blog post](http://www.jukie.net/bart/blog/pimping-out-git-log)):
```
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%... |
28111035 | Where does the excerpt in the git diff hunk header come from? | 38 | 2015-01-23 13:30:30 | <p>When I use <code>git diff</code> on a C# file, I see something like this:</p>
<pre><code>diff --git a/foo.cs b/foo.cs
index ff61664..dd8a3e3 100644
--- a/foo.cs
+++ b/foo.cs
@@ -15,6 +15,7 @@ static void Main(string[] args)
string name = Console.ReadLine();
}
Console.Wr... | 7,680 | 98,713 | 2025-01-04 21:35:02 | 28,111,535 | 41 | 2015-01-23 13:58:27 | 6,309 | 2025-01-04 21:35:02 | https://stackoverflow.com/q/28111035 | https://stackoverflow.com/a/28111535 | <blockquote>
<p>Is there a way to customize it?</p>
</blockquote>
<p>The configuration is defined in <a href="http://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header" rel="nofollow noreferrer"><code>.gitattributes</code>, section "Defining a custom hunk-header"</a>:</p>
<blockquote>
<p>First, in ... | <blockquote> <p>Is there a way to customize it?</p> </blockquote> <p>The configuration is defined in <a href="http://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header" rel="nofollow noreferrer"><code>.gitattributes</code>, section "Defining a custom hunk-header"</a>:</p> <blockquote> <p>First, in ... | 119, 367, 606 | diff, git, syntax | <h1>Where does the excerpt in the git diff hunk header come from?</h1>
<p>When I use <code>git diff</code> on a C# file, I see something like this:</p>
<pre><code>diff --git a/foo.cs b/foo.cs
index ff61664..dd8a3e3 100644
--- a/foo.cs
+++ b/foo.cs
@@ -15,6 +15,7 @@ static void Main(string[] args)
s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,964 | git | # Where does the excerpt in the git diff hunk header come from?
When I use `git diff` on a C# file, I see something like this:
```
diff --git a/foo.cs b/foo.cs
index ff61664..dd8a3e3 100644
--- a/foo.cs
+++ b/foo.cs
@@ -15,6 +15,7 @@ static void Main(string[] args)
string name = Console.ReadLine()... | > Is there a way to customize it?
The configuration is defined in [`.gitattributes`, section "Defining a custom hunk-header"](http://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header):
> First, in `.gitattributes`, you would assign the `diff` attribute for paths.
>
> ```
> *.tex diff=tex
> ```
>
> Then, y... |
17798583 | Adding file to git's stage does nothing and cannot be committed | 37 | 2013-07-22 22:32:07 | <p>I have gotten myself into a bizarre situation where in one of my branches a web.config file cannot be added to the stage. The output of</p>
<pre><code>git add path/to/web.config
git status
</code></pre>
<p>Is the same as as before the file was added. Web.config appears to require modifications and has not been add... | 20,529 | 19,977 | 2024-11-01 15:37:25 | 18,357,215 | 41 | 2013-08-21 12:18:31 | 19,977 | 2019-12-17 16:28:27 | https://stackoverflow.com/q/17798583 | https://stackoverflow.com/a/18357215 | <p>The final solution to this particular problem was to remove both web.config entries from the git cache, commit any changes, and re-add the desired Web.config file back to git.</p>
<pre><code>git rm --cached path/to/Web.config
git rm --cached path/to/web.config
git commit -m "Repair confused cache"
git add path/to/W... | <p>The final solution to this particular problem was to remove both web.config entries from the git cache, commit any changes, and re-add the desired Web.config file back to git.</p> <pre><code>git rm --cached path/to/Web.config git rm --cached path/to/web.config git commit -m "Repair confused cache" git add path/to/W... | 119 | git | <h1>Adding file to git's stage does nothing and cannot be committed</h1>
<p>I have gotten myself into a bizarre situation where in one of my branches a web.config file cannot be added to the stage. The output of</p>
<pre><code>git add path/to/web.config
git status
</code></pre>
<p>Is the same as as before the file wa... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,965 | git | # Adding file to git's stage does nothing and cannot be committed
I have gotten myself into a bizarre situation where in one of my branches a web.config file cannot be added to the stage. The output of
```
git add path/to/web.config
git status
```
Is the same as as before the file was added. Web.config appears to re... | The final solution to this particular problem was to remove both web.config entries from the git cache, commit any changes, and re-add the desired Web.config file back to git.
```
git rm --cached path/to/Web.config
git rm --cached path/to/web.config
git commit -m "Repair confused cache"
git add path/to/Web.config
git ... |
68277661 | What does the -M mean in git branch -M main? | 35 | 2021-07-06 21:45:09 | <p>GitHub says to enter <code>git branch -M main</code> as a step for creating a new repository on the command line. What does the <code>-M</code> mean?</p>
| 20,064 | 8,888,320 | 2025-10-21 16:36:43 | 68,277,662 | 41 | 2021-07-06 21:45:09 | 8,888,320 | 2023-05-17 09:58:37 | https://stackoverflow.com/q/68277661 | https://stackoverflow.com/a/68277662 | <p>-M is a flag (shortcut) for <code>--move --force</code> per the <a href="https://git-scm.com/docs/git-branch#Documentation/git-branch.txt--M" rel="noreferrer">docs page on <code>git branch</code></a>. It forcefully renames the branch from <code>master</code> (the default branch name for repositories created using th... | <p>-M is a flag (shortcut) for <code>--move --force</code> per the <a href="https://git-scm.com/docs/git-branch#Documentation/git-branch.txt--M" rel="noreferrer">docs page on <code>git branch</code></a>. It forcefully renames the branch from <code>master</code> (the default branch name for repositories created using th... | 119 | git | <h1>What does the -M mean in git branch -M main?</h1>
<p>GitHub says to enter <code>git branch -M main</code> as a step for creating a new repository on the command line. What does the <code>-M</code> mean?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,967 | git | # What does the -M mean in git branch -M main?
GitHub says to enter `git branch -M main` as a step for creating a new repository on the command line. What does the `-M` mean? | -M is a flag (shortcut) for `--move --force` per the [docs page on `git branch`](https://git-scm.com/docs/git-branch#Documentation/git-branch.txt--M). It forcefully renames the branch from `master` (the default branch name for repositories created using the command line is `master`, while those created in GitHub [start... |
29665183 | Using git to see all logs related to a specific file extension within subdirectories | 33 | 2015-04-16 04:09:22 | <p>I am trying to see the commits in the history of a repository but just for files with an specific extension.</p>
<p>If this is the directory structure:</p>
<pre><code>$ tree
.
├── a.txt
├── b
└── subdir
├── c.txt
└── d
</code></pre>
<p>And this is the full history:</p>
<pre><code>$ git log --name-only --... | 12,128 | 2,109,534 | 2019-01-07 22:32:44 | 29,665,291 | 41 | 2015-04-16 04:21:21 | 379,512 | 2019-01-07 22:32:44 | https://stackoverflow.com/q/29665183 | https://stackoverflow.com/a/29665291 | <p>Try:</p>
<pre><code>git log --oneline -- '*.txt'
</code></pre>
<p>The <code>--</code> is used to indicate only positional arguments will follow. And <code>'*.txt'</code> searches all folders from the current directory on down. </p>
<p>Alternatively, you could limit the results by starting the search in a subdir... | <p>Try:</p> <pre><code>git log --oneline -- '*.txt' </code></pre> <p>The <code>--</code> is used to indicate only positional arguments will follow. And <code>'*.txt'</code> searches all folders from the current directory on down. </p> <p>Alternatively, you could limit the results by starting the search in a subdir... | 119, 47913 | git, git-log | <h1>Using git to see all logs related to a specific file extension within subdirectories</h1>
<p>I am trying to see the commits in the history of a repository but just for files with an specific extension.</p>
<p>If this is the directory structure:</p>
<pre><code>$ tree
.
├── a.txt
├── b
└── subdir
├── c.txt
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,970 | git | # Using git to see all logs related to a specific file extension within subdirectories
I am trying to see the commits in the history of a repository but just for files with an specific extension.
If this is the directory structure:
```
$ tree
.
├── a.txt
├── b
└── subdir
├── c.txt
└── d
```
And this is the ... | Try:
```
git log --oneline -- '*.txt'
```
The `--` is used to indicate only positional arguments will follow. And `'*.txt'` searches all folders from the current directory on down.
Alternatively, you could limit the results by starting the search in a subdirectory, e.g. `-- 'sub/*.txt'`. |
17200035 | Swap a master and a feature branch | 33 | 2013-06-19 19:47:50 | <p>We find ourselves in the situation where <strong>master</strong> has new feature work, and <strong>feature1</strong> (which branched off master) is the stable master. How can we change things so that they "trade places"? I.e., feature1 becomes master, and master becomes <strong>newfeaturebranch</strong>?</p>
<p>I f... | 9,874 | 106,906 | 2019-06-19 08:30:02 | 17,200,119 | 41 | 2013-06-19 19:53:03 | 216,074 | 2013-06-19 19:53:03 | https://stackoverflow.com/q/17200035 | https://stackoverflow.com/a/17200119 | <p>You can rename branches:</p>
<pre><code>git branch -m master newfeaturebranch
git branch -m feature1 master
</code></pre>
| <p>You can rename branches:</p> <pre><code>git branch -m master newfeaturebranch git branch -m feature1 master </code></pre> | 119, 1879 | branch, git | <h1>Swap a master and a feature branch</h1>
<p>We find ourselves in the situation where <strong>master</strong> has new feature work, and <strong>feature1</strong> (which branched off master) is the stable master. How can we change things so that they "trade places"? I.e., feature1 becomes master, and master becomes <s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,971 | git | # Swap a master and a feature branch
We find ourselves in the situation where **master** has new feature work, and **feature1** (which branched off master) is the stable master. How can we change things so that they "trade places"? I.e., feature1 becomes master, and master becomes **newfeaturebranch**?
I found a coup... | You can rename branches:
```
git branch -m master newfeaturebranch
git branch -m feature1 master
``` |
23336221 | How to merge one remote branch into another remote branch? | 32 | 2014-04-28 08:33:58 | <p>I would like to know how to merge one remote branch into another remoter branch and have the previous one removed right after the merge applied.</p>
| 89,224 | 1,466,198 | 2020-04-10 15:58:23 | 23,337,869 | 41 | 2014-04-28 09:52:31 | 1,851,138 | 2020-04-10 15:58:23 | https://stackoverflow.com/q/23336221 | https://stackoverflow.com/a/23337869 | <p>From what I understand, you have one remote <strong>foo</strong>, containing <strong>branch_1</strong> and <strong>branch_2</strong>.
First, we can't do merge operation remotly.
We have to track the remote repository, do the operation we want locally (such as merging branches) and then push our new snapshot to the ... | <p>From what I understand, you have one remote <strong>foo</strong>, containing <strong>branch_1</strong> and <strong>branch_2</strong>. First, we can't do merge operation remotly. We have to track the remote repository, do the operation we want locally (such as merging branches) and then push our new snapshot to the ... | 119 | git | <h1>How to merge one remote branch into another remote branch?</h1>
<p>I would like to know how to merge one remote branch into another remoter branch and have the previous one removed right after the merge applied.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,972 | git | # How to merge one remote branch into another remote branch?
I would like to know how to merge one remote branch into another remoter branch and have the previous one removed right after the merge applied. | From what I understand, you have one remote **foo**, containing **branch_1** and **branch_2**.
First, we can't do merge operation remotly.
We have to track the remote repository, do the operation we want locally (such as merging branches) and then push our new snapshot to the server.
Ie:
- *git clone [repo_adress]*
... |
16005193 | Converting a local svn repo dump to git | 32 | 2013-04-14 22:37:39 | <p>I searched related questions but I couldn't find anything matching my specific situation: I have some old repository archives from an SVN server that was taken down years ago. They're tarballs of the original repository structure on the server. What I want to do is convert them to git repositories as a basis for fut... | 28,803 | 379,897 | 2020-11-19 09:34:20 | 16,019,093 | 41 | 2013-04-15 15:30:14 | 724,027 | 2013-04-17 07:27:43 | https://stackoverflow.com/q/16005193 | https://stackoverflow.com/a/16019093 | <p>install subversion locally in order to import your dump, then with git-svn package.</p>
<p>You can use <code>git svn clone file:///path/to/svn/repo /path/to/empty/dir</code></p>
| <p>install subversion locally in order to import your dump, then with git-svn package.</p> <p>You can use <code>git svn clone file:///path/to/svn/repo /path/to/empty/dir</code></p> | 63, 119, 456, 85754 | git, svn, svn2git, version-control | <h1>Converting a local svn repo dump to git</h1>
<p>I searched related questions but I couldn't find anything matching my specific situation: I have some old repository archives from an SVN server that was taken down years ago. They're tarballs of the original repository structure on the server. What I want to do is co... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,973 | git | # Converting a local svn repo dump to git
I searched related questions but I couldn't find anything matching my specific situation: I have some old repository archives from an SVN server that was taken down years ago. They're tarballs of the original repository structure on the server. What I want to do is convert the... | install subversion locally in order to import your dump, then with git-svn package.
You can use `git svn clone file:///path/to/svn/repo /path/to/empty/dir` |
43041882 | Git: How to diff two different files in different commits? | 31 | 2017-03-27 08:52:06 | <p>I have a repository where a number of files have been renamed from .html to .php and further edited in a number of commits since my last pull. Using <code>git diff</code> to shows all the <code>html</code> contents removed and all the <code>php</code> content added. Is there a neat way to have <code>git diff</code... | 7,485 | 462,755 | 2020-10-19 20:44:46 | 49,179,227 | 41 | 2018-03-08 17:38:11 | 1,863,775 | 2018-03-09 16:25:47 | https://stackoverflow.com/q/43041882 | https://stackoverflow.com/a/49179227 | <p>You can always compare 2 files in 2 different commits:</p>
<pre><code>git diff commit1:file1_path commit2:file2_path
</code></pre>
| <p>You can always compare 2 files in 2 different commits:</p> <pre><code>git diff commit1:file1_path commit2:file2_path </code></pre> | 119, 606, 5597 | commit, diff, git | <h1>Git: How to diff two different files in different commits?</h1>
<p>I have a repository where a number of files have been renamed from .html to .php and further edited in a number of commits since my last pull. Using <code>git diff</code> to shows all the <code>html</code> contents removed and all the <code>php</co... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,976 | git | # Git: How to diff two different files in different commits?
I have a repository where a number of files have been renamed from .html to .php and further edited in a number of commits since my last pull. Using `git diff` to shows all the `html` contents removed and all the `php` content added. Is there a neat way to h... | You can always compare 2 files in 2 different commits:
```
git diff commit1:file1_path commit2:file2_path
``` |
47797663 | Is it possible to diff lfs files in git? | 29 | 2017-12-13 16:15:51 | <p>When I look at the diff of an lfs file, I just see the oid and size difference. Is there a way to easily diff the actual file contents?</p>
| 15,043 | 1,078,116 | 2021-11-17 22:10:26 | 58,508,020 | 41 | 2019-10-22 15:50:16 | 5,170,571 | 2021-11-17 22:10:26 | https://stackoverflow.com/q/47797663 | https://stackoverflow.com/a/58508020 | <p>From <a href="https://github.com/git-lfs/git-lfs/issues/440#issuecomment-501007460" rel="noreferrer">this post by bk2204</a>:</p>
<blockquote>
<p>Another option if you want to have diffs is to run <strong><code>git config diff.lfs.textconv cat</code></strong>, which will have any files with the <code>diff=lfs</code>... | <p>From <a href="https://github.com/git-lfs/git-lfs/issues/440#issuecomment-501007460" rel="noreferrer">this post by bk2204</a>:</p> <blockquote> <p>Another option if you want to have diffs is to run <strong><code>git config diff.lfs.textconv cat</code></strong>, which will have any files with the <code>diff=lfs</code>... | 119, 115244 | git, git-lfs | <h1>Is it possible to diff lfs files in git?</h1>
<p>When I look at the diff of an lfs file, I just see the oid and size difference. Is there a way to easily diff the actual file contents?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,977 | git | # Is it possible to diff lfs files in git?
When I look at the diff of an lfs file, I just see the oid and size difference. Is there a way to easily diff the actual file contents? | From [this post by bk2204](https://github.com/git-lfs/git-lfs/issues/440#issuecomment-501007460):
> Another option if you want to have diffs is to run **`git config diff.lfs.textconv cat`**, which will have any files with the `diff=lfs` attribute automatically rendered through Git to show the LFS file instead of the p... |
16203562 | Programmatically swap last two commits | 29 | 2013-04-24 22:50:36 | <p>I know how to swap the last two commits using <code>git rebase</code> interactively (<code>git rebase -i HEAD~2</code>, <code>ddjp:x</code> in Vim), but I'd like to do it programmatically with a wrapper script since it's something I end up doing relatively often.</p>
<p>To be more concrete, I want to rewrite histor... | 6,944 | 1,204,143 | 2017-08-10 18:22:27 | 16,203,754 | 41 | 2013-04-24 23:08:11 | 1,385,860 | 2017-05-29 11:28:57 | https://stackoverflow.com/q/16203562 | https://stackoverflow.com/a/16203754 | <p>This should do it:</p>
<pre><code>git tag old
git reset --hard HEAD~2
git cherry-pick old
git cherry-pick old~1
git tag -d old
</code></pre>
<p>First, you tag the place where you are as <code>old</code>, then go back two commits, <code>git cherry-pick</code> the commits in the other order, and delete the <code>old... | <p>This should do it:</p> <pre><code>git tag old git reset --hard HEAD~2 git cherry-pick old git cherry-pick old~1 git tag -d old </code></pre> <p>First, you tag the place where you are as <code>old</code>, then go back two commits, <code>git cherry-pick</code> the commits in the other order, and delete the <code>old... | 119 | git | <h1>Programmatically swap last two commits</h1>
<p>I know how to swap the last two commits using <code>git rebase</code> interactively (<code>git rebase -i HEAD~2</code>, <code>ddjp:x</code> in Vim), but I'd like to do it programmatically with a wrapper script since it's something I end up doing relatively often.</p>
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,978 | git | # Programmatically swap last two commits
I know how to swap the last two commits using `git rebase` interactively (`git rebase -i HEAD~2`, `ddjp:x` in Vim), but I'd like to do it programmatically with a wrapper script since it's something I end up doing relatively often.
To be more concrete, I want to rewrite history... | This should do it:
```
git tag old
git reset --hard HEAD~2
git cherry-pick old
git cherry-pick old~1
git tag -d old
```
First, you tag the place where you are as `old`, then go back two commits, `git cherry-pick` the commits in the other order, and delete the `old` tag. |
37189861 | git error: There are still logs under | 28 | 2016-05-12 14:24:47 | <p>I am trying to use <code>git fetch --all</code> but it gives me errors when fetching a certain repository. </p>
<blockquote>
<p>error: There are still logs under '.git/logs/refs/remotes/tpickel/RS'</p>
</blockquote>
<p>and</p>
<blockquote>
<p><strong>!</strong> [new branch] RS -> tpickel/RS (unable to update ... | 23,156 | 3,143,953 | 2023-11-08 12:34:39 | 37,193,151 | 41 | 2016-05-12 16:57:37 | 1,256,452 | 2016-05-17 16:57:32 | https://stackoverflow.com/q/37189861 | https://stackoverflow.com/a/37193151 | <p>Apparently there used to be a <code>tpickel/RS/foo</code> (for some name <code>foo</code>).</p>
<p>Your Git recorded information about that, in <code>.git/logs/refs/remotes/tpickel/RS/foo</code>. Now your Git is trying to create a file named <code>.git/logs/refs/remotes/tpickel/RS</code>, which will record informa... | <p>Apparently there used to be a <code>tpickel/RS/foo</code> (for some name <code>foo</code>).</p> <p>Your Git recorded information about that, in <code>.git/logs/refs/remotes/tpickel/RS/foo</code>. Now your Git is trying to create a file named <code>.git/logs/refs/remotes/tpickel/RS</code>, which will record informa... | 119 | git | <h1>git error: There are still logs under</h1>
<p>I am trying to use <code>git fetch --all</code> but it gives me errors when fetching a certain repository. </p>
<blockquote>
<p>error: There are still logs under '.git/logs/refs/remotes/tpickel/RS'</p>
</blockquote>
<p>and</p>
<blockquote>
<p><strong>!</strong> [... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,979 | git | # git error: There are still logs under
I am trying to use `git fetch --all` but it gives me errors when fetching a certain repository.
> error: There are still logs under '.git/logs/refs/remotes/tpickel/RS'
and
> **!** [new branch] RS -> tpickel/RS (unable to update local ref)
What went wrong and how to fix it?
... | Apparently there used to be a `tpickel/RS/foo` (for some name `foo`).
Your Git recorded information about that, in `.git/logs/refs/remotes/tpickel/RS/foo`. Now your Git is trying to create a file named `.git/logs/refs/remotes/tpickel/RS`, which will record information about the new branch `tpickel/RS`. It cannot do so... |
63820683 | With pre-commit, how to use some hooks before commit and others before push | 27 | 2020-09-09 23:09:01 | <p>Some hooks can take a while to run, and I would like to run those before I push, but not before each particular commit (for example, pylint can be a bit slow).</p>
<p>I've seen the following:</p>
<ul>
<li><a href="https://github.com/pre-commit/pre-commit/issues/768" rel="noreferrer">Question: Using hooks at differen... | 16,672 | 3,130,747 | 2025-03-01 02:16:00 | 63,821,690 | 41 | 2020-09-10 01:44:03 | 812,183 | 2025-03-01 02:16:00 | https://stackoverflow.com/q/63820683 | https://stackoverflow.com/a/63821690 | <p>your configuration is correct, except that the whitespace hooks in <code>pre-commit/pre-commit-hooks</code> <a href="https://github.com/pre-commit/pre-commit-hooks/blob/31d41ff29115a87808277ee0ec23999b17d5b583/.pre-commit-hooks.yaml#L127" rel="nofollow noreferrer">set <code>stages</code> themselves</a> so they won't... | <p>your configuration is correct, except that the whitespace hooks in <code>pre-commit/pre-commit-hooks</code> <a href="https://github.com/pre-commit/pre-commit-hooks/blob/31d41ff29115a87808277ee0ec23999b17d5b583/.pre-commit-hooks.yaml#L127" rel="nofollow noreferrer">set <code>stages</code> themselves</a> so they won't... | 16, 119, 14000, 25281, 139402 | git, pre-commit, pre-commit.com, pre-commit-hook, python | <h1>With pre-commit, how to use some hooks before commit and others before push</h1>
<p>Some hooks can take a while to run, and I would like to run those before I push, but not before each particular commit (for example, pylint can be a bit slow).</p>
<p>I've seen the following:</p>
<ul>
<li><a href="https://github.com... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,981 | git | # With pre-commit, how to use some hooks before commit and others before push
Some hooks can take a while to run, and I would like to run those before I push, but not before each particular commit (for example, pylint can be a bit slow).
I've seen the following:
- [Question: Using hooks at different stages](https://... | your configuration is correct, except that the whitespace hooks in `pre-commit/pre-commit-hooks` [set `stages` themselves](https://github.com/pre-commit/pre-commit-hooks/blob/31d41ff29115a87808277ee0ec23999b17d5b583/.pre-commit-hooks.yaml#L127) so they won't be affected by `default_stages`
adjusting your configuration... |
54119399 | Expose port 80 on Digital Ocean's managed Kubernetes without a load balancer | 27 | 2019-01-09 22:35:09 | <p>I would like to expose my Kubernetes Managed Digital Ocean (single node) cluster's service on port 80 without the use of Digital Ocean's load balancer. Is this possible? How would I do this? </p>
<p>This is essentially a hobby project (I am beginning with Kubernetes) and just want to keep the cost very low. </p>
| 5,592 | 5,915,305 | 2020-12-06 22:10:42 | 55,968,709 | 41 | 2019-05-03 11:16:15 | 2,662 | 2020-12-06 22:10:42 | https://stackoverflow.com/q/54119399 | https://stackoverflow.com/a/55968709 | <p>You can deploy an Ingress configured to use the host network and port 80/443.</p>
<ol>
<li><p>DO's firewall for your cluster doesn't have 80/443 inbound open by default.</p>
<p>If you edit the auto-created firewall the rules <a href="https://www.digitalocean.com/community/questions/how-to-customize-firewall-rules-fo... | <p>You can deploy an Ingress configured to use the host network and port 80/443.</p> <ol> <li><p>DO's firewall for your cluster doesn't have 80/443 inbound open by default.</p> <p>If you edit the auto-created firewall the rules <a href="https://www.digitalocean.com/community/questions/how-to-customize-firewall-rules-fo... | 97102, 106338 | digital-ocean, kubernetes | <h1>Expose port 80 on Digital Ocean's managed Kubernetes without a load balancer</h1>
<p>I would like to expose my Kubernetes Managed Digital Ocean (single node) cluster's service on port 80 without the use of Digital Ocean's load balancer. Is this possible? How would I do this? </p>
<p>This is essentially a hobby pro... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,983 | git | # Expose port 80 on Digital Ocean's managed Kubernetes without a load balancer
I would like to expose my Kubernetes Managed Digital Ocean (single node) cluster's service on port 80 without the use of Digital Ocean's load balancer. Is this possible? How would I do this?
This is essentially a hobby project (I am beginn... | You can deploy an Ingress configured to use the host network and port 80/443.
1. DO's firewall for your cluster doesn't have 80/443 inbound open by default.
If you edit the auto-created firewall the rules [will eventually reset themselves](https://www.digitalocean.com/community/questions/how-to-customize-firewall-... |
23704241 | Git: how to use stash -p to stash specific files? | 26 | 2014-05-16 20:42:54 | <p>I'm trying to figure out how to stash two specific files among many uncommitted changes. </p>
<p>This very promising answer, <a href="https://stackoverflow.com/questions/3040833/how-to-stash-only-one-file-out-of-multiple-files-that-have-changed#17969785">Stash only one file out of multiple files that have changed ... | 17,400 | 263,900 | 2022-11-01 16:18:48 | 23,704,897 | 41 | 2014-05-16 21:33:52 | 432,696 | 2022-11-01 16:18:48 | https://stackoverflow.com/q/23704241 | https://stackoverflow.com/a/23704897 | <p>Use</p>
<pre><code>git stash --patch
</code></pre>
<p>git will then show a dialog like the following, for every hunk in your possible commit:</p>
<pre><code>diff --git files over files
index e69de29..ac4f3b3 100644
--- a/file.txt
+++ b/file.txt
@@ -0,0 +1 @@
+you did awesome stuff!
Stash this hunk [y,n,q,a,d,/,e,?]?... | <p>Use</p> <pre><code>git stash --patch </code></pre> <p>git will then show a dialog like the following, for every hunk in your possible commit:</p> <pre><code>diff --git files over files index e69de29..ac4f3b3 100644 --- a/file.txt +++ b/file.txt @@ -0,0 +1 @@ +you did awesome stuff! Stash this hunk [y,n,q,a,d,/,e,?]?... | 119, 13091 | git, git-stash | <h1>Git: how to use stash -p to stash specific files?</h1>
<p>I'm trying to figure out how to stash two specific files among many uncommitted changes. </p>
<p>This very promising answer, <a href="https://stackoverflow.com/questions/3040833/how-to-stash-only-one-file-out-of-multiple-files-that-have-changed#17969785">S... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,985 | git | # Git: how to use stash -p to stash specific files?
I'm trying to figure out how to stash two specific files among many uncommitted changes.
This very promising answer, [Stash only one file out of multiple files that have changed with Git?](https://stackoverflow.com/questions/3040833/how-to-stash-only-one-file-out-of... | Use
```
git stash --patch
```
git will then show a dialog like the following, for every hunk in your possible commit:
```
diff --git files over files
index e69de29..ac4f3b3 100644
--- a/file.txt
+++ b/file.txt
@@ -0,0 +1 @@
+you did awesome stuff!
Stash this hunk [y,n,q,a,d,/,e,?]?
```
A hunk is a coherent diff of ... |
9041156 | How to recover commit from 'detached head state'? | 26 | 2012-01-27 22:53:37 | <p>I checked out another branch with updates then made a few changes, switched back to the main git and now the changes disappeared! Can I get them back? the terminal was basically:</p>
<pre><code>$ git commit
[detached HEAD 7c09e17] Fixed some stuff
files changed, insertions(+), deletions(-)
$ git push master
fatal... | 13,163 | 778,234 | 2016-07-14 13:27:25 | 9,041,189 | 41 | 2012-01-27 22:57:24 | 47,773 | 2012-01-27 22:57:24 | https://stackoverflow.com/q/9041156 | https://stackoverflow.com/a/9041189 | <p>Assuming you're still on master:</p>
<pre><code>git merge 7c09e17
</code></pre>
<p>should be enough. <code>git</code> is usually good about telling you the commit IDs, if you watch the terminal.</p>
| <p>Assuming you're still on master:</p> <pre><code>git merge 7c09e17 </code></pre> <p>should be enough. <code>git</code> is usually good about telling you the commit IDs, if you watch the terminal.</p> | 119, 717 | git, merge | <h1>How to recover commit from 'detached head state'?</h1>
<p>I checked out another branch with updates then made a few changes, switched back to the main git and now the changes disappeared! Can I get them back? the terminal was basically:</p>
<pre><code>$ git commit
[detached HEAD 7c09e17] Fixed some stuff
files c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,986 | git | # How to recover commit from 'detached head state'?
I checked out another branch with updates then made a few changes, switched back to the main git and now the changes disappeared! Can I get them back? the terminal was basically:
```
$ git commit
[detached HEAD 7c09e17] Fixed some stuff
files changed, insertions(+... | Assuming you're still on master:
```
git merge 7c09e17
```
should be enough. `git` is usually good about telling you the commit IDs, if you watch the terminal. |
5360586 | How can I combine two non-sequential git commits into one? | 25 | 2011-03-19 06:34:45 | <p>If the following is a list of commits on a branch:</p>
<pre>A - B - C - D</pre>
<p>How can I combine commits A and C into (AC)?</p>
<pre>(AC) - B - D</pre>
| 5,012 | 18,091 | 2019-11-29 16:24:20 | 5,360,599 | 41 | 2011-03-19 06:37:18 | 65,977 | 2019-11-29 16:24:20 | https://stackoverflow.com/q/5360586 | https://stackoverflow.com/a/5360599 | <p>First do <code>git rebase -i aaaaaa^</code> and then your text editor will show up looking like this:</p>
<pre><code>pick aaaaaa
pick bbbbbb
pick cccccc
pick dddddd
</code></pre>
<p>Change it so that it looks like </p>
<pre><code>pick aaaaaa
squash cccccc
pick bbbbbb
pick dddddd
</code></pre>
<p>and close it and... | <p>First do <code>git rebase -i aaaaaa^</code> and then your text editor will show up looking like this:</p> <pre><code>pick aaaaaa pick bbbbbb pick cccccc pick dddddd </code></pre> <p>Change it so that it looks like </p> <pre><code>pick aaaaaa squash cccccc pick bbbbbb pick dddddd </code></pre> <p>and close it and... | 119 | git | <h1>How can I combine two non-sequential git commits into one?</h1>
<p>If the following is a list of commits on a branch:</p>
<pre>A - B - C - D</pre>
<p>How can I combine commits A and C into (AC)?</p>
<pre>(AC) - B - D</pre>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,988 | git | # How can I combine two non-sequential git commits into one?
If the following is a list of commits on a branch:
```
A - B - C - D
```
How can I combine commits A and C into (AC)?
```
(AC) - B - D
``` | First do `git rebase -i aaaaaa^` and then your text editor will show up looking like this:
```
pick aaaaaa
pick bbbbbb
pick cccccc
pick dddddd
```
Change it so that it looks like
```
pick aaaaaa
squash cccccc
pick bbbbbb
pick dddddd
```
and close it and git does the rest.
<http://git-scm.com/docs/git-rebase> |
1573883 | How to commit a directory into a git repository? | 25 | 2009-10-15 17:27:24 | <p>I read the great <a href="https://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide">git tutorial</a> here, I'm unable to create directories. </p>
<p>My folder structure is:</p>
<p>Code
- Python
- C++
- F#
- ...</p>
<p>From within a initialised local repository "Code"... | 86,610 | 59,300 | 2021-04-21 16:54:03 | 1,573,906 | 41 | 2009-10-15 17:31:26 | 1,431 | 2009-10-15 17:31:26 | https://stackoverflow.com/q/1573883 | https://stackoverflow.com/a/1573906 | <p>Try to add some files to directories first. You can add some dummy file to directory, and remove that file when you have added the actual content for the directory.</p>
<p>Git does not track empty directories, it tracks files and their contents.</p>
<pre><code>git init
mkdir foo
touch foo/dummy_empty_file
git add... | <p>Try to add some files to directories first. You can add some dummy file to directory, and remove that file when you have added the actual content for the directory.</p> <p>Git does not track empty directories, it tracks files and their contents.</p> <pre><code>git init mkdir foo touch foo/dummy_empty_file git add... | 119 | git | <h1>How to commit a directory into a git repository?</h1>
<p>I read the great <a href="https://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide">git tutorial</a> here, I'm unable to create directories. </p>
<p>My folder structure is:</p>
<p>Code
- Python
- C++
- F#
- ...... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,989 | git | # How to commit a directory into a git repository?
I read the great [git tutorial](https://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide) here, I'm unable to create directories.
My folder structure is:
Code
- Python
- C++
- F#
- ...
From within a initialised local repository "C... | Try to add some files to directories first. You can add some dummy file to directory, and remove that file when you have added the actual content for the directory.
Git does not track empty directories, it tracks files and their contents.
```
git init
mkdir foo
touch foo/dummy_empty_file
git add foo
git add foo/dumm... |
1178553 | How can I move a set of commits from master to a separate branch? | 25 | 2009-07-24 15:52:16 | <p>I have a series of commits (20+) that pertain to a particular feature that I am trying to remove from our master branch and into a separate branch.</p>
<p>I have a tag (<code>rel_2009_07_18</code>) on the commit that represents our latest stable release, so when on master, git log <code>rel_2009_07_18</code>..HEAD ... | 7,590 | 114,386 | 2014-01-09 20:41:12 | 1,179,615 | 41 | 2009-07-24 19:16:21 | 46,058 | 2009-07-24 19:16:21 | https://stackoverflow.com/q/1178553 | https://stackoverflow.com/a/1179615 | <p>You write that you want to <strong>remove</strong> commits from 'master' branch. This might cause problems if 'master' branch was published (well, commits after <code>rel_2009_07_18</code> are published), and somebody based their work on your 'master'. But perhaps it is not a problem in your case.</p>
<p>Both sol... | <p>You write that you want to <strong>remove</strong> commits from 'master' branch. This might cause problems if 'master' branch was published (well, commits after <code>rel_2009_07_18</code> are published), and somebody based their work on your 'master'. But perhaps it is not a problem in your case.</p> <p>Both sol... | 119 | git | <h1>How can I move a set of commits from master to a separate branch?</h1>
<p>I have a series of commits (20+) that pertain to a particular feature that I am trying to remove from our master branch and into a separate branch.</p>
<p>I have a tag (<code>rel_2009_07_18</code>) on the commit that represents our latest st... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,990 | git | # How can I move a set of commits from master to a separate branch?
I have a series of commits (20+) that pertain to a particular feature that I am trying to remove from our master branch and into a separate branch.
I have a tag (`rel_2009_07_18`) on the commit that represents our latest stable release, so when on ma... | You write that you want to **remove** commits from 'master' branch. This might cause problems if 'master' branch was published (well, commits after `rel_2009_07_18` are published), and somebody based their work on your 'master'. But perhaps it is not a problem in your case.
Both solutions below assume that you don't h... |
33933702 | GIT checkout except one folder | 24 | 2015-11-26 08:25:57 | <p>I want to checkout to other branch, or previous commit, but I want to keep one folder the same files (not checkout the folder).</p>
<p>I want that the folder, will be shown in <code>git status</code>, so I can add this folder now to the index.</p>
<p>For example, I have a folder with <code>node_modules</code>. I w... | 20,880 | 1,229,624 | 2022-10-14 21:25:29 | 33,934,496 | 41 | 2015-11-26 09:12:34 | 26,396 | 2017-10-20 14:55:26 | https://stackoverflow.com/q/33933702 | https://stackoverflow.com/a/33934496 | <p>You could use <a href="http://git-scm.com/docs/git-read-tree#_sparse_checkout" rel="noreferrer">sparse checkout</a> to exclude the committed contents of the <code>node_modules</code> directory from the working tree. As the documentation says:</p>
<blockquote>
<p>"Sparse checkout" allows populating the working dir... | <p>You could use <a href="http://git-scm.com/docs/git-read-tree#_sparse_checkout" rel="noreferrer">sparse checkout</a> to exclude the committed contents of the <code>node_modules</code> directory from the working tree. As the documentation says:</p> <blockquote> <p>"Sparse checkout" allows populating the working dir... | 119, 37230 | git, git-checkout | <h1>GIT checkout except one folder</h1>
<p>I want to checkout to other branch, or previous commit, but I want to keep one folder the same files (not checkout the folder).</p>
<p>I want that the folder, will be shown in <code>git status</code>, so I can add this folder now to the index.</p>
<p>For example, I have a fo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,992 | git | # GIT checkout except one folder
I want to checkout to other branch, or previous commit, but I want to keep one folder the same files (not checkout the folder).
I want that the folder, will be shown in `git status`, so I can add this folder now to the index.
For example, I have a folder with `node_modules`. I want t... | You could use [sparse checkout](http://git-scm.com/docs/git-read-tree#_sparse_checkout) to exclude the committed contents of the `node_modules` directory from the working tree. As the documentation says:
> "Sparse checkout" allows populating the working directory sparsely. It uses the `skip-worktree` bit to tell Git w... |
33221873 | How do I list all files with a specific extension in my git repository? | 23 | 2015-10-19 18:58:54 | <p>My git repository tracks many kinds of files, such as Ruby files, YAML files, and Markdown files. I want a list of all Ruby files in my repo, but I can't use <code>find -type f -name '*.rb'</code> because I also have a build directory that is not tracked by git but contains lots of ruby files. How can I list only t... | 15,164 | 1,824,868 | 2025-01-30 23:49:55 | 33,221,895 | 41 | 2015-10-19 19:00:25 | 1,824,868 | 2015-10-19 22:19:47 | https://stackoverflow.com/q/33221873 | https://stackoverflow.com/a/33221895 | <p>Try the following command:</p>
<pre><code>git ls-files '*.rb'
</code></pre>
| <p>Try the following command:</p> <pre><code>git ls-files '*.rb' </code></pre> | 119 | git | <h1>How do I list all files with a specific extension in my git repository?</h1>
<p>My git repository tracks many kinds of files, such as Ruby files, YAML files, and Markdown files. I want a list of all Ruby files in my repo, but I can't use <code>find -type f -name '*.rb'</code> because I also have a build directory ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,993 | git | # How do I list all files with a specific extension in my git repository?
My git repository tracks many kinds of files, such as Ruby files, YAML files, and Markdown files. I want a list of all Ruby files in my repo, but I can't use `find -type f -name '*.rb'` because I also have a build directory that is not tracked b... | Try the following command:
```
git ls-files '*.rb'
``` |
17152833 | Git stash: How to see if there are stashed changes in a branch | 23 | 2013-06-17 16:55:22 | <p>Let's say i'm in a branch off of master, called "my_new_stuff". I have a feeling i might have stashed something in there. I'm worried that if I do <code>git stash pop</code> and i <em>didn't</em> stash anything it's going to shove a load of unwanted crap into my working folder.</p>
<p>Can i see if there are stash... | 11,025 | 138,557 | 2020-01-07 10:59:16 | 17,152,993 | 41 | 2013-06-17 17:05:54 | 1,727,593 | 2013-06-17 17:05:54 | https://stackoverflow.com/q/17152833 | https://stackoverflow.com/a/17152993 | <p>The stash stores snapshots in the same way that commits do. You can see the contents of the stash with</p>
<pre><code>git stash list
</code></pre>
<p>You can reference those snapshots with the <code>stash@{N}</code> notation or use the hashes shown. You can use any of Git's commands that work on commits on stashes... | <p>The stash stores snapshots in the same way that commits do. You can see the contents of the stash with</p> <pre><code>git stash list </code></pre> <p>You can reference those snapshots with the <code>stash@{N}</code> notation or use the hashes shown. You can use any of Git's commands that work on commits on stashes... | 119, 13091 | git, git-stash | <h1>Git stash: How to see if there are stashed changes in a branch</h1>
<p>Let's say i'm in a branch off of master, called "my_new_stuff". I have a feeling i might have stashed something in there. I'm worried that if I do <code>git stash pop</code> and i <em>didn't</em> stash anything it's going to shove a load of un... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,994 | git | # Git stash: How to see if there are stashed changes in a branch
Let's say i'm in a branch off of master, called "my_new_stuff". I have a feeling i might have stashed something in there. I'm worried that if I do `git stash pop` and i *didn't* stash anything it's going to shove a load of unwanted crap into my working f... | The stash stores snapshots in the same way that commits do. You can see the contents of the stash with
```
git stash list
```
You can reference those snapshots with the `stash@{N}` notation or use the hashes shown. You can use any of Git's commands that work on commits on stashes. For example
```
git diff master sta... |
56804649 | How to rebase branch against master after parent is squashed and committed? | 22 | 2019-06-28 09:48:56 | <p>I use an optimistic work-flow in Gitlab, which assumes the majority of my merge requests will be accepted without change. The flow looks like this:</p>
<ol>
<li>Submit a merge request for branch <code>cool-feature-A</code></li>
<li>Create a new branch, based on <code>cool-feature-A</code>, called <code>cool-feature... | 8,503 | 474,189 | 2019-07-05 10:21:22 | 56,810,435 | 41 | 2019-06-28 16:36:35 | 1,256,452 | 2019-06-28 16:36:35 | https://stackoverflow.com/q/56804649 | https://stackoverflow.com/a/56810435 | <p>Essentially, <em>you</em> have to tell Git: <em>I want to rebase <code>cool-feature-B</code> against <code>master</code>, but I want to copy a different set of commits than the ones you'd normally compute here.</em> The easiest way to do this is going to be to use <code>--onto</code>. That is, normally you run, a... | <p>Essentially, <em>you</em> have to tell Git: <em>I want to rebase <code>cool-feature-B</code> against <code>master</code>, but I want to copy a different set of commits than the ones you'd normally compute here.</em> The easiest way to do this is going to be to use <code>--onto</code>. That is, normally you run, a... | 119, 28897, 42532, 98455 | git, git-merge, git-squash, squash | <h1>How to rebase branch against master after parent is squashed and committed?</h1>
<p>I use an optimistic work-flow in Gitlab, which assumes the majority of my merge requests will be accepted without change. The flow looks like this:</p>
<ol>
<li>Submit a merge request for branch <code>cool-feature-A</code></li>
<li... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,996 | git | # How to rebase branch against master after parent is squashed and committed?
I use an optimistic work-flow in Gitlab, which assumes the majority of my merge requests will be accepted without change. The flow looks like this:
1. Submit a merge request for branch `cool-feature-A`
2. Create a new branch, based on `cool... | Essentially, *you* have to tell Git: *I want to rebase `cool-feature-B` against `master`, but I want to copy a different set of commits than the ones you'd normally compute here.* The easiest way to do this is going to be to use `--onto`. That is, normally you run, as you said:
```
git checkout cool-feature-B
git reba... |
42210712 | Merging a feature branch that is based off another feature branch | 21 | 2017-02-13 18:11:18 | <p>A few days ago I had a <code>master</code> branch with a completely linear history. Then I created a feature branch, which we'll call <code>feat/feature-a</code>. I worked on that branch, then submitted it for code review to be merged into <code>master</code>.</p>
<p>While <code>feat/feature-a</code> was being revi... | 14,956 | 5,596,894 | 2017-02-13 18:51:08 | 42,211,017 | 41 | 2017-02-13 18:30:44 | 1,256,452 | 2017-02-13 18:51:08 | https://stackoverflow.com/q/42210712 | https://stackoverflow.com/a/42211017 | <h3>Summary: use <code>git rebase --onto <target> <limit></code></h3>
<p>As <a href="https://stackoverflow.com/questions/42210712/merging-a-feature-branch-that-is-based-off-another-feature-branch#comment71582610_42210712">Useless suggested in a comment</a>, if you had a real merge, this should not happen. ... | <h3>Summary: use <code>git rebase --onto <target> <limit></code></h3> <p>As <a href="https://stackoverflow.com/questions/42210712/merging-a-feature-branch-that-is-based-off-another-feature-branch#comment71582610_42210712">Useless suggested in a comment</a>, if you had a real merge, this should not happen. ... | 119, 456, 717, 62599 | git, merge, merge-conflict-resolution, version-control | <h1>Merging a feature branch that is based off another feature branch</h1>
<p>A few days ago I had a <code>master</code> branch with a completely linear history. Then I created a feature branch, which we'll call <code>feat/feature-a</code>. I worked on that branch, then submitted it for code review to be merged into <c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,999 | git | # Merging a feature branch that is based off another feature branch
A few days ago I had a `master` branch with a completely linear history. Then I created a feature branch, which we'll call `feat/feature-a`. I worked on that branch, then submitted it for code review to be merged into `master`.
While `feat/feature-a`... | ### Summary: use `git rebase --onto <target> <limit>`
As [Useless suggested in a comment](https://stackoverflow.com/questions/42210712/merging-a-feature-branch-that-is-based-off-another-feature-branch#comment71582610_42210712), if you had a real merge, this should not happen. Here's what I mean by a "real merge", alon... |
13454764 | How to chmod 0777 a file and commit as is to Git on Windows? | 21 | 2012-11-19 13:26:58 | <p>I'm working on Windows and on the production there's a Linux system and I'd like to chmod some files to 0777, but I don't know how to do it on Windows. I rather not do it on production, because I'm unable to commit/push there.</p>
<p>Is there a way to chmod 0777 a file on Windows and commit it to Git so that it sta... | 8,223 | 283,055 | 2012-11-19 14:25:12 | 13,454,969 | 41 | 2012-11-19 13:37:44 | 928,769 | 2012-11-19 13:37:44 | https://stackoverflow.com/q/13454764 | https://stackoverflow.com/a/13454969 | <p>If you want to mark the file as executable, you can use</p>
<pre><code>git update-index --chmod=+x <your_file>
</code></pre>
<p>If you really want to have the file writable for everyone, you would have to set up a <code>post-update</code> hook on the linux system, because git does not track file permissions,... | <p>If you want to mark the file as executable, you can use</p> <pre><code>git update-index --chmod=+x <your_file> </code></pre> <p>If you really want to have the file writable for everyone, you would have to set up a <code>post-update</code> hook on the linux system, because git does not track file permissions,... | 58, 64, 99, 119 | filesystems, git, linux, windows | <h1>How to chmod 0777 a file and commit as is to Git on Windows?</h1>
<p>I'm working on Windows and on the production there's a Linux system and I'd like to chmod some files to 0777, but I don't know how to do it on Windows. I rather not do it on production, because I'm unable to commit/push there.</p>
<p>Is there a w... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,002 | git | # How to chmod 0777 a file and commit as is to Git on Windows?
I'm working on Windows and on the production there's a Linux system and I'd like to chmod some files to 0777, but I don't know how to do it on Windows. I rather not do it on production, because I'm unable to commit/push there.
Is there a way to chmod 0777... | If you want to mark the file as executable, you can use
```
git update-index --chmod=+x <your_file>
```
If you really want to have the file writable for everyone, you would have to set up a `post-update` hook on the linux system, because git does not track file permissions, only the executable bit. |
46334725 | Git LFS - how to track multiple file types with one command | 20 | 2017-09-21 02:58:16 | <p>I see this command listed on the Git LFS website and documentation:</p>
<pre><code>git lfs track "*.psd"
</code></pre>
<p>I have several file types in my project that I want to track with LFS, and will want to track all these same file types in future projects. I would like to be able to paste a single command to ... | 15,517 | 6,373,873 | 2018-05-13 21:46:42 | 46,334,726 | 41 | 2017-09-21 02:58:16 | 6,373,873 | 2017-09-21 02:58:16 | https://stackoverflow.com/q/46334725 | https://stackoverflow.com/a/46334726 | <p>After some experimentation I found this was doable by providing multiple arguments:</p>
<pre><code>git lfs track "*.jpg" "*.png"
</code></pre>
<p>This will track both jpg files and png files</p>
| <p>After some experimentation I found this was doable by providing multiple arguments:</p> <pre><code>git lfs track "*.jpg" "*.png" </code></pre> <p>This will track both jpg files and png files</p> | 119, 115244 | git, git-lfs | <h1>Git LFS - how to track multiple file types with one command</h1>
<p>I see this command listed on the Git LFS website and documentation:</p>
<pre><code>git lfs track "*.psd"
</code></pre>
<p>I have several file types in my project that I want to track with LFS, and will want to track all these same file types in f... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,003 | git | # Git LFS - how to track multiple file types with one command
I see this command listed on the Git LFS website and documentation:
```
git lfs track "*.psd"
```
I have several file types in my project that I want to track with LFS, and will want to track all these same file types in future projects. I would like to b... | After some experimentation I found this was doable by providing multiple arguments:
```
git lfs track "*.jpg" "*.png"
```
This will track both jpg files and png files |
45155486 | git fast-forward one commit | 19 | 2017-07-18 00:14:03 | <pre><code>* 9dbd857 (hotfix-correct-java-jdk-path, feature/add-ansible-galaxy-requirements-file) requirements.yml: adds maven and nodejs requirements
* 1643619 (QOL-1640-enable-vpc-peering) roles/ansible-linux-commons: change value of hostname in cloud-init
* b5fd2a4 roles/bamboo-agent: add bitbucket ssh host key to /... | 10,641 | 336,600 | 2020-11-25 15:59:51 | 45,155,568 | 41 | 2017-07-18 00:24:54 | 1,256,452 | 2020-11-25 15:59:51 | https://stackoverflow.com/q/45155486 | https://stackoverflow.com/a/45155568 | <p>You can <code>git reset</code> to it, but for general safety and cleanness, I prefer to use <code>git merge --ff-only</code>. To use it, check out the branch you want fast-forwarded (you have already), then run <code>git merge --ff-only <commit-hash></code>:</p>
<pre><code>git merge --ff-only 9aeb07e
</code><... | <p>You can <code>git reset</code> to it, but for general safety and cleanness, I prefer to use <code>git merge --ff-only</code>. To use it, check out the branch you want fast-forwarded (you have already), then run <code>git merge --ff-only <commit-hash></code>:</p> <pre><code>git merge --ff-only 9aeb07e </code><... | 119, 52842 | fast-forward, git | <h1>git fast-forward one commit</h1>
<pre><code>* 9dbd857 (hotfix-correct-java-jdk-path, feature/add-ansible-galaxy-requirements-file) requirements.yml: adds maven and nodejs requirements
* 1643619 (QOL-1640-enable-vpc-peering) roles/ansible-linux-commons: change value of hostname in cloud-init
* b5fd2a4 roles/bamboo-a... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,008 | git | # git fast-forward one commit
```
* 9dbd857 (hotfix-correct-java-jdk-path, feature/add-ansible-galaxy-requirements-file) requirements.yml: adds maven and nodejs requirements
* 1643619 (QOL-1640-enable-vpc-peering) roles/ansible-linux-commons: change value of hostname in cloud-init
* b5fd2a4 roles/bamboo-agent: add bit... | You can `git reset` to it, but for general safety and cleanness, I prefer to use `git merge --ff-only`. To use it, check out the branch you want fast-forwarded (you have already), then run `git merge --ff-only <commit-hash>`:
```
git merge --ff-only 9aeb07e
```
I use this command so often that I made an alias for it,... |
16423226 | NPM install : Git URL dependency error in package.json | 19 | 2013-05-07 15:43:53 | <p>I want to set a dependency that is a Git URL of a private package in package.json I write :</p>
<pre><code>"dependencies" : {
"mymodule" : "git://git@git.myrepo.com:/myproject#mybranch"
}
</code></pre>
<p>When running <code>npm install</code> I get this error :</p>
<pre><code>git clone git://git@git.myrepo.c... | 14,827 | 2,359,018 | 2014-10-20 14:24:32 | 16,423,739 | 41 | 2013-05-07 16:10:05 | 1,899,276 | 2013-05-07 16:10:05 | https://stackoverflow.com/q/16423226 | https://stackoverflow.com/a/16423739 | <p>The valid forms are below. If you are using username@, you need to specify either ssh or https. Also, I am not sure the :/ is valid if you are not using an account. </p>
<pre><code>git://github.com/user/project.git#commit-ish
git+ssh://user@hostname:project.git#commit-ish
git+ssh://user@hostname/project.git#commi... | <p>The valid forms are below. If you are using username@, you need to specify either ssh or https. Also, I am not sure the :/ is valid if you are not using an account. </p> <pre><code>git://github.com/user/project.git#commit-ish git+ssh://user@hostname:project.git#commit-ish git+ssh://user@hostname/project.git#commi... | 119, 46426, 61387 | git, node.js, npm | <h1>NPM install : Git URL dependency error in package.json</h1>
<p>I want to set a dependency that is a Git URL of a private package in package.json I write :</p>
<pre><code>"dependencies" : {
"mymodule" : "git://git@git.myrepo.com:/myproject#mybranch"
}
</code></pre>
<p>When running <code>npm install</code> I g... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,009 | git | # NPM install : Git URL dependency error in package.json
I want to set a dependency that is a Git URL of a private package in package.json I write :
```
"dependencies" : {
"mymodule" : "git://git@git.myrepo.com:/myproject#mybranch"
}
```
When running `npm install` I get this error :
```
git clone git://git@git... | The valid forms are below. If you are using username@, you need to specify either ssh or https. Also, I am not sure the :/ is valid if you are not using an account.
```
git://github.com/user/project.git#commit-ish
git+ssh://user@hostname:project.git#commit-ish
git+ssh://user@hostname/project.git#commit-ish
git+http://... |
4559654 | C/Objective-C read and get last digit of integer? | 17 | 2010-12-30 02:50:26 | <p>How can i get the last digit of an integer (or NSInteger) outputted to integer?</p>
<p>example:</p>
<pre><code>int time = CFAbsoluteGetCurrent();
int lastDigit;
</code></pre>
| 14,053 | 546,476 | 2010-12-30 02:55:03 | 4,559,678 | 41 | 2010-12-30 02:55:03 | 168,225 | 2010-12-30 02:55:03 | https://stackoverflow.com/q/4559654 | https://stackoverflow.com/a/4559678 | <p>Use <a href="http://en.wikipedia.org/wiki/Modulo_operation" rel="noreferrer">modulo</a>:</p>
<pre><code>int lastDigit = time % 10;
</code></pre>
| <p>Use <a href="http://en.wikipedia.org/wiki/Modulo_operation" rel="noreferrer">modulo</a>:</p> <pre><code>int lastDigit = time % 10; </code></pre> | 8, 2054, 7003, 31119, 48894 | c, digit, integer, nsinteger, objective-c | <h1>C/Objective-C read and get last digit of integer?</h1>
<p>How can i get the last digit of an integer (or NSInteger) outputted to integer?</p>
<p>example:</p>
<pre><code>int time = CFAbsoluteGetCurrent();
int lastDigit;
</code></pre>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,013 | git | # C/Objective-C read and get last digit of integer?
How can i get the last digit of an integer (or NSInteger) outputted to integer?
example:
```
int time = CFAbsoluteGetCurrent();
int lastDigit;
``` | Use [modulo](http://en.wikipedia.org/wiki/Modulo_operation):
```
int lastDigit = time % 10;
``` |
52231262 | How to push a new branch in git? | 14 | 2018-09-08 01:38:59 | <p>Checked out master branch, made changes. How now to create a new branch, commit changes, and push it to the remote?</p>
| 28,330 | 1,973,207 | 2019-12-21 06:25:58 | 52,231,345 | 41 | 2018-09-08 01:58:37 | 525,179 | 2018-09-08 01:58:37 | https://stackoverflow.com/q/52231262 | https://stackoverflow.com/a/52231345 | <p>Four steps to get your changes committed locally and get them pushed to your server:</p>
<p><strong>Create a local branch and commit to it</strong></p>
<pre><code>git checkout -b your-shiny-branch
git add .
git commit -m "Your Message"
</code></pre>
<p><strong>Push your branch to your remote (server)</strong></p>... | <p>Four steps to get your changes committed locally and get them pushed to your server:</p> <p><strong>Create a local branch and commit to it</strong></p> <pre><code>git checkout -b your-shiny-branch git add . git commit -m "Your Message" </code></pre> <p><strong>Push your branch to your remote (server)</strong></p>... | 119, 391 | git, terminal | <h1>How to push a new branch in git?</h1>
<p>Checked out master branch, made changes. How now to create a new branch, commit changes, and push it to the remote?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,015 | git | # How to push a new branch in git?
Checked out master branch, made changes. How now to create a new branch, commit changes, and push it to the remote? | Four steps to get your changes committed locally and get them pushed to your server:
**Create a local branch and commit to it**
```
git checkout -b your-shiny-branch
git add .
git commit -m "Your Message"
```
**Push your branch to your remote (server)**
```
git push -u origin your-shiny-branch
```
If you then need... |
9427251 | How to restart git repo? | 12 | 2012-02-24 07:54:08 | <p>I've fetched a repo from one of my old projects and I've edited the files so I can use this as a 'skeleton' for new projects. Say I'm here:</p>
<p>/skeleton/framework</p>
<p>I already have the repo there, edited. How would I go about restarting this repo with those files in that directory? What <em>should</em> I h... | 29,943 | null | 2013-07-11 21:01:59 | 9,427,279 | 41 | 2012-02-24 07:57:19 | 907,986 | 2012-02-24 07:57:19 | https://stackoverflow.com/q/9427251 | https://stackoverflow.com/a/9427279 | <p>If you just want to keep your current working tree, and lose all git history etc. you can do</p>
<pre><code>rm -rf .git
git init .
</code></pre>
| <p>If you just want to keep your current working tree, and lose all git history etc. you can do</p> <pre><code>rm -rf .git git init . </code></pre> | 119, 456 | git, version-control | <h1>How to restart git repo?</h1>
<p>I've fetched a repo from one of my old projects and I've edited the files so I can use this as a 'skeleton' for new projects. Say I'm here:</p>
<p>/skeleton/framework</p>
<p>I already have the repo there, edited. How would I go about restarting this repo with those files in that d... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,016 | git | # How to restart git repo?
I've fetched a repo from one of my old projects and I've edited the files so I can use this as a 'skeleton' for new projects. Say I'm here:
/skeleton/framework
I already have the repo there, edited. How would I go about restarting this repo with those files in that directory? What *should*... | If you just want to keep your current working tree, and lose all git history etc. you can do
```
rm -rf .git
git init .
``` |
34926253 | Rebase only part of a branch | 103 | 2016-01-21 14:20:40 | <p>I've got two branches (and master). Branch 2 is based on Branch 1 is based on master. I've submitted Branch 1 for review, it had some changes, I rebased some of those changes into history and merged the result into master. </p>
<p>Now I need to rebase Branch 2 on top of master to prepare it for review/merge.</p>
<... | 32,933 | 298,661 | 2025-10-10 21:03:29 | 34,926,593 | 40 | 2016-01-21 14:36:16 | 298,661 | 2016-01-23 18:18:21 | https://stackoverflow.com/q/34926253 | https://stackoverflow.com/a/34926593 | <p>The solution is considerably simpler than I expected. It turns out that you can supply <code>-i</code> to a much larger variety of rebase commands (I thought it was only for rebasing a branch to itself for changing history). So I simply ran <code>git rebase -i master</code> and dropped those extra commits.</p>
| <p>The solution is considerably simpler than I expected. It turns out that you can supply <code>-i</code> to a much larger variety of rebase commands (I thought it was only for rebasing a branch to itself for changing history). So I simply ran <code>git rebase -i master</code> and dropped those extra commits.</p> | 119 | git | <h1>Rebase only part of a branch</h1>
<p>I've got two branches (and master). Branch 2 is based on Branch 1 is based on master. I've submitted Branch 1 for review, it had some changes, I rebased some of those changes into history and merged the result into master. </p>
<p>Now I need to rebase Branch 2 on top of master ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,017 | git | # Rebase only part of a branch
I've got two branches (and master). Branch 2 is based on Branch 1 is based on master. I've submitted Branch 1 for review, it had some changes, I rebased some of those changes into history and merged the result into master.
Now I need to rebase Branch 2 on top of master to prepare it for... | The solution is considerably simpler than I expected. It turns out that you can supply `-i` to a much larger variety of rebase commands (I thought it was only for rebasing a branch to itself for changing history). So I simply ran `git rebase -i master` and dropped those extra commits. |
8334974 | Git repo inside repo | 62 | 2011-12-01 00:16:29 | <p>I want to clone <a href="https://github.com/getyouridx/pychargify" rel="noreferrer">https://github.com/getyouridx/pychargify</a> into my django project, and will need to pull updates from time-to-time.</p>
<p>Just for clarification, could I simply write a gitignore from the root directory of the django project e.g.... | 97,321 | null | 2023-12-27 17:22:24 | 8,334,995 | 40 | 2011-12-01 00:19:37 | 211,563 | 2015-01-31 14:15:34 | https://stackoverflow.com/q/8334974 | https://stackoverflow.com/a/8334995 | <p>Git has a feature for having a repository within another: <a href="http://git-scm.com/book/en/v2/Git-Tools-Submodules">submodules</a>.</p>
<pre><code>git submodule add https://github.com/getyouridx/pychargify.git
</code></pre>
<p>Be sure to read the entire documentation on submodules, as there as a few quirks invo... | <p>Git has a feature for having a repository within another: <a href="http://git-scm.com/book/en/v2/Git-Tools-Submodules">submodules</a>.</p> <pre><code>git submodule add https://github.com/getyouridx/pychargify.git </code></pre> <p>Be sure to read the entire documentation on submodules, as there as a few quirks invo... | 119, 41612 | git, git-submodules | <h1>Git repo inside repo</h1>
<p>I want to clone <a href="https://github.com/getyouridx/pychargify" rel="noreferrer">https://github.com/getyouridx/pychargify</a> into my django project, and will need to pull updates from time-to-time.</p>
<p>Just for clarification, could I simply write a gitignore from the root direct... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,019 | git | # Git repo inside repo
I want to clone <https://github.com/getyouridx/pychargify> into my django project, and will need to pull updates from time-to-time.
Just for clarification, could I simply write a gitignore from the root directory of the django project e.g. `.gitignore: pychargify/.git` or are there other pitfal... | Git has a feature for having a repository within another: [submodules](http://git-scm.com/book/en/v2/Git-Tools-Submodules).
```
git submodule add https://github.com/getyouridx/pychargify.git
```
Be sure to read the entire documentation on submodules, as there as a few quirks involved with using them, and additional s... |
38769976 | Is it possible to Git merge / push using Jenkins pipeline | 59 | 2016-08-04 14:18:13 | <p>I am trying to create a Jenkins workflow using a Jenkinsfile. All I want it to do is monitor the 'develop' branch for changes. When a change occurs, I want it to git tag and merge to master. I am using the GitSCM Step but the only thing that it appears to support is git clone. I don't want to have to shell out to do... | 168,253 | 183,223 | 2021-10-26 18:12:03 | 38,784,011 | 40 | 2016-08-05 07:54:09 | 702,954 | 2016-08-05 07:54:09 | https://stackoverflow.com/q/38769976 | https://stackoverflow.com/a/38784011 | <p>It is not possible at the moment because <code>GitPublisher</code> plugin, the plugin previously responsible for tagging/merging/pushing in freestyle jobs, has not been updated to be compatible with Jenkins pipelines. You can follow that issue on both the <a href="https://github.com/jenkinsci/pipeline-plugin/blob/ma... | <p>It is not possible at the moment because <code>GitPublisher</code> plugin, the plugin previously responsible for tagging/merging/pushing in freestyle jobs, has not been updated to be compatible with Jenkins pipelines. You can follow that issue on both the <a href="https://github.com/jenkinsci/pipeline-plugin/blob/ma... | 119, 849, 8337, 64999 | bitbucket, git, groovy, jenkins | <h1>Is it possible to Git merge / push using Jenkins pipeline</h1>
<p>I am trying to create a Jenkins workflow using a Jenkinsfile. All I want it to do is monitor the 'develop' branch for changes. When a change occurs, I want it to git tag and merge to master. I am using the GitSCM Step but the only thing that it appea... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,020 | git | # Is it possible to Git merge / push using Jenkins pipeline
I am trying to create a Jenkins workflow using a Jenkinsfile. All I want it to do is monitor the 'develop' branch for changes. When a change occurs, I want it to git tag and merge to master. I am using the GitSCM Step but the only thing that it appears to sup... | It is not possible at the moment because `GitPublisher` plugin, the plugin previously responsible for tagging/merging/pushing in freestyle jobs, has not been updated to be compatible with Jenkins pipelines. You can follow that issue on both the [pipeline plugins compatibility page](https://github.com/jenkinsci/pipeline... |
43362014 | Heroku: "No default language could be detected for this app" error thrown for node app | 51 | 2017-04-12 06:34:09 | <p>I am learning NodeJS and the course I'm following has several projects, arranged by sections. I have all the projects under one main folder, which is also a <a href="https://github.com/Manish-Giri/Complete-NodeJS-Developer-Course" rel="noreferrer">git repository</a>.</p>
<p>Each of these subfolders in the main fold... | 149,480 | 2,981,518 | 2023-05-09 11:48:46 | 43,363,309 | 40 | 2017-04-12 07:41:19 | 122,080 | 2017-04-12 07:41:19 | https://stackoverflow.com/q/43362014 | https://stackoverflow.com/a/43363309 | <p>Heroku has a set of default buildpacks, used when it needs to detect the language of your app.<br>
In order to do that detection, it runs the <code>bin/detect</code> command of each of those default buildpacks, until one of them returns a 0 exit code.</p>
<p><a href="https://github.com/heroku/heroku-buildpack-nodej... | <p>Heroku has a set of default buildpacks, used when it needs to detect the language of your app.<br> In order to do that detection, it runs the <code>bin/detect</code> command of each of those default buildpacks, until one of them returns a 0 exit code.</p> <p><a href="https://github.com/heroku/heroku-buildpack-nodej... | 3, 119, 8279, 46426 | git, heroku, javascript, node.js | <h1>Heroku: "No default language could be detected for this app" error thrown for node app</h1>
<p>I am learning NodeJS and the course I'm following has several projects, arranged by sections. I have all the projects under one main folder, which is also a <a href="https://github.com/Manish-Giri/Complete-NodeJS-Develope... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,023 | git | # Heroku: "No default language could be detected for this app" error thrown for node app
I am learning NodeJS and the course I'm following has several projects, arranged by sections. I have all the projects under one main folder, which is also a [git repository](https://github.com/Manish-Giri/Complete-NodeJS-Developer... | Heroku has a set of default buildpacks, used when it needs to detect the language of your app.
In order to do that detection, it runs the `bin/detect` command of each of those default buildpacks, until one of them returns a 0 exit code.
[This is the command for the node buildpack](https://github.com/heroku/heroku-bu... |
3509419 | git diff with author filter | 50 | 2010-08-18 06:15:51 | <p>I have a series of commits by different authors and I would like to see a <code>git dff</code> output between 2 commits but only considering the commits by one of the authors, something like, something like --author in git log.</p>
<p>I am interested in the final summary diff and not the diffs of the individual com... | 31,003 | 171,428 | 2024-11-18 21:50:24 | 3,512,492 | 40 | 2010-08-18 13:20:05 | 119,963 | 2020-10-27 13:48:29 | https://stackoverflow.com/q/3509419 | https://stackoverflow.com/a/3512492 | <p>The problem here is that you can't do this in the general case. Suppose Alice changes a particular file, then Bob changes it - including parts that Alice changed - and finally Alice changes it again. How do you combine Alice's two diffs into a single diff? If you take them as two patches, the second simply won't app... | <p>The problem here is that you can't do this in the general case. Suppose Alice changes a particular file, then Bob changes it - including parts that Alice changed - and finally Alice changes it again. How do you combine Alice's two diffs into a single diff? If you take them as two patches, the second simply won't app... | 119, 9033 | git, git-diff | <h1>git diff with author filter</h1>
<p>I have a series of commits by different authors and I would like to see a <code>git dff</code> output between 2 commits but only considering the commits by one of the authors, something like, something like --author in git log.</p>
<p>I am interested in the final summary diff an... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,024 | git | # git diff with author filter
I have a series of commits by different authors and I would like to see a `git dff` output between 2 commits but only considering the commits by one of the authors, something like, something like --author in git log.
I am interested in the final summary diff and not the diffs of the indi... | The problem here is that you can't do this in the general case. Suppose Alice changes a particular file, then Bob changes it - including parts that Alice changed - and finally Alice changes it again. How do you combine Alice's two diffs into a single diff? If you take them as two patches, the second simply won't apply ... |
4644380 | warning: refname 'xxx' is ambiguous when using git-svn | 49 | 2011-01-10 06:54:24 | <p>I am using git as a frontend to Subversion (via git svn).</p>
<p>So, for every svn trunk/branch I have remote branch in git named "remotes/xxx". For example "remotes/trunk", "remotes/coolfeature".</p>
<p>Now I want have one "default" local branch for every remote branch, to use it for dcommit. The problem is that ... | 20,065 | 31,118 | 2019-01-11 06:20:56 | 5,425,585 | 40 | 2011-03-24 21:11:28 | 128,356 | 2011-03-24 21:11:28 | https://stackoverflow.com/q/4644380 | https://stackoverflow.com/a/5425585 | <p>If you pass the <code>--prefix=svn/</code> flag to the <code>git svn clone</code> command, then all of the Subversion branches would be named like <code>remotes/svn/branchname</code>. If this is acceptable to you, it fixes the "refname is ambiguous" warning. It also gives you a nice way of referring to the remote sv... | <p>If you pass the <code>--prefix=svn/</code> flag to the <code>git svn clone</code> command, then all of the Subversion branches would be named like <code>remotes/svn/branchname</code>. If this is acceptable to you, it fixes the "refname is ambiguous" warning. It also gives you a nice way of referring to the remote sv... | 119, 1879, 6452, 10335 | ambiguity, branch, git, git-svn | <h1>warning: refname 'xxx' is ambiguous when using git-svn</h1>
<p>I am using git as a frontend to Subversion (via git svn).</p>
<p>So, for every svn trunk/branch I have remote branch in git named "remotes/xxx". For example "remotes/trunk", "remotes/coolfeature".</p>
<p>Now I want have one "default" local branch for ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,025 | git | # warning: refname 'xxx' is ambiguous when using git-svn
I am using git as a frontend to Subversion (via git svn).
So, for every svn trunk/branch I have remote branch in git named "remotes/xxx". For example "remotes/trunk", "remotes/coolfeature".
Now I want have one "default" local branch for every remote branch, to... | If you pass the `--prefix=svn/` flag to the `git svn clone` command, then all of the Subversion branches would be named like `remotes/svn/branchname`. If this is acceptable to you, it fixes the "refname is ambiguous" warning. It also gives you a nice way of referring to the remote svn branches, as in for instance if yo... |
460331 | Git - finding a filename from a SHA1 | 48 | 2009-01-20 07:12:20 | <p>I added a file to the index with:</p>
<pre><code>git add somefile.txt
</code></pre>
<p>I then got the SHA1 for this file with:</p>
<pre><code>git hash-object somefile.txt
</code></pre>
<p>I now have a SHA1 and I would like to retrieve the filename of the object in the index using the SHA1.</p>
<pre><code>git sh... | 29,476 | 52,416 | 2024-10-30 09:19:17 | 460,415 | 40 | 2009-01-20 07:59:54 | 19,563 | 2014-05-23 21:34:42 | https://stackoverflow.com/q/460331 | https://stackoverflow.com/a/460415 | <p>There's no such direct mapping in git as the name of the file is part of the tree object that contains the file, not of the blob object that is the file's contents.</p>
<p>It's not a usual operation to want to retrieve a file name from a SHA1 hash so perhaps you could expand on a real world use case for it?</p>
<p... | <p>There's no such direct mapping in git as the name of the file is part of the tree object that contains the file, not of the blob object that is the file's contents.</p> <p>It's not a usual operation to want to retrieve a file name from a SHA1 hash so perhaps you could expand on a real world use case for it?</p> <p... | 119, 3190 | git, sha1 | <h1>Git - finding a filename from a SHA1</h1>
<p>I added a file to the index with:</p>
<pre><code>git add somefile.txt
</code></pre>
<p>I then got the SHA1 for this file with:</p>
<pre><code>git hash-object somefile.txt
</code></pre>
<p>I now have a SHA1 and I would like to retrieve the filename of the object in th... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,027 | git | # Git - finding a filename from a SHA1
I added a file to the index with:
```
git add somefile.txt
```
I then got the SHA1 for this file with:
```
git hash-object somefile.txt
```
I now have a SHA1 and I would like to retrieve the filename of the object in the index using the SHA1.
```
git show 5a5bf28dcd794499194... | There's no such direct mapping in git as the name of the file is part of the tree object that contains the file, not of the blob object that is the file's contents.
It's not a usual operation to want to retrieve a file name from a SHA1 hash so perhaps you could expand on a real world use case for it?
If you're lookin... |
17380029 | How to perform case insensitive diff in Git | 46 | 2013-06-29 12:08:44 | <p><code>git diff</code> does not support a case-insensitive comparison of files. Google shows a very few people asking for that feature, and that too only in combination with some other <code>git diff</code> switch, like with <code>-G</code> or with <code>--color-words</code>.</p>
<p>I don't care for other switches, ... | 14,044 | 382,700 | 2022-03-11 19:42:39 | 17,380,104 | 40 | 2013-06-29 12:19:32 | 382,700 | 2021-11-27 08:04:52 | https://stackoverflow.com/q/17380029 | https://stackoverflow.com/a/17380104 | <p>The solution is to use <code>git difftool</code>. With the following config command, I can add a custom <code>diff</code> tool called <code>idiff</code> for Git to use:</p>
<p><code>git config --global difftool.idiff.cmd 'diff -i $LOCAL $REMOTE'</code></p>
<p>With this customization, I can see the case-insensitive c... | <p>The solution is to use <code>git difftool</code>. With the following config command, I can add a custom <code>diff</code> tool called <code>idiff</code> for Git to use:</p> <p><code>git config --global difftool.idiff.cmd 'diff -i $LOCAL $REMOTE'</code></p> <p>With this customization, I can see the case-insensitive c... | 119, 606, 11057 | case-insensitive, diff, git | <h1>How to perform case insensitive diff in Git</h1>
<p><code>git diff</code> does not support a case-insensitive comparison of files. Google shows a very few people asking for that feature, and that too only in combination with some other <code>git diff</code> switch, like with <code>-G</code> or with <code>--color-wo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,028 | git | # How to perform case insensitive diff in Git
`git diff` does not support a case-insensitive comparison of files. Google shows a very few people asking for that feature, and that too only in combination with some other `git diff` switch, like with `-G` or with `--color-words`.
I don't care for other switches, as long... | The solution is to use `git difftool`. With the following config command, I can add a custom `diff` tool called `idiff` for Git to use:
`git config --global difftool.idiff.cmd 'diff -i $LOCAL $REMOTE'`
With this customization, I can see the case-insensitive comparison like so:
`git difftool --tool idiff <other diff ... |
5674149 | 3D coordinates on a sphere to Latitude and Longitude | 46 | 2011-04-15 08:24:30 | <p>I've got the following information:</p>
<p>There exists a sphere with origin (0,0,0) and radius R.
After doing a ray-sphere intersection I know a point (XYZ) in 3D space that is on the sphere (the exact position in 3D space where the line pierces the sphere hull).</p>
<p>For my program I'd like to calculate the La... | 53,240 | 445,112 | 2018-07-19 08:08:41 | 5,674,243 | 40 | 2011-04-15 08:35:58 | 447,023 | 2016-07-05 13:02:06 | https://stackoverflow.com/q/5674149 | https://stackoverflow.com/a/5674243 | <p>I guess it should not be difficult to find the spherical polar coordinates from x,y,z (3d-coordinate system).</p>
<ol>
<li><p><code>r</code> is always constant if it's on surface.</p>
<p><img src="https://i.sstatic.net/aI1Em.png" alt="enter image description here" /></p>
</li>
<li><p><strong>(90 - <em>θ</em>)</stron... | <p>I guess it should not be difficult to find the spherical polar coordinates from x,y,z (3d-coordinate system).</p> <ol> <li><p><code>r</code> is always constant if it's on surface.</p> <p><img src="https://i.sstatic.net/aI1Em.png" alt="enter image description here" /></p> </li> <li><p><strong>(90 - <em>θ</em>)</stron... | 259, 1080, 20301, 24852 | coordinates, geometry, latitude-longitude, math | <h1>3D coordinates on a sphere to Latitude and Longitude</h1>
<p>I've got the following information:</p>
<p>There exists a sphere with origin (0,0,0) and radius R.
After doing a ray-sphere intersection I know a point (XYZ) in 3D space that is on the sphere (the exact position in 3D space where the line pierces the sph... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,030 | git | # 3D coordinates on a sphere to Latitude and Longitude
I've got the following information:
There exists a sphere with origin (0,0,0) and radius R.
After doing a ray-sphere intersection I know a point (XYZ) in 3D space that is on the sphere (the exact position in 3D space where the line pierces the sphere hull).
For ... | I guess it should not be difficult to find the spherical polar coordinates from x,y,z (3d-coordinate system).
1. `r` is always constant if it's on surface.

2. **(90 - *θ*)** your latitude (negative means it's on the bottom) as **it's measured from to... |
47610213 | How Do I Run Prettier Only on Files That I Want to Commit? | 45 | 2017-12-02 16:51:26 | <p>Using <a href="https://github.com/typicode/husky" rel="noreferrer">Husky</a>, I've set up my <code>package.json</code> with a precommit hook so that my JavaScript code is formatted using <a href="https://prettier.io" rel="noreferrer">Prettier</a> before every commit:</p>
<pre><code>{
"name": "prettier-demo",
"s... | 83,945 | 1,253,156 | 2024-10-03 17:38:09 | 47,610,566 | 40 | 2017-12-02 17:29:24 | 906,113 | 2018-01-29 15:21:24 | https://stackoverflow.com/q/47610213 | https://stackoverflow.com/a/47610566 | <p>You can do that using <a href="https://github.com/okonet/lint-staged" rel="noreferrer">lint-staged</a>:</p>
<blockquote>
<p>Linting makes more sense when running before committing your code. By doing that you can ensure no errors are going into repository and enforce code style. But running a lint process on a whole... | <p>You can do that using <a href="https://github.com/okonet/lint-staged" rel="noreferrer">lint-staged</a>:</p> <blockquote> <p>Linting makes more sense when running before committing your code. By doing that you can ensure no errors are going into repository and enforce code style. But running a lint process on a whole... | 3, 119, 4162, 25281, 126212 | code-formatting, git, javascript, pre-commit-hook, prettier | <h1>How Do I Run Prettier Only on Files That I Want to Commit?</h1>
<p>Using <a href="https://github.com/typicode/husky" rel="noreferrer">Husky</a>, I've set up my <code>package.json</code> with a precommit hook so that my JavaScript code is formatted using <a href="https://prettier.io" rel="noreferrer">Prettier</a> be... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,031 | git | # How Do I Run Prettier Only on Files That I Want to Commit?
Using [Husky](https://github.com/typicode/husky), I've set up my `package.json` with a precommit hook so that my JavaScript code is formatted using [Prettier](https://prettier.io) before every commit:
```
{
"name": "prettier-demo",
"scripts": {
"pre... | You can do that using [lint-staged](https://github.com/okonet/lint-staged):
> Linting makes more sense when running before committing your code. By doing that you can ensure no errors are going into repository and enforce code style. But running a lint process on a whole project is slow and linting results can be irre... |
72101375 | Receiving "core.useBuiltinFSMonitor will be deprecated soon" message while cloning in Git | 42 | 2022-05-03 14:57:50 | <p>I recently installed <code>git version 2.36.0.windows.1</code> and upon cloning a repo I got the following messages after.</p>
<blockquote>
<p>hint: core.useBuiltinFSMonitor will be deprecated soon; use core.fsmonitor instead</p>
</blockquote>
<blockquote>
<p>hint: Disable this message with "git config advice.u... | 20,615 | 12,632,622 | 2024-06-30 03:03:38 | 72,304,673 | 40 | 2022-05-19 12:36:01 | 12,632,622 | 2024-06-30 03:03:38 | https://stackoverflow.com/q/72101375 | https://stackoverflow.com/a/72304673 | <p>Thanks to Chris for the explanation and links to look around.</p>
<p>TL;DR</p>
<p>One can safely use the command <code>git config --global core.fsmonitor true</code> to get rid of the message for good.</p>
<p>The answer to the what is in Chris's answer and to why is below.</p>
<hr />
<ol>
<li>Seems like both of them... | <p>Thanks to Chris for the explanation and links to look around.</p> <p>TL;DR</p> <p>One can safely use the command <code>git config --global core.fsmonitor true</code> to get rid of the message for good.</p> <p>The answer to the what is in Chris's answer and to why is below.</p> <hr /> <ol> <li>Seems like both of them... | 64, 119 | git, windows | <h1>Receiving "core.useBuiltinFSMonitor will be deprecated soon" message while cloning in Git</h1>
<p>I recently installed <code>git version 2.36.0.windows.1</code> and upon cloning a repo I got the following messages after.</p>
<blockquote>
<p>hint: core.useBuiltinFSMonitor will be deprecated soon; use core.fsmonitor ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,033 | git | # Receiving "core.useBuiltinFSMonitor will be deprecated soon" message while cloning in Git
I recently installed `git version 2.36.0.windows.1` and upon cloning a repo I got the following messages after.
> hint: core.useBuiltinFSMonitor will be deprecated soon; use core.fsmonitor instead
> hint: Disable this message... | Thanks to Chris for the explanation and links to look around.
TL;DR
One can safely use the command `git config --global core.fsmonitor true` to get rid of the message for good.
The answer to the what is in Chris's answer and to why is below.
---
1. Seems like both of them are interconnected and hence they haven't ... |
18867012 | How do I delete a Git remote branch from the NetBeans IDE? | 40 | 2013-09-18 08:11:15 | <p>How do I delete a Git remote branch?</p>
<p>I work with NetBeans, and I tried to delete a remote branch from IDE, but on the delete branch it deleted only locally.</p>
| 11,045 | 2,677,738 | 2017-05-21 11:34:01 | 18,867,240 | 40 | 2013-09-18 08:23:26 | 1,589,479 | 2016-07-14 20:24:50 | https://stackoverflow.com/q/18867012 | https://stackoverflow.com/a/18867240 | <p>You can also use</p>
<hr>
<pre><code>git push origin --delete <yourBranchName>
</code></pre>
| <p>You can also use</p> <hr> <pre><code>git push origin --delete <yourBranchName> </code></pre> | 110, 119, 1879, 2176 | branch, git, ide, netbeans | <h1>How do I delete a Git remote branch from the NetBeans IDE?</h1>
<p>How do I delete a Git remote branch?</p>
<p>I work with NetBeans, and I tried to delete a remote branch from IDE, but on the delete branch it deleted only locally.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,036 | git | # How do I delete a Git remote branch from the NetBeans IDE?
How do I delete a Git remote branch?
I work with NetBeans, and I tried to delete a remote branch from IDE, but on the delete branch it deleted only locally. | You can also use
---
```
git push origin --delete <yourBranchName>
``` |
39466462 | Git commit lost after merge | 39 | 2016-09-13 09:22:21 | <p>We have 3 branches (A, B, C) as below:</p>
<pre><code>---\--A1--\------Am------Merge1---An---Merge2---
\ \ / /
\ \--C1---C2---/ /
\ /
\--B1--------------Bn---------/
</code></pre>
<p>The problem appears at Merge2. So... | 15,955 | 475,253 | 2019-05-12 01:57:51 | 39,474,458 | 40 | 2016-09-13 16:02:59 | 1,256,452 | 2016-10-25 06:15:57 | https://stackoverflow.com/q/39466462 | https://stackoverflow.com/a/39474458 | <p>What you mean is not that the commit <em>itself</em> is lost, but rather that the <em>changes made</em> (to some file) in that commit have been reverted (un-made).</p>
<p>It's worth noting here that commits don't really "make changes to" files. Instead, each commit stores a complete set of files, whole and intact.... | <p>What you mean is not that the commit <em>itself</em> is lost, but rather that the <em>changes made</em> (to some file) in that commit have been reverted (un-made).</p> <p>It's worth noting here that commits don't really "make changes to" files. Instead, each commit stores a complete set of files, whole and intact.... | 119 | git | <h1>Git commit lost after merge</h1>
<p>We have 3 branches (A, B, C) as below:</p>
<pre><code>---\--A1--\------Am------Merge1---An---Merge2---
\ \ / /
\ \--C1---C2---/ /
\ /
\--B1--------------Bn---------/
</code></pre>
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,037 | git | # Git commit lost after merge
We have 3 branches (A, B, C) as below:
```
---\--A1--\------Am------Merge1---An---Merge2---
\ \ / /
\ \--C1---C2---/ /
\ /
\--B1--------------Bn---------/
```
The problem appears at Merge2... | What you mean is not that the commit *itself* is lost, but rather that the *changes made* (to some file) in that commit have been reverted (un-made).
It's worth noting here that commits don't really "make changes to" files. Instead, each commit stores a complete set of files, whole and intact. When you ask Git to show... |
21334493 | git commit in pre-push hook | 39 | 2014-01-24 13:55:29 | <p>I have added something like that in <code>pre-push</code> hook:</p>
<pre><code>gs0=$(git status)
pip-dump
gs1=$(git status)
if [ "gs0" != "gs1" ]
then
git commit -m "pip-dump"
fi
</code></pre>
<p>(this is updating my pip requirements file)</p>
<p>It seems that the push is not pushing the new commit, but the o... | 10,026 | 931,156 | 2021-09-17 17:22:16 | 21,334,985 | 40 | 2014-01-24 14:20:32 | 1,256,452 | 2014-01-24 14:37:23 | https://stackoverflow.com/q/21334493 | https://stackoverflow.com/a/21334985 | <p>You can't: the <code>push</code> command figures out which commits to push before invoking the hook, and pushes that if the hook exits 0.</p>
<p>I see three options:</p>
<ol>
<li>Exit nonzero, telling the user "push rejected because I added a commit"</li>
<li>Exit zero, telling the user "push went through but you'... | <p>You can't: the <code>push</code> command figures out which commits to push before invoking the hook, and pushes that if the hook exits 0.</p> <p>I see three options:</p> <ol> <li>Exit nonzero, telling the user "push rejected because I added a commit"</li> <li>Exit zero, telling the user "push went through but you'... | 119, 43087 | git, githooks | <h1>git commit in pre-push hook</h1>
<p>I have added something like that in <code>pre-push</code> hook:</p>
<pre><code>gs0=$(git status)
pip-dump
gs1=$(git status)
if [ "gs0" != "gs1" ]
then
git commit -m "pip-dump"
fi
</code></pre>
<p>(this is updating my pip requirements file)</p>
<p>It seems that the push is ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,038 | git | # git commit in pre-push hook
I have added something like that in `pre-push` hook:
```
gs0=$(git status)
pip-dump
gs1=$(git status)
if [ "gs0" != "gs1" ]
then
git commit -m "pip-dump"
fi
```
(this is updating my pip requirements file)
It seems that the push is not pushing the new commit, but the one which the H... | You can't: the `push` command figures out which commits to push before invoking the hook, and pushes that if the hook exits 0.
I see three options:
1. Exit nonzero, telling the user "push rejected because I added a commit"
2. Exit zero, telling the user "push went through but you'll need to push again because I added... |
21561789 | Print the message of a git tag | 37 | 2014-02-04 19:37:56 | <p>I need a git command that would output only the message of a given annotated tag. It's <em>almost</em> possible with <code>git tag -ln</code>:</p>
<pre><code>$ git tag -ln v1.3.7
v1.3.7 Here be annotations
</code></pre>
<p>It's just that I don't want the tag and whitespace in the beginning, and throwing a... | 10,622 | 454,094 | 2024-02-13 14:11:16 | 48,693,527 | 40 | 2018-02-08 19:41:12 | 1,009,106 | 2024-02-13 14:11:16 | https://stackoverflow.com/q/21561789 | https://stackoverflow.com/a/48693527 | <p>I'm not sure what version of git this requires, but with recent versions you can also do:</p>
<pre><code>git tag -l --format='%(contents)' <tag name>
</code></pre>
<p>or</p>
<pre><code>git for-each-ref --format='%(contents)' refs/tags/<tag name>
</code></pre>
<p>to get only the tag message by itself, whe... | <p>I'm not sure what version of git this requires, but with recent versions you can also do:</p> <pre><code>git tag -l --format='%(contents)' <tag name> </code></pre> <p>or</p> <pre><code>git for-each-ref --format='%(contents)' refs/tags/<tag name> </code></pre> <p>to get only the tag message by itself, whe... | 119, 60718 | git, git-tag | <h1>Print the message of a git tag</h1>
<p>I need a git command that would output only the message of a given annotated tag. It's <em>almost</em> possible with <code>git tag -ln</code>:</p>
<pre><code>$ git tag -ln v1.3.7
v1.3.7 Here be annotations
</code></pre>
<p>It's just that I don't want the tag and whi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,039 | git | # Print the message of a git tag
I need a git command that would output only the message of a given annotated tag. It's *almost* possible with `git tag -ln`:
```
$ git tag -ln v1.3.7
v1.3.7 Here be annotations
```
It's just that I don't want the tag and whitespace in the beginning, and throwing a regex at t... | I'm not sure what version of git this requires, but with recent versions you can also do:
```
git tag -l --format='%(contents)' <tag name>
```
or
```
git for-each-ref --format='%(contents)' refs/tags/<tag name>
```
to get only the tag message by itself, where latter one is some like the base command without `--sort... |
2538245 | Extract part of a git repository? | 37 | 2010-03-29 13:38:17 | <p>Assume my git repository has the following structure: </p>
<pre><code>/.git
/Project
/Project/SubProject-0
/Project/SubProject-1
/Project/SubProject-2
</code></pre>
<p>and the repository has quite some commits. Now one of the subprojects (SubProject-0) grows pretty big, and I want to take SubProject-0 out and set ... | 12,939 | 184,061 | 2023-05-28 22:44:15 | 2,538,259 | 40 | 2010-03-29 13:41:02 | 233,014 | 2013-01-04 17:17:39 | https://stackoverflow.com/q/2538245 | https://stackoverflow.com/a/2538259 | <p>See <a href="http://git-scm.com/docs/git-filter-branch" rel="noreferrer">http://git-scm.com/docs/git-filter-branch</a></p>
<p>I think you need something like</p>
<pre><code>git filter-branch --subdirectory-filter Project/SubProject-0 --prune-empty -- --all
</code></pre>
<p>in a clone of the repository.</p>
| <p>See <a href="http://git-scm.com/docs/git-filter-branch" rel="noreferrer">http://git-scm.com/docs/git-filter-branch</a></p> <p>I think you need something like</p> <pre><code>git filter-branch --subdirectory-filter Project/SubProject-0 --prune-empty -- --all </code></pre> <p>in a clone of the repository.</p> | 119, 5352, 7330 | extract, git, repository | <h1>Extract part of a git repository?</h1>
<p>Assume my git repository has the following structure: </p>
<pre><code>/.git
/Project
/Project/SubProject-0
/Project/SubProject-1
/Project/SubProject-2
</code></pre>
<p>and the repository has quite some commits. Now one of the subprojects (SubProject-0) grows pretty big, a... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,042 | git | # Extract part of a git repository?
Assume my git repository has the following structure:
```
/.git
/Project
/Project/SubProject-0
/Project/SubProject-1
/Project/SubProject-2
```
and the repository has quite some commits. Now one of the subprojects (SubProject-0) grows pretty big, and I want to take SubProject-0 out... | See <http://git-scm.com/docs/git-filter-branch>
I think you need something like
```
git filter-branch --subdirectory-filter Project/SubProject-0 --prune-empty -- --all
```
in a clone of the repository. |
149198 | Can I commit only parts of my code using SVN or Mercurial? | 37 | 2008-09-29 15:32:10 | <p>I use Tortoise SVN usuallly, but I have been looking into Mercurial since it is a distributed revision control system. </p>
<p>What I am looking for, in both systems, is a tool that let me pick only parts of a file and commit them. If I want to do this now, I have to copy to a temp version of the file and keep only... | 10,324 | 6,752 | 2017-09-07 17:34:03 | 149,270 | 40 | 2008-09-29 15:43:48 | 6,372 | 2017-06-20 11:44:48 | https://stackoverflow.com/q/149198 | https://stackoverflow.com/a/149270 | <p>Mercurial can do this with the <a href="https://www.mercurial-scm.org/wiki/RecordExtension" rel="nofollow noreferrer">record</a> extension.</p>
<p>It'll prompt you for each file and each diff hunk. For example:</p>
<pre><code>% hg record
diff --git a/prelim.tex b/prelim.tex
2 hunks, 4 lines changed
examine change... | <p>Mercurial can do this with the <a href="https://www.mercurial-scm.org/wiki/RecordExtension" rel="nofollow noreferrer">record</a> extension.</p> <p>It'll prompt you for each file and each diff hunk. For example:</p> <pre><code>% hg record diff --git a/prelim.tex b/prelim.tex 2 hunks, 4 lines changed examine change... | 63, 119, 456, 656, 802 | git, mercurial, svn, tortoisesvn, version-control | <h1>Can I commit only parts of my code using SVN or Mercurial?</h1>
<p>I use Tortoise SVN usuallly, but I have been looking into Mercurial since it is a distributed revision control system. </p>
<p>What I am looking for, in both systems, is a tool that let me pick only parts of a file and commit them. If I want to do ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,043 | git | # Can I commit only parts of my code using SVN or Mercurial?
I use Tortoise SVN usuallly, but I have been looking into Mercurial since it is a distributed revision control system.
What I am looking for, in both systems, is a tool that let me pick only parts of a file and commit them. If I want to do this now, I have ... | Mercurial can do this with the [record](https://www.mercurial-scm.org/wiki/RecordExtension) extension.
It'll prompt you for each file and each diff hunk. For example:
```
% hg record
diff --git a/prelim.tex b/prelim.tex
2 hunks, 4 lines changed
examine changes to 'prelim.tex'? [Ynsfdaq?]
@@ -12,7 +12,7 @@
\setmono... |
7999259 | How to perform the TFS-equivalent of 'Undo pending changes' | 36 | 2011-11-03 17:27:29 | <p>How do I perform the equivalent of the TFS 'Undo pending changes' in Git, on one or multiple files?</p>
<p>That basically means to do these steps:</p>
<ul>
<li>Undo changes on disk</li>
<li>Resetting any changes Git has discovered</li>
<li>Getting the latest changes on the file from Git</li>
</ul>
<p>It would be ... | 27,900 | 2,429 | 2017-04-12 20:27:56 | 7,999,306 | 40 | 2011-11-03 17:31:01 | 1,864,976 | 2013-06-19 00:13:23 | https://stackoverflow.com/q/7999259 | https://stackoverflow.com/a/7999306 | <p>For 1 and 2, all you need to do is:</p>
<pre><code> git stash -u #same effect as git reset --hard, but can be undone
</code></pre>
<p>this will throw away any changes. Be careful if you use <code>reset</code>. Read up on manipulating the index and the permutations of the hard, soft and mixed options with the reset... | <p>For 1 and 2, all you need to do is:</p> <pre><code> git stash -u #same effect as git reset --hard, but can be undone </code></pre> <p>this will throw away any changes. Be careful if you use <code>reset</code>. Read up on manipulating the index and the permutations of the hard, soft and mixed options with the reset... | 119, 456, 5766 | git, undo, version-control | <h1>How to perform the TFS-equivalent of 'Undo pending changes'</h1>
<p>How do I perform the equivalent of the TFS 'Undo pending changes' in Git, on one or multiple files?</p>
<p>That basically means to do these steps:</p>
<ul>
<li>Undo changes on disk</li>
<li>Resetting any changes Git has discovered</li>
<li>Gettin... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,044 | git | # How to perform the TFS-equivalent of 'Undo pending changes'
How do I perform the equivalent of the TFS 'Undo pending changes' in Git, on one or multiple files?
That basically means to do these steps:
- Undo changes on disk
- Resetting any changes Git has discovered
- Getting the latest changes on the file from Git... | For 1 and 2, all you need to do is:
```
git stash -u #same effect as git reset --hard, but can be undone
```
this will throw away any changes. Be careful if you use `reset`. Read up on manipulating the index and the permutations of the hard, soft and mixed options with the reset and checkout. The progit book explain... |
37669297 | Why doesn't my Git status show me whether I'm up-to-date with my remote counterpart? | 34 | 2016-06-07 01:48:45 | <p>I have tried making some changes and pushed it up to GitHub. From another computer, I fetched the changes. When I do a <code>git status</code>, it reports this:</p>
<pre><code>On branch MyTestBranch
nothing to commit, working directory clean
</code></pre>
<p>This is strange because <em>I'm certain that there were ch... | 13,586 | 750,511 | 2020-11-13 16:37:19 | 37,669,540 | 40 | 2016-06-07 02:22:55 | 1,256,452 | 2018-11-05 06:19:30 | https://stackoverflow.com/q/37669297 | https://stackoverflow.com/a/37669540 | <p>My guess at this point (I'm still waiting for <code>git branch -vv</code> or <code>git rev-parse --symbolic-full-name "@{u}"</code> results) is that you do not have <code>origin/MyTestBranch</code> set as the upstream for <code>MyTestBranch</code>.</p>
<p>To set a branch as the upstream for the current branch, use:... | <p>My guess at this point (I'm still waiting for <code>git branch -vv</code> or <code>git rev-parse --symbolic-full-name "@{u}"</code> results) is that you do not have <code>origin/MyTestBranch</code> set as the upstream for <code>MyTestBranch</code>.</p> <p>To set a branch as the upstream for the current branch, use:... | 119 | git | <h1>Why doesn't my Git status show me whether I'm up-to-date with my remote counterpart?</h1>
<p>I have tried making some changes and pushed it up to GitHub. From another computer, I fetched the changes. When I do a <code>git status</code>, it reports this:</p>
<pre><code>On branch MyTestBranch
nothing to commit, worki... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,045 | git | # Why doesn't my Git status show me whether I'm up-to-date with my remote counterpart?
I have tried making some changes and pushed it up to GitHub. From another computer, I fetched the changes. When I do a `git status`, it reports this:
```
On branch MyTestBranch
nothing to commit, working directory clean
```
This i... | My guess at this point (I'm still waiting for `git branch -vv` or `git rev-parse --symbolic-full-name "@{u}"` results) is that you do not have `origin/MyTestBranch` set as the upstream for `MyTestBranch`.
To set a branch as the upstream for the current branch, use:
`git branch --set-upstream-to upstream`1
which in t... |
16709404 | how to automate the "commit-and-push" process? (git) | 34 | 2013-05-23 08:46:53 | <p>I have a git repo. And after each major change, that I make in the codebase, what I do is that I go to the terminal and execute a set of commands. </p>
<pre><code>git add .
git commit -m 'some message'
git push origin master
</code></pre>
<p>These are the same each day and the process is quite boring. Can anyone s... | 59,545 | 2,080,089 | 2023-06-13 09:09:16 | 16,709,405 | 40 | 2013-05-23 08:46:53 | 2,080,089 | 2013-05-23 08:46:53 | https://stackoverflow.com/q/16709404 | https://stackoverflow.com/a/16709405 | <p>You can very easily automate this using Bash scripting.</p>
<pre><code>git add .
echo 'Enter the commit message:'
read commitMessage
git commit -m "$commitMessage"
echo 'Enter the name of the branch:'
read branch
git push origin $branch
read
</code></pre>
<p>store the above code as a <code>.sh</code> file(say... | <p>You can very easily automate this using Bash scripting.</p> <pre><code>git add . echo 'Enter the commit message:' read commitMessage git commit -m "$commitMessage" echo 'Enter the name of the branch:' read branch git push origin $branch read </code></pre> <p>store the above code as a <code>.sh</code> file(say... | 119 | git | <h1>how to automate the "commit-and-push" process? (git)</h1>
<p>I have a git repo. And after each major change, that I make in the codebase, what I do is that I go to the terminal and execute a set of commands. </p>
<pre><code>git add .
git commit -m 'some message'
git push origin master
</code></pre>
<p>These are t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,047 | git | # how to automate the "commit-and-push" process? (git)
I have a git repo. And after each major change, that I make in the codebase, what I do is that I go to the terminal and execute a set of commands.
```
git add .
git commit -m 'some message'
git push origin master
```
These are the same each day and the process i... | You can very easily automate this using Bash scripting.
```
git add .
echo 'Enter the commit message:'
read commitMessage
git commit -m "$commitMessage"
echo 'Enter the name of the branch:'
read branch
git push origin $branch
read
```
store the above code as a `.sh` file(say `gitpush.sh`)
And since you have to ... |
6243407 | Delete username from a Git repository | 34 | 2011-06-05 14:07:00 | <p>I am getting this warning when I try to set my user name in <a href="http://www.git-tower.com/" rel="noreferrer">Tower</a>:</p>
<blockquote>
<p>warning: user.name has multiple values</p>
</blockquote>
<p>I have checked in a terminal window and found that I have three usernames:</p>
<pre><code>macmini:HiBye shan... | 98,806 | 358,480 | 2023-05-01 07:00:47 | 6,243,735 | 40 | 2011-06-05 15:10:06 | 41,071 | 2013-10-29 05:34:21 | https://stackoverflow.com/q/6243407 | https://stackoverflow.com/a/6243735 | <p>Use <code>git config -e</code> and you should see something like:</p>
<pre><code>[user]
name = Shani
name = shani
name = shani
</code></pre>
<p>Delete the lines you don't want.</p>
| <p>Use <code>git config -e</code> and you should see something like:</p> <pre><code>[user] name = Shani name = shani name = shani </code></pre> <p>Delete the lines you don't want.</p> | 119, 32868 | git, git-config | <h1>Delete username from a Git repository</h1>
<p>I am getting this warning when I try to set my user name in <a href="http://www.git-tower.com/" rel="noreferrer">Tower</a>:</p>
<blockquote>
<p>warning: user.name has multiple values</p>
</blockquote>
<p>I have checked in a terminal window and found that I have thre... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,048 | git | # Delete username from a Git repository
I am getting this warning when I try to set my user name in [Tower](http://www.git-tower.com/):
> warning: user.name has multiple values
I have checked in a terminal window and found that I have three usernames:
```
macmini:HiBye shannoga$ git config --get-all user.name
Shani... | Use `git config -e` and you should see something like:
```
[user]
name = Shani
name = shani
name = shani
```
Delete the lines you don't want. |
36190800 | How to disable sparse checkout after enabled? | 33 | 2016-03-23 23:42:23 | <p>I enabled a sparse checkout </p>
<pre><code>git init
git remote add <url>
git config --global core.sparseCheckout true
echo "assets" >> .git/info/sparse-checkout
git pull origin master
</code></pre>
<p>Git checked out only the assets folder for me</p>
<p>But now, I want to enable full branch checkout ... | 22,381 | 3,260,810 | 2020-07-08 16:31:25 | 36,195,275 | 40 | 2016-03-24 07:41:45 | 6,309 | 2020-07-08 16:31:25 | https://stackoverflow.com/q/36190800 | https://stackoverflow.com/a/36195275 | <p>Update with git 2.25+ (Q1 2020), as I mentioned in "<a href="https://stackoverflow.com/a/59515426/6309">Git sparse checkout with exclusion</a>", you now have the <a href="https://git-scm.com/docs/git-sparse-checkout" rel="noreferrer"><code>git sparse-checkout</code> command</a>.</p>
<p>More precisely, as n... | <p>Update with git 2.25+ (Q1 2020), as I mentioned in "<a href="https://stackoverflow.com/a/59515426/6309">Git sparse checkout with exclusion</a>", you now have the <a href="https://git-scm.com/docs/git-sparse-checkout" rel="noreferrer"><code>git sparse-checkout</code> command</a>.</p> <p>More precisely, as n... | 119 | git | <h1>How to disable sparse checkout after enabled?</h1>
<p>I enabled a sparse checkout </p>
<pre><code>git init
git remote add <url>
git config --global core.sparseCheckout true
echo "assets" >> .git/info/sparse-checkout
git pull origin master
</code></pre>
<p>Git checked out only the assets folder for me<... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,049 | git | # How to disable sparse checkout after enabled?
I enabled a sparse checkout
```
git init
git remote add <url>
git config --global core.sparseCheckout true
echo "assets" >> .git/info/sparse-checkout
git pull origin master
```
Git checked out only the assets folder for me
But now, I want to enable full branch checkou... | Update with git 2.25+ (Q1 2020), as I mentioned in "[Git sparse checkout with exclusion](https://stackoverflow.com/a/59515426/6309)", you now have the [`git sparse-checkout` command](https://git-scm.com/docs/git-sparse-checkout).
More precisely, as noted in [Tao](https://stackoverflow.com/users/74296/tao)'s [answer](h... |
18973057 | How to list all text (non-binary) files in a git repository? | 32 | 2013-09-24 04:39:37 | <p>I have a repository with a lot of autogenerated source files I've marked as "binary" in <code>.gitattributes</code> (they are checked in because not everyone has access to the generator tools). Additionally, the repo has a lot of source-ish files in ignored directories (again, generated as part of the build processe... | 5,593 | 1,204,143 | 2024-04-21 20:03:39 | 24,350,112 | 40 | 2014-06-22 09:55:43 | 895,245 | 2018-12-07 14:28:15 | https://stackoverflow.com/q/18973057 | https://stackoverflow.com/a/24350112 | <pre><code>git grep --cached -Il ''
</code></pre>
<p>lists all non-empty regular (no symlinks) text files:</p>
<ul>
<li><code>-I</code>: don't match the pattern in binary files</li>
<li><code>-l</code>: only show the matching file names, not matching lines</li>
<li><code>''</code>: the empty string makes <code>git gr... | <pre><code>git grep --cached -Il '' </code></pre> <p>lists all non-empty regular (no symlinks) text files:</p> <ul> <li><code>-I</code>: don't match the pattern in binary files</li> <li><code>-l</code>: only show the matching file names, not matching lines</li> <li><code>''</code>: the empty string makes <code>git gr... | 119, 17938 | git, text-files | <h1>How to list all text (non-binary) files in a git repository?</h1>
<p>I have a repository with a lot of autogenerated source files I've marked as "binary" in <code>.gitattributes</code> (they are checked in because not everyone has access to the generator tools). Additionally, the repo has a lot of source-ish files ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,051 | git | # How to list all text (non-binary) files in a git repository?
I have a repository with a lot of autogenerated source files I've marked as "binary" in `.gitattributes` (they are checked in because not everyone has access to the generator tools). Additionally, the repo has a lot of source-ish files in ignored directori... | ```
git grep --cached -Il ''
```
lists all non-empty regular (no symlinks) text files:
- `-I`: don't match the pattern in binary files
- `-l`: only show the matching file names, not matching lines
- `''`: the empty string makes `git grep` match any non-empty file
- `--cached`: also find files added with `git add` but... |
51792830 | What files in a Maven project should be committed to git? | 31 | 2018-08-10 19:16:00 | <p>I want to know what files in a Maven project should be committed to git.</p>
<p>Am I suppose to perform a <code>mvn clean</code> before committing, or do I add certain files to the <code>.gitignore</code> file?</p>
| 65,501 | 7,619,353 | 2023-01-26 18:25:55 | 51,793,051 | 40 | 2018-08-10 19:33:55 | 4,381,330 | 2019-10-18 09:25:07 | https://stackoverflow.com/q/51792830 | https://stackoverflow.com/a/51793051 | <p>Personally I use Maven gitignore and Java gitignore for a Maven project. You might need to adjust it with the languages used in your Maven project.</p>
<p><a href="https://github.com/github/gitignore/blob/master/Maven.gitignore" rel="noreferrer">https://github.com/github/gitignore/blob/master/Maven.gitignore</a></p... | <p>Personally I use Maven gitignore and Java gitignore for a Maven project. You might need to adjust it with the languages used in your Maven project.</p> <p><a href="https://github.com/github/gitignore/blob/master/Maven.gitignore" rel="noreferrer">https://github.com/github/gitignore/blob/master/Maven.gitignore</a></p... | 17, 80, 119, 41127, 131102 | apache, git, java, maven, mvn-repo | <h1>What files in a Maven project should be committed to git?</h1>
<p>I want to know what files in a Maven project should be committed to git.</p>
<p>Am I suppose to perform a <code>mvn clean</code> before committing, or do I add certain files to the <code>.gitignore</code> file?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,052 | git | # What files in a Maven project should be committed to git?
I want to know what files in a Maven project should be committed to git.
Am I suppose to perform a `mvn clean` before committing, or do I add certain files to the `.gitignore` file? | Personally I use Maven gitignore and Java gitignore for a Maven project. You might need to adjust it with the languages used in your Maven project.
<https://github.com/github/gitignore/blob/master/Maven.gitignore>
```
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dep... |
1218471 | For home projects, can Mercurial or Git (or other DVCS) provide more advantages over Subversion? | 31 | 2009-08-02 08:55:48 | <p>Which free source control system is most preferable with reason for home projects and documents?</p>
<p>I am thinking to use Subversion (as I am familiar with it).</p>
<p>Characteristic of home project:</p>
<ol>
<li><p>Most likely single person will be committing changes.
(May be one day (not now), it is possible... | 8,070 | 19,917 | 2025-03-13 22:09:39 | 1,218,657 | 40 | 2009-08-02 10:54:03 | 46,058 | 2025-03-13 22:09:39 | https://stackoverflow.com/q/1218471 | https://stackoverflow.com/a/1218657 | <p>Take a look at part about version control for single developer in my answer to "<a href="https://stackoverflow.com/questions/802573/difference-between-git-and-cvs/824241#824241">Difference between GIT and CVS</a>" question here on StackOverflow. Some of those issues do still apply also to Subversion versu... | <p>Take a look at part about version control for single developer in my answer to "<a href="https://stackoverflow.com/questions/802573/difference-between-git-and-cvs/824241#824241">Difference between GIT and CVS</a>" question here on StackOverflow. Some of those issues do still apply also to Subversion versu... | 63, 119, 456, 802 | git, mercurial, svn, version-control | <h1>For home projects, can Mercurial or Git (or other DVCS) provide more advantages over Subversion?</h1>
<p>Which free source control system is most preferable with reason for home projects and documents?</p>
<p>I am thinking to use Subversion (as I am familiar with it).</p>
<p>Characteristic of home project:</p>
<... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,053 | git | # For home projects, can Mercurial or Git (or other DVCS) provide more advantages over Subversion?
Which free source control system is most preferable with reason for home projects and documents?
I am thinking to use Subversion (as I am familiar with it).
Characteristic of home project:
1. Most likely single person... | Take a look at part about version control for single developer in my answer to "[Difference between GIT and CVS](https://stackoverflow.com/questions/802573/difference-between-git-and-cvs/824241#824241)" question here on StackOverflow. Some of those issues do still apply also to Subversion versus Git (or other distribut... |
16786786 | How to fix stale git branch -r (delete phantom git branches)? | 29 | 2013-05-28 07:58:11 | <pre><code>$ git branch
develop
* feature/bug_76
master
$ git branch -r
origin/HEAD -> origin/master
origin/develop
origin/feature/implement_IBResponder
origin/master
origin/origin
origin/sculptor_strategy
</code></pre>
<p>Locally, I am good. I want to delete all the crud on origin so I try:</p>
<... | 8,547 | 975,129 | 2016-03-30 17:17:02 | 16,786,964 | 40 | 2013-05-28 08:08:10 | 105,672 | 2013-05-28 08:08:10 | https://stackoverflow.com/q/16786786 | https://stackoverflow.com/a/16786964 | <p>You are probably not fetching with the prune option enabled. Use: <code>git fetch --prune</code>.</p>
| <p>You are probably not fetching with the prune option enabled. Use: <code>git fetch --prune</code>.</p> | 119 | git | <h1>How to fix stale git branch -r (delete phantom git branches)?</h1>
<pre><code>$ git branch
develop
* feature/bug_76
master
$ git branch -r
origin/HEAD -> origin/master
origin/develop
origin/feature/implement_IBResponder
origin/master
origin/origin
origin/sculptor_strategy
</code></pre>
<p>Locall... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,057 | git | # How to fix stale git branch -r (delete phantom git branches)?
```
$ git branch
develop
* feature/bug_76
master
$ git branch -r
origin/HEAD -> origin/master
origin/develop
origin/feature/implement_IBResponder
origin/master
origin/origin
origin/sculptor_strategy
```
Locally, I am good. I want to delet... | You are probably not fetching with the prune option enabled. Use: `git fetch --prune`. |
61614004 | Cloning succeded but checkout failed due to invalid path. What is the path problem? | 28 | 2020-05-05 13:12:37 | <p>I need to clone a repository that has been working with no issue on multiple linux machines, across several distributions.</p>
<p>Now it turns out that in Windows I get this problem</p>
<pre><code>error: invalid path 'soft/android-app/app/src/main/java/com/inti/bleapp/Aux.java'
fatal: unable to checkout working tr... | 51,344 | 792,589 | 2024-12-17 20:16:18 | 61,616,948 | 40 | 2020-05-05 15:34:57 | 1,256,452 | 2021-03-02 08:56:28 | https://stackoverflow.com/q/61614004 | https://stackoverflow.com/a/61616948 | <h3>How to fix it</h3>
<p>If you can get someone else—on Linux for instance—to rename the problematic file and commit, that will do the job. Or just spin up a VM with Linux on it, clone, fix the name (and all users of it), commit, and send the update back.</p>
<h3>The problem is Windows</h3>
<p><a href="https://www.ho... | <h3>How to fix it</h3> <p>If you can get someone else—on Linux for instance—to rename the problematic file and commit, that will do the job. Or just spin up a VM with Linux on it, clone, fix the name (and all users of it), commit, and send the update back.</p> <h3>The problem is Windows</h3> <p><a href="https://www.ho... | 119 | git | <h1>Cloning succeded but checkout failed due to invalid path. What is the path problem?</h1>
<p>I need to clone a repository that has been working with no issue on multiple linux machines, across several distributions.</p>
<p>Now it turns out that in Windows I get this problem</p>
<pre><code>error: invalid path 'soft... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,059 | git | # Cloning succeded but checkout failed due to invalid path. What is the path problem?
I need to clone a repository that has been working with no issue on multiple linux machines, across several distributions.
Now it turns out that in Windows I get this problem
```
error: invalid path 'soft/android-app/app/src/main/j... | ### How to fix it
If you can get someone else—on Linux for instance—to rename the problematic file and commit, that will do the job. Or just spin up a VM with Linux on it, clone, fix the name (and all users of it), commit, and send the update back.
### The problem is Windows
[Windows cannot handle any file named `AU... |
866262 | p4merge error [GIT] | 28 | 2009-05-14 22:48:02 | <p>I am trying to use p4merge with git but I am getting: </p>
<p><strong>Error starting p4merge: "path/myFile" is (or points to) an invalid file</strong> (this lists the BASE, LOCAL, REMOTE, and standard version of the file).</p>
<p>Git tells me about the conflict then it asks if I wanna start the mergetool configure... | 20,609 | 1,311,500 | 2015-05-14 13:14:57 | 1,217,994 | 40 | 2009-08-02 02:02:29 | 1,973,777 | 2009-08-02 02:02:29 | https://stackoverflow.com/q/866262 | https://stackoverflow.com/a/1217994 | <p>This worked for me using msysGit on windows 7:</p>
<pre><code>git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd 'p4merge $BASE $LOCAL $REMOTE $MERGED'
</code></pre>
<p>Not sure why but the quoting screwed things up for me.</p>
| <p>This worked for me using msysGit on windows 7:</p> <pre><code>git config --global merge.tool p4merge git config --global mergetool.p4merge.cmd 'p4merge $BASE $LOCAL $REMOTE $MERGED' </code></pre> <p>Not sure why but the quoting screwed things up for me.</p> | 119, 1286, 30283, 55021 | git, git-p4, p4merge, perforce | <h1>p4merge error [GIT]</h1>
<p>I am trying to use p4merge with git but I am getting: </p>
<p><strong>Error starting p4merge: "path/myFile" is (or points to) an invalid file</strong> (this lists the BASE, LOCAL, REMOTE, and standard version of the file).</p>
<p>Git tells me about the conflict then it asks if I wanna ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,062 | git | # p4merge error [GIT]
I am trying to use p4merge with git but I am getting:
**Error starting p4merge: "path/myFile" is (or points to) an invalid file** (this lists the BASE, LOCAL, REMOTE, and standard version of the file).
Git tells me about the conflict then it asks if I wanna start the mergetool configured (p4mer... | This worked for me using msysGit on windows 7:
```
git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd 'p4merge $BASE $LOCAL $REMOTE $MERGED'
```
Not sure why but the quoting screwed things up for me. |
11225105 | Is it possible to specify branch name on first commit in git? | 27 | 2012-06-27 11:23:36 | <p>is it possible to perform a first commit on a new repository using a different branch name than "master" ? Thank you</p>
| 7,169 | 1,015,501 | 2012-06-27 12:06:01 | 11,225,192 | 40 | 2012-06-27 11:29:15 | 19,563 | 2012-06-27 11:29:15 | https://stackoverflow.com/q/11225105 | https://stackoverflow.com/a/11225192 | <p>Yes. Before you make any commit you can just do <code>git symbolic-ref HEAD refs/heads/not-master</code>. This changes the name of the branch that you are on (that has no commits).</p>
| <p>Yes. Before you make any commit you can just do <code>git symbolic-ref HEAD refs/heads/not-master</code>. This changes the name of the branch that you are on (that has no commits).</p> | 119, 1879 | branch, git | <h1>Is it possible to specify branch name on first commit in git?</h1>
<p>is it possible to perform a first commit on a new repository using a different branch name than "master" ? Thank you</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,064 | git | # Is it possible to specify branch name on first commit in git?
is it possible to perform a first commit on a new repository using a different branch name than "master" ? Thank you | Yes. Before you make any commit you can just do `git symbolic-ref HEAD refs/heads/not-master`. This changes the name of the branch that you are on (that has no commits). |
5491832 | How can I check whether a git repository has any commits in it? | 27 | 2011-03-30 20:18:37 | <p>I am writing a custom git command that should only run in a completely new repository with no commits (see <a href="https://stackoverflow.com/questions/5479823/automatically-commit-an-empty-gitignore-file-after-git-init">this question</a>). How can I perform a simple check within my script to see if an existing repo... | 11,513 | 125,921 | 2023-08-03 21:02:19 | 5,492,347 | 40 | 2011-03-30 21:03:04 | 119,963 | 2023-08-03 21:02:19 | https://stackoverflow.com/q/5491832 | https://stackoverflow.com/a/5492347 | <p>Summary:</p>
<ul>
<li>A commit is checked out: test <code>git rev-parse HEAD 1>/dev/null 2>&1</code></li>
<li>A ref pointing to a commit exists: test <code>git rev-list -n 1 --all 1>/dev/null 2>&1</code></li>
<li>Objects exist in the repo: test output of <code>git fsck</code>, <code>git count-obj... | <p>Summary:</p> <ul> <li>A commit is checked out: test <code>git rev-parse HEAD 1>/dev/null 2>&1</code></li> <li>A ref pointing to a commit exists: test <code>git rev-list -n 1 --all 1>/dev/null 2>&1</code></li> <li>Objects exist in the repo: test output of <code>git fsck</code>, <code>git count-obj... | 119 | git | <h1>How can I check whether a git repository has any commits in it?</h1>
<p>I am writing a custom git command that should only run in a completely new repository with no commits (see <a href="https://stackoverflow.com/questions/5479823/automatically-commit-an-empty-gitignore-file-after-git-init">this question</a>). How... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,065 | git | # How can I check whether a git repository has any commits in it?
I am writing a custom git command that should only run in a completely new repository with no commits (see [this question](https://stackoverflow.com/questions/5479823/automatically-commit-an-empty-gitignore-file-after-git-init)). How can I perform a sim... | Summary:
- A commit is checked out: test `git rev-parse HEAD 1>/dev/null 2>&1`
- A ref pointing to a commit exists: test `git rev-list -n 1 --all 1>/dev/null 2>&1`
- Objects exist in the repo: test output of `git fsck`, `git count-objects`, or the examine the contents of `.git/objects`
And now for the discussion!
If... |
4612326 | How do I uninstall git version 1.6.5.1 from Mac OS X 10.5.8 | 27 | 2011-01-06 06:19:31 | <p>How do I uninstall git version 1.6.5.1 from Mac OS X 10.5.8?</p>
| 38,022 | 565,033 | 2016-04-18 09:28:45 | 4,612,462 | 40 | 2011-01-06 06:38:42 | null | 2011-01-06 06:38:42 | https://stackoverflow.com/q/4612326 | https://stackoverflow.com/a/4612462 | <p>if <code>which git</code> returns /usr/local/git/bin/git as jimmy pointed out,</p>
<pre><code>rm -rf /usr/local/git
rm /etc/paths.d/git
rm /etc/manpaths.d/git
</code></pre>
<p>should do the trick</p>
<p>source <a href="http://code.google.com/p/git-osx-installer/wiki/Uninstall" rel="noreferrer">here</a></p>
| <p>if <code>which git</code> returns /usr/local/git/bin/git as jimmy pointed out,</p> <pre><code>rm -rf /usr/local/git rm /etc/paths.d/git rm /etc/manpaths.d/git </code></pre> <p>should do the trick</p> <p>source <a href="http://code.google.com/p/git-osx-installer/wiki/Uninstall" rel="noreferrer">here</a></p> | 119, 369 | git, macos | <h1>How do I uninstall git version 1.6.5.1 from Mac OS X 10.5.8</h1>
<p>How do I uninstall git version 1.6.5.1 from Mac OS X 10.5.8?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,066 | git | # How do I uninstall git version 1.6.5.1 from Mac OS X 10.5.8
How do I uninstall git version 1.6.5.1 from Mac OS X 10.5.8? | if `which git` returns /usr/local/git/bin/git as jimmy pointed out,
```
rm -rf /usr/local/git
rm /etc/paths.d/git
rm /etc/manpaths.d/git
```
should do the trick
source [here](http://code.google.com/p/git-osx-installer/wiki/Uninstall) |
77935996 | git commit -S silently fails to sign and continues to commit when using SSH | 26 | 2024-02-04 13:40:08 | <p>I'm trying to set up automatic git commit signatures, however whenever I try to run <code>git commit -am "example"</code> it successfully makes the commit without signing it.</p>
<p>In my git config I have:</p>
<pre><code>...
user.signingkey=/path/to/.ssh/id_ed25519.pub
gpg.format=ssh
commit.gpgsign=true
.... | 7,596 | null | 2024-12-29 00:51:54 | 77,936,238 | 40 | 2024-02-04 14:47:19 | 147,356 | 2024-12-29 00:23:20 | https://stackoverflow.com/q/77935996 | https://stackoverflow.com/a/77936238 | <p>In order for <code>git log</code> or <code>git show</code> to validate ssh signatures, you must create an "allowed signers" file; see the documentation for <a href="https://git-scm.com/docs/git-config#Documentation/git-config.txt-gpgsshallowedSignersFile" rel="noreferrer"><code>gpg.ssh.allowedSignersFile</... | <p>In order for <code>git log</code> or <code>git show</code> to validate ssh signatures, you must create an "allowed signers" file; see the documentation for <a href="https://git-scm.com/docs/git-config#Documentation/git-config.txt-gpgsshallowedSignersFile" rel="noreferrer"><code>gpg.ssh.allowedSignersFile</... | 119 | git | <h1>git commit -S silently fails to sign and continues to commit when using SSH</h1>
<p>I'm trying to set up automatic git commit signatures, however whenever I try to run <code>git commit -am "example"</code> it successfully makes the commit without signing it.</p>
<p>In my git config I have:</p>
<pre><code>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,067 | git | # git commit -S silently fails to sign and continues to commit when using SSH
I'm trying to set up automatic git commit signatures, however whenever I try to run `git commit -am "example"` it successfully makes the commit without signing it.
In my git config I have:
```
...
user.signingkey=/path/to/.ssh/id_ed25519.p... | In order for `git log` or `git show` to validate ssh signatures, you must create an "allowed signers" file; see the documentation for [`gpg.ssh.allowedSignersFile`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-gpgsshallowedSignersFile).
For example, if I configure ssh signing like this:
```
git co... |
49535881 | How to setup a Yocto recipe to build from a local git source? | 26 | 2018-03-28 13:28:13 | <p>I am playing around with Yocto, a Raspberry Pi and some code I have written. I want to build a Yocto image including the program I have written. For this, I want to setup the fetcher to fetch from a local git repo.</p>
<p>My setup is simple. The code is in the directory:</p>
<pre><code>/home/user/git/myTest
</code><... | 37,002 | 3,884,536 | 2025-12-10 10:35:57 | 49,536,202 | 40 | 2018-03-28 13:43:31 | 7,976,758 | 2025-12-10 10:26:27 | https://stackoverflow.com/q/49535881 | https://stackoverflow.com/a/49536202 | <p>The GIT Fetcher in <code>bitbake</code> <a href="https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-fetching.html#git-fetcher-git" rel="nofollow noreferrer">supports different protocols</a>, but with rather peculiar and non-standard syntax. In your case it is:</p>
<pre><code>SRC_URI = &quo... | <p>The GIT Fetcher in <code>bitbake</code> <a href="https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-fetching.html#git-fetcher-git" rel="nofollow noreferrer">supports different protocols</a>, but with rather peculiar and non-standard syntax. In your case it is:</p> <pre><code>SRC_URI = &quo... | 119, 8822, 86061, 104267, 151425 | bitbake, cmake, git, yocto, yocto-recipe | <h1>How to setup a Yocto recipe to build from a local git source?</h1>
<p>I am playing around with Yocto, a Raspberry Pi and some code I have written. I want to build a Yocto image including the program I have written. For this, I want to setup the fetcher to fetch from a local git repo.</p>
<p>My setup is simple. The ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,069 | git | # How to setup a Yocto recipe to build from a local git source?
I am playing around with Yocto, a Raspberry Pi and some code I have written. I want to build a Yocto image including the program I have written. For this, I want to setup the fetcher to fetch from a local git repo.
My setup is simple. The code is in the ... | The GIT Fetcher in `bitbake` [supports different protocols](https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-fetching.html#git-fetcher-git), but with rather peculiar and non-standard syntax. In your case it is:
```
SRC_URI = "git:///home/user/git/myTest/;protocol=file"
``` |
8208274 | Using Jenkins with a private BitBucket Git repository | 26 | 2011-11-21 06:57:05 | <p>When setting up a project in Jenkins that's hosted on bitbucket what would I put in the URL field?</p>
<p>The repository is private.</p>
| 30,314 | 846,389 | 2018-06-10 17:47:56 | 8,223,917 | 40 | 2011-11-22 08:31:13 | 158,304 | 2011-11-22 08:31:13 | https://stackoverflow.com/q/8208274 | https://stackoverflow.com/a/8223917 | <p>I'm not familiar with Jenkins but Bitbucket allows you to clone git repositories over https which can accept the password as part of the url, like so:</p>
<pre><code>https://<user>:<pass>@bitbucket.org/<user>/<project>.git
</code></pre>
| <p>I'm not familiar with Jenkins but Bitbucket allows you to clone git repositories over https which can accept the password as part of the url, like so:</p> <pre><code>https://<user>:<pass>@bitbucket.org/<user>/<project>.git </code></pre> | 119, 8337, 64999 | bitbucket, git, jenkins | <h1>Using Jenkins with a private BitBucket Git repository</h1>
<p>When setting up a project in Jenkins that's hosted on bitbucket what would I put in the URL field?</p>
<p>The repository is private.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,070 | git | # Using Jenkins with a private BitBucket Git repository
When setting up a project in Jenkins that's hosted on bitbucket what would I put in the URL field?
The repository is private. | I'm not familiar with Jenkins but Bitbucket allows you to clone git repositories over https which can accept the password as part of the url, like so:
```
https://<user>:<pass>@bitbucket.org/<user>/<project>.git
``` |
1158857 | How can I work with file '.git/info/exclude' too late? | 26 | 2009-07-21 12:20:47 | <p>I usually do this:</p>
<pre class="lang-none prettyprint-override"><code>git init
git add .
git commit .
</code></pre>
<p>And then I realize that it's about to add my <em>nbproject</em> directory, which I want excluded/ignored. Sometimes, I even check in this directory. Had I added it to <em>.git/info/exclude</em> b... | 12,820 | 8,047 | 2024-05-29 21:04:58 | 1,158,871 | 40 | 2009-07-21 12:24:11 | 893 | 2009-07-21 12:24:11 | https://stackoverflow.com/q/1158857 | https://stackoverflow.com/a/1158871 | <p>To remove a file that you have added but not committed, use a command like this:</p>
<pre><code>git rm --cached file.to.remove
</code></pre>
<p>This will remove the file from the index, but not touch the file on disk.</p>
<p>To remove a file (or files) from the <em>most recent</em> commit, use the above <code>git... | <p>To remove a file that you have added but not committed, use a command like this:</p> <pre><code>git rm --cached file.to.remove </code></pre> <p>This will remove the file from the index, but not touch the file on disk.</p> <p>To remove a file (or files) from the <em>most recent</em> commit, use the above <code>git... | 119, 25056 | git, gitignore | <h1>How can I work with file '.git/info/exclude' too late?</h1>
<p>I usually do this:</p>
<pre class="lang-none prettyprint-override"><code>git init
git add .
git commit .
</code></pre>
<p>And then I realize that it's about to add my <em>nbproject</em> directory, which I want excluded/ignored. Sometimes, I even check i... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,071 | git | # How can I work with file '.git/info/exclude' too late?
I usually do this:
```
git init
git add .
git commit .
```
And then I realize that it's about to add my *nbproject* directory, which I want excluded/ignored. Sometimes, I even check in this directory. Had I added it to *.git/info/exclude* before running `git a... | To remove a file that you have added but not committed, use a command like this:
```
git rm --cached file.to.remove
```
This will remove the file from the index, but not touch the file on disk.
To remove a file (or files) from the *most recent* commit, use the above `git rm --cached` command followed by `git commit ... |
38370723 | How to configure yocto to use the latest git commit? | 25 | 2016-07-14 09:38:41 | <p>I am a very lazy person. While working on a HW/SW project the software changes permanently. In this development stage, changing the commit/reversion-tags in the recipes is very nasty.
I want Yocto to fetch the latest git commit. Is this possible/How to do this?
My example recipe:</p>
<pre><code>SUMMARY = "my test"
... | 32,843 | 3,884,536 | 2023-05-19 18:29:32 | 38,372,518 | 40 | 2016-07-14 11:04:02 | 4,093,778 | 2023-05-19 18:29:32 | https://stackoverflow.com/q/38370723 | https://stackoverflow.com/a/38372518 | <p>Sure, set <code>SRCREV = "${AUTOREV}"</code>.</p>
<p>Furthermore, <a href="https://docs.yoctoproject.org/dev-manual/packages.html#automatically-incrementing-a-package-version-number" rel="noreferrer">you need to reference SRCPV</a> in PV in order to automatically update the version whenever the revision of... | <p>Sure, set <code>SRCREV = "${AUTOREV}"</code>.</p> <p>Furthermore, <a href="https://docs.yoctoproject.org/dev-manual/packages.html#automatically-incrementing-a-package-version-number" rel="noreferrer">you need to reference SRCPV</a> in PV in order to automatically update the version whenever the revision of... | 119, 8465, 86061, 104267 | bitbake, git, recipe, yocto | <h1>How to configure yocto to use the latest git commit?</h1>
<p>I am a very lazy person. While working on a HW/SW project the software changes permanently. In this development stage, changing the commit/reversion-tags in the recipes is very nasty.
I want Yocto to fetch the latest git commit. Is this possible/How to do... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,072 | git | # How to configure yocto to use the latest git commit?
I am a very lazy person. While working on a HW/SW project the software changes permanently. In this development stage, changing the commit/reversion-tags in the recipes is very nasty.
I want Yocto to fetch the latest git commit. Is this possible/How to do this?
My... | Sure, set `SRCREV = "${AUTOREV}"`.
Furthermore, [you need to reference SRCPV](https://docs.yoctoproject.org/dev-manual/packages.html#automatically-incrementing-a-package-version-number) in PV in order to automatically update the version whenever the revision of the source code changes. Here is an example:
```
PV = "... |
23014713 | Run a build task only when changes have been pulled from a git repository | 25 | 2014-04-11 13:56:55 | <p>I have a C++ program hosted in Bitbucket git repository that I'm compiling with CMake. The current play can be seen below. It works fine except <code>build</code>-task is run every time the play is run. Instead I'd like <code>build</code>-task to run only when new software version is pulled by <a href="http://docs.a... | 12,404 | 272,735 | 2014-04-11 14:58:17 | 23,016,074 | 40 | 2014-04-11 14:58:17 | 1,557,277 | 2014-04-11 14:58:17 | https://stackoverflow.com/q/23014713 | https://stackoverflow.com/a/23016074 | <p>You can register variable with output of <code>clone</code> task and invoke <code>build</code> task when state of <code>clone</code> task is changed</p>
<p>For example:</p>
<pre><code>---
# tasks of role: foo
- name: clone repository
git: repo=git@bitbucket.org:foo/foo.git
dest={{ foo.dir }}
accep... | <p>You can register variable with output of <code>clone</code> task and invoke <code>build</code> task when state of <code>clone</code> task is changed</p> <p>For example:</p> <pre><code>--- # tasks of role: foo - name: clone repository git: repo=git@bitbucket.org:foo/foo.git dest={{ foo.dir }} accep... | 119, 86394 | ansible, git | <h1>Run a build task only when changes have been pulled from a git repository</h1>
<p>I have a C++ program hosted in Bitbucket git repository that I'm compiling with CMake. The current play can be seen below. It works fine except <code>build</code>-task is run every time the play is run. Instead I'd like <code>build</c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,073 | git | # Run a build task only when changes have been pulled from a git repository
I have a C++ program hosted in Bitbucket git repository that I'm compiling with CMake. The current play can be seen below. It works fine except `build`-task is run every time the play is run. Instead I'd like `build`-task to run only when new ... | You can register variable with output of `clone` task and invoke `build` task when state of `clone` task is changed
For example:
```
---
# tasks of role: foo
- name: clone repository
git: repo=git@bitbucket.org:foo/foo.git
dest={{ foo.dir }}
accept_hostkey=yes
register: gitclone
- name: create bui... |
5790333 | How do I create a remote git repository in EGit and link it to an existing Eclipse project? | 25 | 2011-04-26 12:31:18 | <p>I am using Eclipse Helios and EGit. I am new to Git. I have an existing Eclipse project for an Android app I would like to place in Git. Can someone please share some instructions on how to setup a Git repo on a shared folder, and place the existing project into this git repo using EGit? I have tried a variety o... | 45,405 | 714,122 | 2022-04-12 02:24:12 | 18,056,388 | 40 | 2013-08-05 10:51:15 | 724,027 | 2022-04-12 02:24:12 | https://stackoverflow.com/q/5790333 | https://stackoverflow.com/a/18056388 | <p>I had the same question (how to do it in Eclipse / eGit), and I just found the answer to the question stated in the title :</p>
<ol>
<li><strong>either</strong> go to <code>Window</code> > <code>Show View</code> > <code>Other...</code> then select <code>Git</code> > <code>Git repositories</code> <strong>or<... | <p>I had the same question (how to do it in Eclipse / eGit), and I just found the answer to the question stated in the title :</p> <ol> <li><strong>either</strong> go to <code>Window</code> > <code>Show View</code> > <code>Other...</code> then select <code>Git</code> > <code>Git repositories</code> <strong>or<... | 53, 119, 43702 | eclipse, egit, git | <h1>How do I create a remote git repository in EGit and link it to an existing Eclipse project?</h1>
<p>I am using Eclipse Helios and EGit. I am new to Git. I have an existing Eclipse project for an Android app I would like to place in Git. Can someone please share some instructions on how to setup a Git repo on a s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,074 | git | # How do I create a remote git repository in EGit and link it to an existing Eclipse project?
I am using Eclipse Helios and EGit. I am new to Git. I have an existing Eclipse project for an Android app I would like to place in Git. Can someone please share some instructions on how to setup a Git repo on a shared folder... | I had the same question (how to do it in Eclipse / eGit), and I just found the answer to the question stated in the title :
1. **either** go to `Window` > `Show View` > `Other...` then select `Git` > `Git repositories` **or** click the Git repositories icon in the set of icons in the right
2. expand the repository to ... |
33906391 | How can I re-init my git repo? | 24 | 2015-11-25 00:20:05 | <p>I've been doing some beginning work on a repo and I don't need the history.</p>
<p>I want to start from ground zero w/ no history?</p>
<p>Can I simply delete the <code>.git</code> folder and run <code>git init</code> again.</p>
<p>But how will this effect my remote repos?</p>
| 45,056 | 5,021,893 | 2021-03-18 10:27:16 | 33,906,424 | 40 | 2015-11-25 00:23:26 | 1,084,774 | 2015-11-25 00:23:26 | https://stackoverflow.com/q/33906391 | https://stackoverflow.com/a/33906424 | <pre><code>cd "$PWD/`git rev-parse --show-cdup`" #go to the project's root
rm -rf .git
</code></pre>
<p>And then:</p>
<pre><code>git init .
#...
</code></pre>
<p>As for your remote repos, you'll need to <code>git push --force</code> into them (or push to a new, completely separate branch).</p>
| <pre><code>cd "$PWD/`git rev-parse --show-cdup`" #go to the project's root rm -rf .git </code></pre> <p>And then:</p> <pre><code>git init . #... </code></pre> <p>As for your remote repos, you'll need to <code>git push --force</code> into them (or push to a new, completely separate branch).</p> | 119 | git | <h1>How can I re-init my git repo?</h1>
<p>I've been doing some beginning work on a repo and I don't need the history.</p>
<p>I want to start from ground zero w/ no history?</p>
<p>Can I simply delete the <code>.git</code> folder and run <code>git init</code> again.</p>
<p>But how will this effect my remote repos?</... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,075 | git | # How can I re-init my git repo?
I've been doing some beginning work on a repo and I don't need the history.
I want to start from ground zero w/ no history?
Can I simply delete the `.git` folder and run `git init` again.
But how will this effect my remote repos? | ```
cd "$PWD/`git rev-parse --show-cdup`" #go to the project's root
rm -rf .git
```
And then:
```
git init .
#...
```
As for your remote repos, you'll need to `git push --force` into them (or push to a new, completely separate branch). |
10184637 | git revert commit/push but keep changes | 23 | 2012-04-17 03:28:18 | <p>It goes like this:</p>
<ul>
<li><p>I have files A and B that I modified</p></li>
<li><p>I'm only suppose to commit and push A, but accidentally committed both and pushed both A and B</p></li>
<li><p>I did a "git push old-id:master" so on github it shows "Master is now old-id" where old-id is the last commit before ... | 17,923 | 1,012,138 | 2012-04-17 03:31:08 | 10,184,659 | 40 | 2012-04-17 03:31:08 | 148,870 | 2012-04-17 03:31:08 | https://stackoverflow.com/q/10184637 | https://stackoverflow.com/a/10184659 | <pre><code>$ git reset <old-id> # Undo the commit after old-id
$ git add A # stage A for a new commit
$ git commit # make the new commit
$ git push # push it
</code></pre>
| <pre><code>$ git reset <old-id> # Undo the commit after old-id $ git add A # stage A for a new commit $ git commit # make the new commit $ git push # push it </code></pre> | 119, 5597, 12309 | commit, git, revert | <h1>git revert commit/push but keep changes</h1>
<p>It goes like this:</p>
<ul>
<li><p>I have files A and B that I modified</p></li>
<li><p>I'm only suppose to commit and push A, but accidentally committed both and pushed both A and B</p></li>
<li><p>I did a "git push old-id:master" so on github it shows "Master is no... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,076 | git | # git revert commit/push but keep changes
It goes like this:
- I have files A and B that I modified
- I'm only suppose to commit and push A, but accidentally committed both and pushed both A and B
- I did a "git push old-id:master" so on github it shows "Master is now old-id" where old-id is the last commit before me... | ```
$ git reset <old-id> # Undo the commit after old-id
$ git add A # stage A for a new commit
$ git commit # make the new commit
$ git push # push it
``` |
2876477 | What are the advantages of a rebase over a merge in git? | 23 | 2010-05-20 17:56:00 | <p>In <a href="http://eagain.net/articles/git-for-computer-scientists/" rel="noreferrer">this article</a>, the author explains rebasing with this diagram:</p>
<p><a href="https://i.sstatic.net/XodLC.png" rel="noreferrer"><img src="https://i.sstatic.net/XodLC.png" alt="enter image description here"></a></p>
<blockquot... | 8,415 | 113,124 | 2019-05-13 02:16:03 | 2,876,589 | 40 | 2010-05-20 18:10:35 | 119,963 | 2010-05-20 18:10:35 | https://stackoverflow.com/q/2876477 | https://stackoverflow.com/a/2876589 | <p>There are variety of situations in which you might want to rebase.</p>
<ul>
<li><p>You develop a few parts of a feature on separate branches, then realize they're in reality a linear progression of ideas. Rebase them into that configuration.</p></li>
<li><p>You fork a topic from the wrong place. Maybe it's too earl... | <p>There are variety of situations in which you might want to rebase.</p> <ul> <li><p>You develop a few parts of a feature on separate branches, then realize they're in reality a linear progression of ideas. Rebase them into that configuration.</p></li> <li><p>You fork a topic from the wrong place. Maybe it's too earl... | 119, 248, 456, 3346 | algorithm, dvcs, git, version-control | <h1>What are the advantages of a rebase over a merge in git?</h1>
<p>In <a href="http://eagain.net/articles/git-for-computer-scientists/" rel="noreferrer">this article</a>, the author explains rebasing with this diagram:</p>
<p><a href="https://i.sstatic.net/XodLC.png" rel="noreferrer"><img src="https://i.sstatic.net/... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,077 | git | # What are the advantages of a rebase over a merge in git?
In [this article](http://eagain.net/articles/git-for-computer-scientists/), the author explains rebasing with this diagram:
[](https://i.sstatic.net/XodLC.png)
> **Rebase:** If you have not yet ... | There are variety of situations in which you might want to rebase.
- You develop a few parts of a feature on separate branches, then realize they're in reality a linear progression of ideas. Rebase them into that configuration.
- You fork a topic from the wrong place. Maybe it's too early (you need something from late... |
26734933 | How to set up git over http? | 21 | 2014-11-04 12:15:45 | <p>I need to set up a git server with git-over-http (smart http), but the resources available online are a mess, mixing in other apache configuration, missing details or not being explicit enough.</p>
<p>I am answering this question myself based on what I found lacking in the available resources.</p>
| 47,932 | 584,405 | 2018-05-13 14:18:43 | 26,734,934 | 40 | 2014-11-04 12:15:45 | 584,405 | 2016-12-09 19:43:26 | https://stackoverflow.com/q/26734933 | https://stackoverflow.com/a/26734934 | <p>First it is necessary to understand that there are 2 components to git-over-http: git and apache. These two are connected through a script with the name of git-http-backend. The challenge is to configure the interface between these two components, so that http requests to git are forwarded by apache.</p>
<p><strong... | <p>First it is necessary to understand that there are 2 components to git-over-http: git and apache. These two are connected through a script with the name of git-http-backend. The challenge is to configure the interface between these two components, so that http requests to git are forwarded by apache.</p> <p><strong... | 80, 119, 5210, 124638 | apache, git, git-http-backend, http | <h1>How to set up git over http?</h1>
<p>I need to set up a git server with git-over-http (smart http), but the resources available online are a mess, mixing in other apache configuration, missing details or not being explicit enough.</p>
<p>I am answering this question myself based on what I found lacking in the avai... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,079 | git | # How to set up git over http?
I need to set up a git server with git-over-http (smart http), but the resources available online are a mess, mixing in other apache configuration, missing details or not being explicit enough.
I am answering this question myself based on what I found lacking in the available resources. | First it is necessary to understand that there are 2 components to git-over-http: git and apache. These two are connected through a script with the name of git-http-backend. The challenge is to configure the interface between these two components, so that http requests to git are forwarded by apache.
**Note:** Securit... |
10774008 | How to move local git repo from one hdd to another hdd? | 21 | 2012-05-27 12:33:13 | <p>I'm currently setting up git on one of my local hdds, but will eventually be moving all my git repos on to another hdd (I want to split my work files from my own files, but I do not have the drives yet). Would it be possible to move those local work git repos to the new hdds by just dragging and dropping?</p>
<p>I... | 32,250 | 629,290 | 2012-08-27 13:30:43 | 10,774,024 | 40 | 2012-05-27 12:37:10 | 1,191,373 | 2012-05-27 23:53:41 | https://stackoverflow.com/q/10774008 | https://stackoverflow.com/a/10774024 | <p>Yes, you can simply copy all the files to your other computer. But make sure to also copy the "hidden" files, meaning the files that names are starting with a dot.</p>
<p>Here's a link to a Page describing how to <a href="http://osxdaily.com/2009/02/25/show-hidden-files-in-os-x/" rel="noreferrer">make the hidden fi... | <p>Yes, you can simply copy all the files to your other computer. But make sure to also copy the "hidden" files, meaning the files that names are starting with a dot.</p> <p>Here's a link to a Page describing how to <a href="http://osxdaily.com/2009/02/25/show-hidden-files-in-os-x/" rel="noreferrer">make the hidden fi... | 119, 7330, 13461 | git, nas, repository | <h1>How to move local git repo from one hdd to another hdd?</h1>
<p>I'm currently setting up git on one of my local hdds, but will eventually be moving all my git repos on to another hdd (I want to split my work files from my own files, but I do not have the drives yet). Would it be possible to move those local work g... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,080 | git | # How to move local git repo from one hdd to another hdd?
I'm currently setting up git on one of my local hdds, but will eventually be moving all my git repos on to another hdd (I want to split my work files from my own files, but I do not have the drives yet). Would it be possible to move those local work git repos t... | Yes, you can simply copy all the files to your other computer. But make sure to also copy the "hidden" files, meaning the files that names are starting with a dot.
Here's a link to a Page describing how to [make the hidden files appear in the finder](http://osxdaily.com/2009/02/25/show-hidden-files-in-os-x/).
Each an... |
61101080 | What is a "label" when rebasing interactively in Git | 19 | 2020-04-08 12:49:29 | <p>When interactively rebasing, Git will open an editor with commands one can use. Three of these commands have to do with something called <code>label</code>.</p>
<pre><code># l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c &l... | 4,279 | 213,643 | 2020-04-08 14:40:28 | 61,103,385 | 40 | 2020-04-08 14:40:28 | 1,256,452 | 2020-04-08 14:40:28 | https://stackoverflow.com/q/61101080 | https://stackoverflow.com/a/61103385 | <p><a href="https://stackoverflow.com/questions/61101080/what-is-a-label-when-rebasing-interactively-in-git#comment108095918_61101080">chepner's comment</a> is exactly right: labels are how <code>git rebase --rebase-merges</code> works. If you're not using <code>--rebase-merges</code> you don't need to know anything f... | <p><a href="https://stackoverflow.com/questions/61101080/what-is-a-label-when-rebasing-interactively-in-git#comment108095918_61101080">chepner's comment</a> is exactly right: labels are how <code>git rebase --rebase-merges</code> works. If you're not using <code>--rebase-merges</code> you don't need to know anything f... | 119, 29934 | git, git-rebase | <h1>What is a "label" when rebasing interactively in Git</h1>
<p>When interactively rebasing, Git will open an editor with commands one can use. Three of these commands have to do with something called <code>label</code>.</p>
<pre><code># l, label <label> = label current HEAD with a name
# t, reset <label>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,084 | git | # What is a "label" when rebasing interactively in Git
When interactively rebasing, Git will open an editor with commands one can use. Three of these commands have to do with something called `label`.
```
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <co... | [chepner's comment](https://stackoverflow.com/questions/61101080/what-is-a-label-when-rebasing-interactively-in-git#comment108095918_61101080) is exactly right: labels are how `git rebase --rebase-merges` works. If you're not using `--rebase-merges` you don't need to know anything further.
### Rebasing as a concept
R... |
29608028 | How to redo a merge conflict resolution (before committing the merge)? | 19 | 2015-04-13 14:35:15 | <p>I did a</p>
<pre><code>git merge FETCH_HEAD
</code></pre>
<p>and, after git told me that there is a conflict in one file, I did a</p>
<pre><code>git mergetool
</code></pre>
<p>which in my case runs SourceGear DiffMerge as a GUI mergetool. Immediately after saving the merged file, I realized that I made a bad mistake... | 11,432 | 1,934,428 | 2024-11-22 11:54:46 | 29,609,456 | 40 | 2015-04-13 15:40:02 | 1,290,731 | 2021-03-29 12:00:08 | https://stackoverflow.com/q/29608028 | https://stackoverflow.com/a/29609456 | <p>To undo a bad conflict resolution before committing, <code>git checkout -m -- $thefile</code>.</p>
<pre><code>$ git merge 3fac3
Auto-merging file.txt
CONFLICT (content): Merge conflict in file.txt
Automatic merge failed; fix conflicts and then commit the result.
$ vi file.txt # fix all the conflicts. do it w... | <p>To undo a bad conflict resolution before committing, <code>git checkout -m -- $thefile</code>.</p> <pre><code>$ git merge 3fac3 Auto-merging file.txt CONFLICT (content): Merge conflict in file.txt Automatic merge failed; fix conflicts and then commit the result. $ vi file.txt # fix all the conflicts. do it w... | 119, 717 | git, merge | <h1>How to redo a merge conflict resolution (before committing the merge)?</h1>
<p>I did a</p>
<pre><code>git merge FETCH_HEAD
</code></pre>
<p>and, after git told me that there is a conflict in one file, I did a</p>
<pre><code>git mergetool
</code></pre>
<p>which in my case runs SourceGear DiffMerge as a GUI mergetool... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,085 | git | # How to redo a merge conflict resolution (before committing the merge)?
I did a
```
git merge FETCH_HEAD
```
and, after git told me that there is a conflict in one file, I did a
```
git mergetool
```
which in my case runs SourceGear DiffMerge as a GUI mergetool. Immediately after saving the merged file, I realize... | To undo a bad conflict resolution before committing, `git checkout -m -- $thefile`.
```
$ git merge 3fac3
Auto-merging file.txt
CONFLICT (content): Merge conflict in file.txt
Automatic merge failed; fix conflicts and then commit the result.
$ vi file.txt # fix all the conflicts. do it wrong.
$ git add file.txt... |
5984428 | How to delete the old history after running git filter-branch? | 19 | 2011-05-12 21:01:38 | <p>Suppose I have such tree:</p>
<pre><code>... -- a -- b -- c -- d -- ...
\
e -- a -- k
</code></pre>
<p>and I want it become just </p>
<pre><code>... -- a -- b -- c -- d -- ...
</code></pre>
<p>I know how to attach branch name to "e". I know that what I'm going to do will change history... | 10,063 | 117,544 | 2015-07-24 16:45:29 | 5,985,276 | 40 | 2011-05-12 22:33:07 | 123,109 | 2011-05-15 11:37:26 | https://stackoverflow.com/q/5984428 | https://stackoverflow.com/a/5985276 | <p>After importing a Subversion repository with multiple years of history, I ran into a similar problem with bloat from lots of binary assets. In <a href="http://blog.gbacon.com/2009/08/git-shrinking-subversion-import.html">git: shrinking Subversion import</a>, I describe trimming my git repo from 4.5 GiB to around 100... | <p>After importing a Subversion repository with multiple years of history, I ran into a similar problem with bloat from lots of binary assets. In <a href="http://blog.gbacon.com/2009/08/git-shrinking-subversion-import.html">git: shrinking Subversion import</a>, I describe trimming my git repo from 4.5 GiB to around 100... | 119, 46509, 76220 | git, git-branch, git-filter-branch | <h1>How to delete the old history after running git filter-branch?</h1>
<p>Suppose I have such tree:</p>
<pre><code>... -- a -- b -- c -- d -- ...
\
e -- a -- k
</code></pre>
<p>and I want it become just </p>
<pre><code>... -- a -- b -- c -- d -- ...
</code></pre>
<p>I know how to attach ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,086 | git | # How to delete the old history after running git filter-branch?
Suppose I have such tree:
```
... -- a -- b -- c -- d -- ...
\
e -- a -- k
```
and I want it become just
```
... -- a -- b -- c -- d -- ...
```
I know how to attach branch name to "e". I know that what I'm going to do will ... | After importing a Subversion repository with multiple years of history, I ran into a similar problem with bloat from lots of binary assets. In [git: shrinking Subversion import](http://blog.gbacon.com/2009/08/git-shrinking-subversion-import.html), I describe trimming my git repo from 4.5 GiB to around 100 MiB.
Assumin... |
14937405 | npm git protocol dependencies | 17 | 2013-02-18 13:25:17 | <p>At work we are behind an HTTP Proxy and the git protocol (port 9418) is denied.
My project has NPM dependencies and some of these dependencies have dependencies that use the git protocol, for instance:</p>
<p>In my <code>package.json</code></p>
<pre><code>"dependencies": {
"jsdoc3" : "git+https://github.com/j... | 11,484 | 777,292 | 2021-02-10 10:58:44 | 19,710,050 | 40 | 2013-10-31 15:05:34 | 1,398,908 | 2013-10-31 15:05:34 | https://stackoverflow.com/q/14937405 | https://stackoverflow.com/a/19710050 | <p>You can tell git to use https instead of git:// with the following command:</p>
<pre><code>git config --global url."https://".insteadOf git://
</code></pre>
| <p>You can tell git to use https instead of git:// with the following command:</p> <pre><code>git config --global url."https://".insteadOf git:// </code></pre> | 119, 61387 | git, npm | <h1>npm git protocol dependencies</h1>
<p>At work we are behind an HTTP Proxy and the git protocol (port 9418) is denied.
My project has NPM dependencies and some of these dependencies have dependencies that use the git protocol, for instance:</p>
<p>In my <code>package.json</code></p>
<pre><code>"dependencies": {
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,088 | git | # npm git protocol dependencies
At work we are behind an HTTP Proxy and the git protocol (port 9418) is denied.
My project has NPM dependencies and some of these dependencies have dependencies that use the git protocol, for instance:
In my `package.json`
```
"dependencies": {
"jsdoc3" : "git+https://github.com/j... | You can tell git to use https instead of git:// with the following command:
```
git config --global url."https://".insteadOf git://
``` |
6351182 | App pushed to heroku still shows standard index page | 17 | 2011-06-14 23:01:50 | <p>I went through the steps to install git and the heroku gem and successfully pushed my app to heroku.
The problem is, it shows a standard "You're Riding Ruby on Rails" page even though the local app I have has routes set up to root to a certain controller/page. I have also deleted the index.html page from /public.</p... | 7,011 | 705,725 | 2012-06-06 14:34:28 | 6,351,705 | 40 | 2011-06-15 00:23:21 | 214,790 | 2012-06-06 14:34:28 | https://stackoverflow.com/q/6351182 | https://stackoverflow.com/a/6351705 | <p>When you're using git and delete a file, that file is not automatically removed from the git repo. So when you <code>git push heroku</code> the file still exists and gets pushed to Heroku.</p>
<p>You can tell if this is the case with <code>git status</code>, which will show something like:</p>
<pre><code># Changes... | <p>When you're using git and delete a file, that file is not automatically removed from the git repo. So when you <code>git push heroku</code> the file still exists and gets pushed to Heroku.</p> <p>You can tell if this is the case with <code>git status</code>, which will show something like:</p> <pre><code># Changes... | 12, 119, 190, 4984, 8279 | deployment, git, heroku, ruby, ruby-on-rails | <h1>App pushed to heroku still shows standard index page</h1>
<p>I went through the steps to install git and the heroku gem and successfully pushed my app to heroku.
The problem is, it shows a standard "You're Riding Ruby on Rails" page even though the local app I have has routes set up to root to a certain controller/... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,089 | git | # App pushed to heroku still shows standard index page
I went through the steps to install git and the heroku gem and successfully pushed my app to heroku.
The problem is, it shows a standard "You're Riding Ruby on Rails" page even though the local app I have has routes set up to root to a certain controller/page. I h... | When you're using git and delete a file, that file is not automatically removed from the git repo. So when you `git push heroku` the file still exists and gets pushed to Heroku.
You can tell if this is the case with `git status`, which will show something like:
```
# Changes not staged for commit:
# (use "git add/r... |
49197652 | Expected linebreaks to be 'LF' but found CRLF | 13 | 2018-03-09 16:02:30 | <p>I'm using Visual Studio code and have inherited a project that uses 'LF' line endings. By default Visual Studio Code opens my files in CRLF (i'm using Windows 10) which causes my git pre-commit hooks to fail. I don't get any error messages if I switch Visual Studio Code to use LF at the bottom right of the screen bu... | 23,801 | 3,955,685 | 2023-08-31 05:10:31 | 53,285,757 | 40 | 2018-11-13 16:45:49 | 5,519,872 | 2022-06-15 10:20:59 | https://stackoverflow.com/q/49197652 | https://stackoverflow.com/a/53285757 | <p><strong>Note - Make sure you don't have any uncommitted changes else it will be deleted when you run the following cmd!</strong></p>
<p>Run this in your terminal or cmd prompt</p>
<pre><code>git config core.autocrlf false
git rm --cached -r .
git reset --hard
</code></pre>
<p>This usually happens when the project is... | <p><strong>Note - Make sure you don't have any uncommitted changes else it will be deleted when you run the following cmd!</strong></p> <p>Run this in your terminal or cmd prompt</p> <pre><code>git config core.autocrlf false git rm --cached -r . git reset --hard </code></pre> <p>This usually happens when the project is... | 3, 119, 33953 | git, javascript, visual-studio | <h1>Expected linebreaks to be 'LF' but found CRLF</h1>
<p>I'm using Visual Studio code and have inherited a project that uses 'LF' line endings. By default Visual Studio Code opens my files in CRLF (i'm using Windows 10) which causes my git pre-commit hooks to fail. I don't get any error messages if I switch Visual Stu... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,090 | git | # Expected linebreaks to be 'LF' but found CRLF
I'm using Visual Studio code and have inherited a project that uses 'LF' line endings. By default Visual Studio Code opens my files in CRLF (i'm using Windows 10) which causes my git pre-commit hooks to fail. I don't get any error messages if I switch Visual Studio Code ... | **Note - Make sure you don't have any uncommitted changes else it will be deleted when you run the following cmd!**
Run this in your terminal or cmd prompt
```
git config core.autocrlf false
git rm --cached -r .
git reset --hard
```
This usually happens when the project is created on UNIX based system & then used on... |
52529639 | GnuTLS recv error (-110): The TLS connection was non-properly terminated | 13 | 2018-09-27 04:51:15 | <p>I'm preparing to install <a href="https://github.com/valloric/youcompleteme" rel="noreferrer">vim plugin</a> by vundle, after I set the vimrc</p>
<pre><code>set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'valloric/youcompleteme'
call vundle#... | 80,474 | 8,893,702 | 2024-06-17 07:58:14 | 52,530,617 | 40 | 2018-09-27 06:19:58 | 8,893,702 | 2018-09-27 06:29:14 | https://stackoverflow.com/q/52529639 | https://stackoverflow.com/a/52530617 | <p>Recompile and install git solve it finally, the steps are the following: </p>
<pre><code>sudo apt-get install build-essential fakeroot dpkg-dev -y
sudo apt-get build-dep git -y
sudo apt-get install libcurl4-openssl-dev -y
cd ~
mkdir source-git
cd source-git/
apt-get source git
cd git-2.*.*/
sed -i -- 's/libcurl4-gn... | <p>Recompile and install git solve it finally, the steps are the following: </p> <pre><code>sudo apt-get install build-essential fakeroot dpkg-dev -y sudo apt-get build-dep git -y sudo apt-get install libcurl4-openssl-dev -y cd ~ mkdir source-git cd source-git/ apt-get source git cd git-2.*.*/ sed -i -- 's/libcurl4-gn... | 119, 370, 386, 92385 | git, ssh, vim, vundle | <h1>GnuTLS recv error (-110): The TLS connection was non-properly terminated</h1>
<p>I'm preparing to install <a href="https://github.com/valloric/youcompleteme" rel="noreferrer">vim plugin</a> by vundle, after I set the vimrc</p>
<pre><code>set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,091 | git | # GnuTLS recv error (-110): The TLS connection was non-properly terminated
I'm preparing to install [vim plugin](https://github.com/valloric/youcompleteme) by vundle, after I set the vimrc
```
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'vall... | Recompile and install git solve it finally, the steps are the following:
```
sudo apt-get install build-essential fakeroot dpkg-dev -y
sudo apt-get build-dep git -y
sudo apt-get install libcurl4-openssl-dev -y
cd ~
mkdir source-git
cd source-git/
apt-get source git
cd git-2.*.*/
sed -i -- 's/libcurl4-gnutls-dev/libcur... |
70982479 | MacOS Monterey and Android Studio Bumblebee, "Git is not installed" | 12 | 2022-02-04 06:53:59 | <p>After upgrading Android Studio to Bumblebee version, I encountered this error.</p>
<p>Xcode has been installed, but currently is uninstalled.</p>
| 7,646 | 3,260,008 | 2024-10-18 02:49:29 | 70,982,480 | 40 | 2022-02-04 06:53:59 | 3,260,008 | 2022-09-10 08:22:03 | https://stackoverflow.com/q/70982479 | https://stackoverflow.com/a/70982480 | <ol>
<li>Follow the suggestion, Terminal run <code>xcode-select --install</code></li>
<li>Then run <code>sudo xcode-select --reset</code>, this will reset its path</li>
<li>Update Android Studio > Preference > Version Control > Git > Path to <code>/Library/Developer/CommandLineTools/usr/bin/git</code></li>
... | <ol> <li>Follow the suggestion, Terminal run <code>xcode-select --install</code></li> <li>Then run <code>sudo xcode-select --reset</code>, this will reset its path</li> <li>Update Android Studio > Preference > Version Control > Git > Path to <code>/Library/Developer/CommandLineTools/usr/bin/git</code></li> ... | 119, 91905, 151487 | android-studio, git, macos-monterey | <h1>MacOS Monterey and Android Studio Bumblebee, "Git is not installed"</h1>
<p>After upgrading Android Studio to Bumblebee version, I encountered this error.</p>
<p>Xcode has been installed, but currently is uninstalled.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,092 | git | # MacOS Monterey and Android Studio Bumblebee, "Git is not installed"
After upgrading Android Studio to Bumblebee version, I encountered this error.
Xcode has been installed, but currently is uninstalled. | 1. Follow the suggestion, Terminal run `xcode-select --install`
2. Then run `sudo xcode-select --reset`, this will reset its path
3. Update Android Studio > Preference > Version Control > Git > Path to `/Library/Developer/CommandLineTools/usr/bin/git`
4. Invalidate cache and restart the android studio (optional)
5. Wor... |
39791995 | The files .DS_Store and .DS_Store had a tree conflict error from Git in xcode 8 | 12 | 2016-09-30 12:52:33 | <p>I'm using GitHub as project repository for ios project. But whenever I'm trying to pull project from xcode 8 I'm getting the following error:</p>
<blockquote>
<p>The files .DS_Store and .DS_Store had a tree conflict</p>
</blockquote>
<p>Any solution?</p>
| 26,896 | 5,238,800 | 2019-12-01 00:49:09 | 39,798,204 | 40 | 2016-09-30 18:48:49 | 1,987,319 | 2019-12-01 00:49:09 | https://stackoverflow.com/q/39791995 | https://stackoverflow.com/a/39798204 | <p>.DS_Store is a file that Mac makes to index folders. These are automatically created files and keeps on changing.</p>
<p>Even if you deleted it from Git and download again, you would, in future, start getting the same error because next time you commit and push, a new .DS_Store file will be at git remote.</p>
<p>W... | <p>.DS_Store is a file that Mac makes to index folders. These are automatically created files and keeps on changing.</p> <p>Even if you deleted it from Git and download again, you would, in future, start getting the same error because next time you commit and push, a new .DS_Store file will be at git remote.</p> <p>W... | 119, 120358 | git, xcode8 | <h1>The files .DS_Store and .DS_Store had a tree conflict error from Git in xcode 8</h1>
<p>I'm using GitHub as project repository for ios project. But whenever I'm trying to pull project from xcode 8 I'm getting the following error:</p>
<blockquote>
<p>The files .DS_Store and .DS_Store had a tree conflict</p>
</blo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,093 | git | # The files .DS_Store and .DS_Store had a tree conflict error from Git in xcode 8
I'm using GitHub as project repository for ios project. But whenever I'm trying to pull project from xcode 8 I'm getting the following error:
> The files .DS_Store and .DS_Store had a tree conflict
Any solution? | .DS_Store is a file that Mac makes to index folders. These are automatically created files and keeps on changing.
Even if you deleted it from Git and download again, you would, in future, start getting the same error because next time you commit and push, a new .DS_Store file will be at git remote.
What you need to d... |
2993902 | How do I check the date and time of the latest `git pull` that was executed? | 122 | 2010-06-07 23:34:38 | <p>How do I check the date and time of the latest <code>git pull</code> that was executed? I frequently need to know when the code changed on a server when something goes wrong.</p>
| 113,904 | 135,414 | 2025-09-18 14:56:35 | 2,993,912 | 39 | 2010-06-07 23:37:04 | 893 | 2010-06-07 23:37:04 | https://stackoverflow.com/q/2993902 | https://stackoverflow.com/a/2993912 | <p>The <a href="http://www.kernel.org/pub/software/scm/git/docs/git-show.html" rel="noreferrer"><code>git show</code></a> command shows the date of the most recent commit. This isn't the date at which the commit was pulled to the local repository, but Git doesn't keep such pull information.</p>
<p>You may be able to f... | <p>The <a href="http://www.kernel.org/pub/software/scm/git/docs/git-show.html" rel="noreferrer"><code>git show</code></a> command shows the date of the most recent commit. This isn't the date at which the commit was pulled to the local repository, but Git doesn't keep such pull information.</p> <p>You may be able to f... | 119, 28896 | git, git-pull | <h1>How do I check the date and time of the latest `git pull` that was executed?</h1>
<p>How do I check the date and time of the latest <code>git pull</code> that was executed? I frequently need to know when the code changed on a server when something goes wrong.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,094 | git | # How do I check the date and time of the latest `git pull` that was executed?
How do I check the date and time of the latest `git pull` that was executed? I frequently need to know when the code changed on a server when something goes wrong. | The [`git show`](http://www.kernel.org/pub/software/scm/git/docs/git-show.html) command shows the date of the most recent commit. This isn't the date at which the commit was pulled to the local repository, but Git doesn't keep such pull information.
You may be able to find the time of the last pull using the ctime (cr... |
3290512 | Can I make git diff ignore permission changes | 96 | 2010-07-20 13:38:58 | <p>I inadvertedly change the permissions of my entire tree and commit that change along with other content changes.</p>
<p>I use something like : <pre>tar -czf deploy.tar <code>git diff --name-only v1 v2</code></pre></p>
<p>to generate a tar with the modified files between two tags, the problem is that now because of ... | 57,213 | 61,327 | 2022-08-19 19:43:25 | 54,335,167 | 39 | 2019-01-23 20:31:12 | 103,577 | 2021-02-12 23:30:24 | https://stackoverflow.com/q/3290512 | https://stackoverflow.com/a/54335167 | <p>Use the <code>-G<regex></code> option ("Look for differences whose patch text contains added/removed lines that match <code><regex></code>.") searching for any changes at all - i.e. <code>.</code>. Permissions-only changes don't match this, so they are ignored.</p>
<p>So: <code>git diff -G.</co... | <p>Use the <code>-G<regex></code> option ("Look for differences whose patch text contains added/removed lines that match <code><regex></code>.") searching for any changes at all - i.e. <code>.</code>. Permissions-only changes don't match this, so they are ignored.</p> <p>So: <code>git diff -G.</co... | 119, 606 | diff, git | <h1>Can I make git diff ignore permission changes</h1>
<p>I inadvertedly change the permissions of my entire tree and commit that change along with other content changes.</p>
<p>I use something like : <pre>tar -czf deploy.tar <code>git diff --name-only v1 v2</code></pre></p>
<p>to generate a tar with the modified file... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,095 | git | # Can I make git diff ignore permission changes
I inadvertedly change the permissions of my entire tree and commit that change along with other content changes.
I use something like :
```
tar -czf deploy.tar git diff --name-only v1 v2
```
to generate a tar with the modified files between two tags, the problem is th... | Use the `-G<regex>` option ("Look for differences whose patch text contains added/removed lines that match `<regex>`.") searching for any changes at all - i.e. `.`. Permissions-only changes don't match this, so they are ignored.
So: `git diff -G.` |
12569705 | error: cannot run ssh: No such file or directory when trying to clone on windows | 88 | 2012-09-24 17:09:53 | <p>I am trying to clone a remote repository on Windows, but when I did this:</p>
<pre><code>git clone git@github.com:organization/xxx.git
</code></pre>
<p>I got this error:</p>
<pre><code>error: cannot run ssh: No such file or directory
fatal: unable to fork
</code></pre>
<p>Am I missing something?</p>
| 189,270 | 602,257 | 2024-07-16 20:32:51 | 12,569,731 | 39 | 2012-09-24 17:11:54 | 710,388 | 2012-09-24 17:11:54 | https://stackoverflow.com/q/12569705 | https://stackoverflow.com/a/12569731 | <p>You don't have ssh installed (or don't have it within your search path).</p>
<p>You can clone from github via http, too:</p>
<pre><code>git clone http://github.com/organization/xxx
</code></pre>
| <p>You don't have ssh installed (or don't have it within your search path).</p> <p>You can clone from github via http, too:</p> <pre><code>git clone http://github.com/organization/xxx </code></pre> | 64, 119, 34099 | git, git-clone, windows | <h1>error: cannot run ssh: No such file or directory when trying to clone on windows</h1>
<p>I am trying to clone a remote repository on Windows, but when I did this:</p>
<pre><code>git clone git@github.com:organization/xxx.git
</code></pre>
<p>I got this error:</p>
<pre><code>error: cannot run ssh: No such file or dir... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,096 | git | # error: cannot run ssh: No such file or directory when trying to clone on windows
I am trying to clone a remote repository on Windows, but when I did this:
```
git clone git@github.com:organization/xxx.git
```
I got this error:
```
error: cannot run ssh: No such file or directory
fatal: unable to fork
```
Am I mi... | You don't have ssh installed (or don't have it within your search path).
You can clone from github via http, too:
```
git clone http://github.com/organization/xxx
``` |
3313908 | Git is really slow for 100,000 objects. Any fixes? | 77 | 2010-07-22 22:10:51 | <p>I have a "fresh" git-svn repo (11.13 GB) that has over a 100,000 objects in it.</p>
<p>I have preformed</p>
<pre><code>git fsck
git gc
</code></pre>
<p>on the repo after the initial checkout.</p>
<p>I then tried to do a</p>
<pre><code>git status
</code></pre>
<p>The time it takes to do a git status is anywhere... | 86,657 | 113,498 | 2022-12-22 13:57:47 | 3,339,609 | 39 | 2010-07-26 23:03:43 | 113,498 | 2014-03-06 20:15:08 | https://stackoverflow.com/q/3313908 | https://stackoverflow.com/a/3339609 | <p>It came down to a couple of items that I can see right now.</p>
<ol>
<li><code>git gc --aggressive</code></li>
<li>Opening up file permissions to <code>777</code></li>
</ol>
<p>There has to be something else going on, but this was the things that clearly made the biggest impact.</p>
| <p>It came down to a couple of items that I can see right now.</p> <ol> <li><code>git gc --aggressive</code></li> <li>Opening up file permissions to <code>777</code></li> </ol> <p>There has to be something else going on, but this was the things that clearly made the biggest impact.</p> | 119, 598, 6452 | git, git-svn, performance | <h1>Git is really slow for 100,000 objects. Any fixes?</h1>
<p>I have a "fresh" git-svn repo (11.13 GB) that has over a 100,000 objects in it.</p>
<p>I have preformed</p>
<pre><code>git fsck
git gc
</code></pre>
<p>on the repo after the initial checkout.</p>
<p>I then tried to do a</p>
<pre><code>git status
</code... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,097 | git | # Git is really slow for 100,000 objects. Any fixes?
I have a "fresh" git-svn repo (11.13 GB) that has over a 100,000 objects in it.
I have preformed
```
git fsck
git gc
```
on the repo after the initial checkout.
I then tried to do a
```
git status
```
The time it takes to do a git status is anywhere from 2m25.... | It came down to a couple of items that I can see right now.
1. `git gc --aggressive`
2. Opening up file permissions to `777`
There has to be something else going on, but this was the things that clearly made the biggest impact. |
4913360 | Can I rebase a Git branch without modifying my working copy? | 72 | 2011-02-06 12:44:36 | <p>Suppose I have my "master" branch checked out. I've committed some production changes to "master", and now I want to rebase my "experimental" branch onto the latest master. But, I want to do this without modifying any files in my working copy. Essentially, I want all the magic to happen inside the .git directory, wi... | 18,412 | 87,399 | 2025-11-15 13:09:03 | 4,914,298 | 39 | 2011-02-06 15:47:42 | 119,963 | 2015-05-27 01:00:25 | https://stackoverflow.com/q/4913360 | https://stackoverflow.com/a/4914298 | <blockquote>
<p>Is there a way to do all of the above in one step, without ever modifying anything in the working copy?</p>
</blockquote>
<p>This is unfortunately impossible (without creating a modifiable copy of the working copy - <a href="https://stackoverflow.com/a/12481546/119963">see also Petr's answer</a>), be... | <blockquote> <p>Is there a way to do all of the above in one step, without ever modifying anything in the working copy?</p> </blockquote> <p>This is unfortunately impossible (without creating a modifiable copy of the working copy - <a href="https://stackoverflow.com/a/12481546/119963">see also Petr's answer</a>), be... | 119, 8974 | git, rebase | <h1>Can I rebase a Git branch without modifying my working copy?</h1>
<p>Suppose I have my "master" branch checked out. I've committed some production changes to "master", and now I want to rebase my "experimental" branch onto the latest master. But, I want to do this without modifying any files in my working copy. Ess... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,099 | git | # Can I rebase a Git branch without modifying my working copy?
Suppose I have my "master" branch checked out. I've committed some production changes to "master", and now I want to rebase my "experimental" branch onto the latest master. But, I want to do this without modifying any files in my working copy. Essentially,... | > Is there a way to do all of the above in one step, without ever modifying anything in the working copy?
This is unfortunately impossible (without creating a modifiable copy of the working copy - [see also Petr's answer](https://stackoverflow.com/a/12481546/119963)), because git performs all merge-y operations (real ... |
29468273 | Why git blame does not follow renames? | 56 | 2015-04-06 09:05:55 | <pre><code>$ pwd
/data/mdi2/classes
$ git blame -L22,+1 -- utils.js
99b7a802 mdi2/utils.js (user 2015-03-26 21:54:57 +0200 22) #comment
$ git blame -L22,+1 99b7a802^ -- utils.js
fatal: no such path mdi2/classes/utils.js in 99b7a802^
</code></pre>
<p>As you have noticed, the file were in different directory in that ... | 18,042 | 4,632,019 | 2023-07-26 09:45:07 | 29,468,810 | 39 | 2015-04-06 09:46:15 | 1,256,452 | 2015-04-06 17:07:35 | https://stackoverflow.com/q/29468273 | https://stackoverflow.com/a/29468810 | <p><code>git blame</code> <em>does</em> follow renames (as does <code>git log</code> if you give it <code>--follow</code>). The problem lies in the <em>way</em> it follows renames, which is a not-very-thorough hack: as it steps back one commit at a time (from each child to each parent), it makes a diff—the same kind o... | <p><code>git blame</code> <em>does</em> follow renames (as does <code>git log</code> if you give it <code>--follow</code>). The problem lies in the <em>way</em> it follows renames, which is a not-very-thorough hack: as it steps back one commit at a time (from each child to each parent), it makes a diff—the same kind o... | 119, 21455, 105902 | blame, git, git-blame | <h1>Why git blame does not follow renames?</h1>
<pre><code>$ pwd
/data/mdi2/classes
$ git blame -L22,+1 -- utils.js
99b7a802 mdi2/utils.js (user 2015-03-26 21:54:57 +0200 22) #comment
$ git blame -L22,+1 99b7a802^ -- utils.js
fatal: no such path mdi2/classes/utils.js in 99b7a802^
</code></pre>
<p>As you have notice... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,100 | git | # Why git blame does not follow renames?
```
$ pwd
/data/mdi2/classes
$ git blame -L22,+1 -- utils.js
99b7a802 mdi2/utils.js (user 2015-03-26 21:54:57 +0200 22) #comment
$ git blame -L22,+1 99b7a802^ -- utils.js
fatal: no such path mdi2/classes/utils.js in 99b7a802^
```
As you have noticed, the file were in differ... | `git blame` *does* follow renames (as does `git log` if you give it `--follow`). The problem lies in the *way* it follows renames, which is a not-very-thorough hack: as it steps back one commit at a time (from each child to each parent), it makes a diff—the same kind of diff you can make manually with:
```
git diff -M... |
61543355 | Git includeIf for personal and work profiles doesn't work | 54 | 2020-05-01 13:25:10 | <p>I've been googling about this, trying different methods from different sources... but it doesn't work.</p>
<p>I want to push commits with my personal profile (defined with "git config --global user.email ...") unless I'm on my work folder.</p>
<p>The content of my .gitconfig is located at C:/Users/my-user/... | 28,348 | 10,620,020 | 2022-11-13 23:15:00 | 61,544,074 | 39 | 2020-05-01 14:09:50 | 1,256,452 | 2022-11-13 23:15:00 | https://stackoverflow.com/q/61543355 | https://stackoverflow.com/a/61544074 | <p>You need to remove one space in:</p>
<pre><code>[includeIf "gitdir: F:/Work/CompanyName/"]
</code></pre>
<p>i.e., make this read:</p>
<pre><code>[includeIf "gitdir:F:/Work/CompanyName/"]
</code></pre>
<p>Note the lack of a blank between the colon after <code>gitdir</code> and the path name to be ... | <p>You need to remove one space in:</p> <pre><code>[includeIf "gitdir: F:/Work/CompanyName/"] </code></pre> <p>i.e., make this read:</p> <pre><code>[includeIf "gitdir:F:/Work/CompanyName/"] </code></pre> <p>Note the lack of a blank between the colon after <code>gitdir</code> and the path name to be ... | 119, 403, 3574, 10402 | config, git, include, profile | <h1>Git includeIf for personal and work profiles doesn't work</h1>
<p>I've been googling about this, trying different methods from different sources... but it doesn't work.</p>
<p>I want to push commits with my personal profile (defined with "git config --global user.email ...") unless I'm on my work folder.<... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,102 | git | # Git includeIf for personal and work profiles doesn't work
I've been googling about this, trying different methods from different sources... but it doesn't work.
I want to push commits with my personal profile (defined with "git config --global user.email ...") unless I'm on my work folder.
The content of my .gitco... | You need to remove one space in:
```
[includeIf "gitdir: F:/Work/CompanyName/"]
```
i.e., make this read:
```
[includeIf "gitdir:F:/Work/CompanyName/"]
```
Note the lack of a blank between the colon after `gitdir` and the path name to be tested.
(Your Git also needs to be at least version 2.13. You might consider ... |
25349227 | Why git says "both modified" when outputting git status after conflict? | 52 | 2014-08-17 12:36:09 | <p>When having a conflict on a file while trying to merge in git, git says <code>both modified</code> on the file that has a conflict like this:</p>
<pre><code>$ git status
On branch master
You have unmerged paths.
(fix conflicts and run "git commit")
Unmerged paths:
(use "git add <file>..." to mark resolut... | 61,265 | 1,531,806 | 2019-08-29 22:34:39 | 25,349,290 | 39 | 2014-08-17 12:43:17 | 6,309 | 2014-08-17 12:48:48 | https://stackoverflow.com/q/25349227 | https://stackoverflow.com/a/25349290 | <p>This gets back to Git 1.6.5 (Oct. 2009) and <a href="https://github.com/git/git/commit/4d4d5726aee31522e90df21ef62ee3377c5d8f8d" rel="noreferrer">commit 4d4d572</a>, which introduced this more detailed message :</p>
<h2><code>status</code>: show worktree status of conflicted paths separately</h2>
<blockquote>
<p... | <p>This gets back to Git 1.6.5 (Oct. 2009) and <a href="https://github.com/git/git/commit/4d4d5726aee31522e90df21ef62ee3377c5d8f8d" rel="noreferrer">commit 4d4d572</a>, which introduced this more detailed message :</p> <h2><code>status</code>: show worktree status of conflicted paths separately</h2> <blockquote> <p... | 119 | git | <h1>Why git says "both modified" when outputting git status after conflict?</h1>
<p>When having a conflict on a file while trying to merge in git, git says <code>both modified</code> on the file that has a conflict like this:</p>
<pre><code>$ git status
On branch master
You have unmerged paths.
(fix conflicts and ru... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,103 | git | # Why git says "both modified" when outputting git status after conflict?
When having a conflict on a file while trying to merge in git, git says `both modified` on the file that has a conflict like this:
```
$ git status
On branch master
You have unmerged paths.
(fix conflicts and run "git commit")
Unmerged paths... | This gets back to Git 1.6.5 (Oct. 2009) and [commit 4d4d572](https://github.com/git/git/commit/4d4d5726aee31522e90df21ef62ee3377c5d8f8d), which introduced this more detailed message :
## `status`: show worktree status of conflicted paths separately
> **When a path is unmerged in the index, we used to always say "unme... |
10453520 | difference between .gitmodules and specifying submodules in .git/config? | 47 | 2012-05-04 17:33:20 | <p>Probably very silly question, - but I've been specifying submodules up until now in .gitmodules file. It recently struck me that perhaps it's possible to just use .git/config for the same reason so I won't have to keep extraneous file in working directory? </p>
<p>.git/config :</p>
<pre><code>[submodule "path/to/r... | 19,197 | 471,891 | 2012-05-04 18:03:42 | 10,453,695 | 39 | 2012-05-04 17:47:12 | 615,776 | 2012-05-04 17:52:21 | https://stackoverflow.com/q/10453520 | https://stackoverflow.com/a/10453695 | <p>Same answer than <code>.git/info/exclude</code> and <code>.gitignore</code>.</p>
<p>The <code>.gitmodules</code> file can be included in the repository and shared with everyone (that is, it can be added and committed like any regular file), whereas anything in <code>.git</code> (like <code>.git/config</code>) is pr... | <p>Same answer than <code>.git/info/exclude</code> and <code>.gitignore</code>.</p> <p>The <code>.gitmodules</code> file can be included in the repository and shared with everyone (that is, it can be added and committed like any regular file), whereas anything in <code>.git</code> (like <code>.git/config</code>) is pr... | 119 | git | <h1>difference between .gitmodules and specifying submodules in .git/config?</h1>
<p>Probably very silly question, - but I've been specifying submodules up until now in .gitmodules file. It recently struck me that perhaps it's possible to just use .git/config for the same reason so I won't have to keep extraneous file ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 18,104 | git | # difference between .gitmodules and specifying submodules in .git/config?
Probably very silly question, - but I've been specifying submodules up until now in .gitmodules file. It recently struck me that perhaps it's possible to just use .git/config for the same reason so I won't have to keep extraneous file in workin... | Same answer than `.git/info/exclude` and `.gitignore`.
The `.gitmodules` file can be included in the repository and shared with everyone (that is, it can be added and committed like any regular file), whereas anything in `.git` (like `.git/config`) is private (you cannot add it in the repository). |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.