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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
44931477 | Using Git describe without tags | 12 | 2017-07-05 16:23:44 | <p>I have a repository that gives me only a hash when I run <code>git describe</code>. I did not know until today that it does this because of the <code>--always</code> option (which is what I was using) since that repository has no tags. I have another repository with lots of tags.</p>
<p>How can I use <code>git desc... | 13,044 | 5,136,448 | 2023-05-15 02:31:22 | 44,932,213 | 14 | 2017-07-05 17:09:10 | 1,256,452 | 2020-11-06 16:30:02 | https://stackoverflow.com/q/44931477 | https://stackoverflow.com/a/44932213 | <p>Yes, but it's not necessarily a good idea. There <em>is</em> a <code>--all</code> option, which will search <em>branch</em> names—or in fact, all references—as well, but if you use that, you might also need <code>--long</code>.</p>
<h3>Description</h3>
<p>The central feature of <code>git describe</code> output is t... | <p>Yes, but it's not necessarily a good idea. There <em>is</em> a <code>--all</code> option, which will search <em>branch</em> names—or in fact, all references—as well, but if you use that, you might also need <code>--long</code>.</p> <h3>Description</h3> <p>The central feature of <code>git describe</code> output is t... | 119 | git | <h1>Using Git describe without tags</h1>
<p>I have a repository that gives me only a hash when I run <code>git describe</code>. I did not know until today that it does this because of the <code>--always</code> option (which is what I was using) since that repository has no tags. I have another repository with lots of t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,265 | git | # Using Git describe without tags
I have a repository that gives me only a hash when I run `git describe`. I did not know until today that it does this because of the `--always` option (which is what I was using) since that repository has no tags. I have another repository with lots of tags.
How can I use `git descri... | Yes, but it's not necessarily a good idea. There *is* a `--all` option, which will search *branch* names—or in fact, all references—as well, but if you use that, you might also need `--long`.
### Description
The central feature of `git describe` output is that it starts with a name that is (or should be) human-readab... |
43411903 | How to fast forward a branch to another non-master branch | 12 | 2017-04-14 12:52:26 | <p>I am on branch B.
When checking out branch A, I get the message that I am behind branch A by one commit. </p>
<p><code>git checkout A
Switched to branch 'A'
Your branch is behind 'origin/A' by 1 commit, and can be fast-forwarded.
</code></p>
<p>But when on my own branch, I cannot do git pull A because it says that... | 11,270 | null | 2017-04-14 13:05:44 | 43,411,982 | 14 | 2017-04-14 12:56:08 | 2,484,972 | 2017-04-14 13:03:48 | https://stackoverflow.com/q/43411903 | https://stackoverflow.com/a/43411982 | <p>git pull is simply a fetch+merge, however it only updates the branch you're working on when it pulls. The references of all branches are updated, so git is aware that local A ref is outdated.</p>
<pre><code># on branch A
git merge origin/A --ff-only
</code></pre>
<p>This will update your history with the latest st... | <p>git pull is simply a fetch+merge, however it only updates the branch you're working on when it pulls. The references of all branches are updated, so git is aware that local A ref is outdated.</p> <pre><code># on branch A git merge origin/A --ff-only </code></pre> <p>This will update your history with the latest st... | 119, 1879, 76220 | branch, git, git-branch | <h1>How to fast forward a branch to another non-master branch</h1>
<p>I am on branch B.
When checking out branch A, I get the message that I am behind branch A by one commit. </p>
<p><code>git checkout A
Switched to branch 'A'
Your branch is behind 'origin/A' by 1 commit, and can be fast-forwarded.
</code></p>
<p>But... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,266 | git | # How to fast forward a branch to another non-master branch
I am on branch B.
When checking out branch A, I get the message that I am behind branch A by one commit.
`git checkout A
Switched to branch 'A'
Your branch is behind 'origin/A' by 1 commit, and can be fast-forwarded.`
But when on my own branch, I cannot do ... | git pull is simply a fetch+merge, however it only updates the branch you're working on when it pulls. The references of all branches are updated, so git is aware that local A ref is outdated.
```
# on branch A
git merge origin/A --ff-only
```
This will update your history with the latest status of A. |
41029654 | Ignore fsck / zero-padded file mode errors in "git clone" | 12 | 2016-12-08 00:15:59 | <p>I have the following settings in my global Git configuration:</p>
<pre><code>[transfer]
fsckobjects = true
[fetch]
fsckobjects = true
[receive]
fsckobjects = true
</code></pre>
<p>These verify that all objects in the cloned database are valid and reachable.</p>
<p>However, some repos I want to check... | 2,970 | 329,700 | 2020-05-31 22:42:51 | 41,029,655 | 14 | 2016-12-08 00:15:59 | 329,700 | 2016-12-08 00:15:59 | https://stackoverflow.com/q/41029654 | https://stackoverflow.com/a/41029655 | <p>Use <code>git clone --config key=value</code> and pass all of the arguments you want to skip there. For <code>oh-my-zsh</code>, that looks like this:</p>
<pre><code>git clone --config transfer.fsckobjects=false \
--config receive.fsckobjects=false \
--config fetch.fsckobjects=false \
git://github.com/ro... | <p>Use <code>git clone --config key=value</code> and pass all of the arguments you want to skip there. For <code>oh-my-zsh</code>, that looks like this:</p> <pre><code>git clone --config transfer.fsckobjects=false \ --config receive.fsckobjects=false \ --config fetch.fsckobjects=false \ git://github.com/ro... | 119, 102491 | git, git-fsck | <h1>Ignore fsck / zero-padded file mode errors in "git clone"</h1>
<p>I have the following settings in my global Git configuration:</p>
<pre><code>[transfer]
fsckobjects = true
[fetch]
fsckobjects = true
[receive]
fsckobjects = true
</code></pre>
<p>These verify that all objects in the cloned database a... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,267 | git | # Ignore fsck / zero-padded file mode errors in "git clone"
I have the following settings in my global Git configuration:
```
[transfer]
fsckobjects = true
[fetch]
fsckobjects = true
[receive]
fsckobjects = true
```
These verify that all objects in the cloned database are valid and reachable.
However,... | Use `git clone --config key=value` and pass all of the arguments you want to skip there. For `oh-my-zsh`, that looks like this:
```
git clone --config transfer.fsckobjects=false \
--config receive.fsckobjects=false \
--config fetch.fsckobjects=false \
git://github.com/robbyrussell/oh-my-zsh.git
``` |
39993093 | Git changelist's | 12 | 2016-10-12 07:40:58 | <p>I am fairly new to git and by now i know the basics. Even tho I use a plugin/program with a GUI to work with git in my daily work, I really like to know what is going on behind the scenes.</p>
<p>I am normally working in Intellij and there I am able to split my changes up in different 'changelists'.</p>
<p>As seen... | 10,811 | 1,046,512 | 2016-10-12 08:21:39 | 39,993,343 | 14 | 2016-10-12 07:54:50 | 6,309 | 2016-10-12 08:21:39 | https://stackoverflow.com/q/39993093 | https://stackoverflow.com/a/39993343 | <p>Changelists are predating the integration of Git in IntelliJ IDEA, so they are a concept from IntelliJ, allowing you to split your changes in different sets.</p>
<p>I explained how they were linked to a Git commit in "<a href="https://stackoverflow.com/a/11070704/6309">What is a changelist in IntelliJ IDEA?</a>".</... | <p>Changelists are predating the integration of Git in IntelliJ IDEA, so they are a concept from IntelliJ, allowing you to split your changes in different sets.</p> <p>I explained how they were linked to a Git commit in "<a href="https://stackoverflow.com/a/11070704/6309">What is a changelist in IntelliJ IDEA?</a>".</... | 119, 8945 | git, intellij-idea | <h1>Git changelist's</h1>
<p>I am fairly new to git and by now i know the basics. Even tho I use a plugin/program with a GUI to work with git in my daily work, I really like to know what is going on behind the scenes.</p>
<p>I am normally working in Intellij and there I am able to split my changes up in different 'cha... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,268 | git | # Git changelist's
I am fairly new to git and by now i know the basics. Even tho I use a plugin/program with a GUI to work with git in my daily work, I really like to know what is going on behind the scenes.
I am normally working in Intellij and there I am able to split my changes up in different 'changelists'.
As s... | Changelists are predating the integration of Git in IntelliJ IDEA, so they are a concept from IntelliJ, allowing you to split your changes in different sets.
I explained how they were linked to a Git commit in "[What is a changelist in IntelliJ IDEA?](https://stackoverflow.com/a/11070704/6309)".
Since there is only o... |
31901384 | How to rename a local Git branch from inside IntelliJ IDEA? | 12 | 2015-08-09 06:01:22 | <p>There are plenty of things you can do with Git plugin for IntelliJ IDEA, but I haven't found a way to rename a branch. Is there one? </p>
<p>I know I can always bring up a terminal and do <code>git branch -m source target</code>, but I expected to find a GUI solution as well.</p>
| 12,419 | 1,542,343 | 2017-01-14 09:15:30 | 31,903,052 | 14 | 2015-08-09 10:05:58 | 6,309 | 2017-01-13 09:52:45 | https://stackoverflow.com/q/31901384 | https://stackoverflow.com/a/31903052 | <p>There are a couple of pending issues with this feature:</p>
<ul>
<li><a href="https://youtrack.jetbrains.com/issue/IDEA-89927" rel="noreferrer">IDEA-89927</a>: Renaming branches is not captured by IDEA </li>
<li><a href="https://youtrack.jetbrains.com/issue/IDEA-131021" rel="noreferrer">IDEA-131021</a>: Add "Rename... | <p>There are a couple of pending issues with this feature:</p> <ul> <li><a href="https://youtrack.jetbrains.com/issue/IDEA-89927" rel="noreferrer">IDEA-89927</a>: Renaming branches is not captured by IDEA </li> <li><a href="https://youtrack.jetbrains.com/issue/IDEA-131021" rel="noreferrer">IDEA-131021</a>: Add "Rename... | 119, 8945 | git, intellij-idea | <h1>How to rename a local Git branch from inside IntelliJ IDEA?</h1>
<p>There are plenty of things you can do with Git plugin for IntelliJ IDEA, but I haven't found a way to rename a branch. Is there one? </p>
<p>I know I can always bring up a terminal and do <code>git branch -m source target</code>, but I expected to... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,270 | git | # How to rename a local Git branch from inside IntelliJ IDEA?
There are plenty of things you can do with Git plugin for IntelliJ IDEA, but I haven't found a way to rename a branch. Is there one?
I know I can always bring up a terminal and do `git branch -m source target`, but I expected to find a GUI solution as well... | There are a couple of pending issues with this feature:
- [IDEA-89927](https://youtrack.jetbrains.com/issue/IDEA-89927): Renaming branches is not captured by IDEA
- [IDEA-131021](https://youtrack.jetbrains.com/issue/IDEA-131021): Add "Rename branch" action
The latter is not yet implemented.
The former does show the... |
31185519 | What is the difference between using -d and -D when deleting a branch in git? | 12 | 2015-07-02 13:07:33 | <p>Can some body please help me to understand what is the difference between following two git commands?</p>
<pre><code>$ git branch -d testing
</code></pre>
<p>and</p>
<pre><code>$ git branch -D testing
</code></pre>
<p>When should we use -D?</p>
| 5,451 | 1,616,003 | 2015-07-02 13:57:39 | 31,185,680 | 14 | 2015-07-02 13:15:10 | 1,264,116 | 2015-07-02 13:22:51 | https://stackoverflow.com/q/31185519 | https://stackoverflow.com/a/31185680 | <p><code>git branch -d</code> is for deleting branches that are fully merged in its upstream branch or to HEAD if you don't have a upstream for your branch. If the branch is not fully merged it will not perform the deletion.</p>
<p><code>git branch -D</code> deletes the branch even if it's not merged.</p>
| <p><code>git branch -d</code> is for deleting branches that are fully merged in its upstream branch or to HEAD if you don't have a upstream for your branch. If the branch is not fully merged it will not perform the deletion.</p> <p><code>git branch -D</code> deletes the branch even if it's not merged.</p> | 119, 456 | git, version-control | <h1>What is the difference between using -d and -D when deleting a branch in git?</h1>
<p>Can some body please help me to understand what is the difference between following two git commands?</p>
<pre><code>$ git branch -d testing
</code></pre>
<p>and</p>
<pre><code>$ git branch -D testing
</code></pre>
<p>When sho... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,271 | git | # What is the difference between using -d and -D when deleting a branch in git?
Can some body please help me to understand what is the difference between following two git commands?
```
$ git branch -d testing
```
and
```
$ git branch -D testing
```
When should we use -D? | `git branch -d` is for deleting branches that are fully merged in its upstream branch or to HEAD if you don't have a upstream for your branch. If the branch is not fully merged it will not perform the deletion.
`git branch -D` deletes the branch even if it's not merged. |
28768306 | Check If Local Branch Exists On Remote Git | 12 | 2015-02-27 15:14:32 | <p>I would like to see if one of my newly created local branches exists on the remote with a one line command. Like making an alias or function that would allow me to type </p>
<pre><code>git remoteExists <branchName>
</code></pre>
<p>Right now I manually list off every branch on the remote and check to see if ... | 14,805 | 2,338,279 | 2021-08-11 19:44:47 | 28,769,306 | 14 | 2015-02-27 16:03:08 | 1,290,731 | 2015-02-27 16:03:08 | https://stackoverflow.com/q/28768306 | https://stackoverflow.com/a/28769306 | <pre><code>git fetch origin
git branch -r --contains $mybranch
</code></pre>
<p>and if you're sure any pushes came from this particular repo you can omit the fetch.</p>
| <pre><code>git fetch origin git branch -r --contains $mybranch </code></pre> <p>and if you're sure any pushes came from this particular repo you can omit the fetch.</p> | 119, 1879 | branch, git | <h1>Check If Local Branch Exists On Remote Git</h1>
<p>I would like to see if one of my newly created local branches exists on the remote with a one line command. Like making an alias or function that would allow me to type </p>
<pre><code>git remoteExists <branchName>
</code></pre>
<p>Right now I manually list... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,273 | git | # Check If Local Branch Exists On Remote Git
I would like to see if one of my newly created local branches exists on the remote with a one line command. Like making an alias or function that would allow me to type
```
git remoteExists <branchName>
```
Right now I manually list off every branch on the remote and chec... | ```
git fetch origin
git branch -r --contains $mybranch
```
and if you're sure any pushes came from this particular repo you can omit the fetch. |
24352701 | Windows: how to check the status of all git repositories at once? | 12 | 2014-06-22 15:23:27 | <p><strong>Introduction</strong></p>
<p>In order to check the status of git repositores, <code>git status</code> could be issued from the root of a repository.</p>
<pre><code>C:\path\to\git_repositories\git_repo_1>git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, worki... | 10,905 | 2,777,965 | 2023-09-16 09:45:27 | 24,352,829 | 14 | 2014-06-22 15:38:07 | 241,605 | 2014-06-24 18:26:13 | https://stackoverflow.com/q/24352701 | https://stackoverflow.com/a/24352829 | <p>You could use a <code>for</code> loop that changes into each directory, does <code>git status</code> and then changes back up:</p>
<pre><code>for /f "tokens=*" %a in ('dir /ad /b') do cd %a & git status & cd ..
</code></pre>
<p>You need to double the percentages if you use this in a batch file:</p>
<pre><... | <p>You could use a <code>for</code> loop that changes into each directory, does <code>git status</code> and then changes back up:</p> <pre><code>for /f "tokens=*" %a in ('dir /ad /b') do cd %a & git status & cd .. </code></pre> <p>You need to double the percentages if you use this in a batch file:</p> <pre><... | 64, 119, 6951 | git, status, windows | <h1>Windows: how to check the status of all git repositories at once?</h1>
<p><strong>Introduction</strong></p>
<p>In order to check the status of git repositores, <code>git status</code> could be issued from the root of a repository.</p>
<pre><code>C:\path\to\git_repositories\git_repo_1>git status
On branch maste... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,274 | git | # Windows: how to check the status of all git repositories at once?
**Introduction**
In order to check the status of git repositores, `git status` could be issued from the root of a repository.
```
C:\path\to\git_repositories\git_repo_1>git status
On branch master
Your branch is up-to-date with 'origin/master'.
not... | You could use a `for` loop that changes into each directory, does `git status` and then changes back up:
```
for /f "tokens=*" %a in ('dir /ad /b') do cd %a & git status & cd ..
```
You need to double the percentages if you use this in a batch file:
```
for /f "tokens=*" %%a in ('dir /ad /b') do cd %%a & git status ... |
21949074 | What is the meaning of :/ (colon, forward slash) in the 2.0 version of git add --update syntax? | 12 | 2014-02-22 03:04:04 | <p>I upgraded Git a couple months ago and since then I've been receiving the following deprecation notice upon attempting <code>git add --update</code>:</p>
<blockquote>
<p>Warning: The behavior of 'git add --update (or -u)' with no path
argument from a subdirectory of the tree will change in Git 2.0 and
should ... | 5,800 | 741,970 | 2021-08-31 15:34:39 | 21,954,767 | 14 | 2014-02-22 13:09:30 | 1,256,452 | 2021-08-31 15:34:39 | https://stackoverflow.com/q/21949074 | https://stackoverflow.com/a/21954767 | <p><strong>Edit, Nov 2019</strong>: I've replaced this answer as the original was more wrong than right, really.</p>
<p>The <code>:/</code> syntax for <code>git add</code> uses what Git calls a <em>pathspec</em>. Pathspecs are defined in <a href="https://git-scm.com/docs/gitglossary" rel="nofollow noreferrer">the gitg... | <p><strong>Edit, Nov 2019</strong>: I've replaced this answer as the original was more wrong than right, really.</p> <p>The <code>:/</code> syntax for <code>git add</code> uses what Git calls a <em>pathspec</em>. Pathspecs are defined in <a href="https://git-scm.com/docs/gitglossary" rel="nofollow noreferrer">the gitg... | 119 | git | <h1>What is the meaning of :/ (colon, forward slash) in the 2.0 version of git add --update syntax?</h1>
<p>I upgraded Git a couple months ago and since then I've been receiving the following deprecation notice upon attempting <code>git add --update</code>:</p>
<blockquote>
<p>Warning: The behavior of 'git add --upd... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,275 | git | # What is the meaning of :/ (colon, forward slash) in the 2.0 version of git add --update syntax?
I upgraded Git a couple months ago and since then I've been receiving the following deprecation notice upon attempting `git add --update`:
> Warning: The behavior of 'git add --update (or -u)' with no path
> argument fro... | **Edit, Nov 2019**: I've replaced this answer as the original was more wrong than right, really.
The `:/` syntax for `git add` uses what Git calls a *pathspec*. Pathspecs are defined in [the gitglossary](https://git-scm.com/docs/gitglossary). It's worth mentioning that `:` and `:/` have an entirely different meaning i... |
21844150 | Accidentally ran git stash pop twice | 12 | 2014-02-18 04:07:01 | <p>I accidentally executed <code>git stash pop</code> twice getting me one stash behind of where I wanted to be. How do I undo the last pop? I do want the first pop but not the second one so <code>reset --hard HEAD</code> won't do it for me.</p>
| 5,637 | 1,312,080 | 2014-02-18 04:35:36 | 21,844,449 | 14 | 2014-02-18 04:33:37 | 1,256,452 | 2014-02-18 04:33:37 | https://stackoverflow.com/q/21844150 | https://stackoverflow.com/a/21844449 | <p>"Undoing" <code>git stash pop</code> is kind of painful unless you have the raw commit-IDs for your stashes listed somewhere (e.g., on your screen).</p>
<p>The <a href="https://www.kernel.org/pub/software/scm/git/docs/git-stash.html" rel="noreferrer"><code>git stash</code> documentation</a> has directions (at the e... | <p>"Undoing" <code>git stash pop</code> is kind of painful unless you have the raw commit-IDs for your stashes listed somewhere (e.g., on your screen).</p> <p>The <a href="https://www.kernel.org/pub/software/scm/git/docs/git-stash.html" rel="noreferrer"><code>git stash</code> documentation</a> has directions (at the e... | 119 | git | <h1>Accidentally ran git stash pop twice</h1>
<p>I accidentally executed <code>git stash pop</code> twice getting me one stash behind of where I wanted to be. How do I undo the last pop? I do want the first pop but not the second one so <code>reset --hard HEAD</code> won't do it for me.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,276 | git | # Accidentally ran git stash pop twice
I accidentally executed `git stash pop` twice getting me one stash behind of where I wanted to be. How do I undo the last pop? I do want the first pop but not the second one so `reset --hard HEAD` won't do it for me. | "Undoing" `git stash pop` is kind of painful unless you have the raw commit-IDs for your stashes listed somewhere (e.g., on your screen).
The [`git stash` documentation](https://www.kernel.org/pub/software/scm/git/docs/git-stash.html) has directions (at the end) for recovering dropped stashes. These are the instructio... |
16035240 | Why is `git describe -dirty` adding a `-dirty` suffix when describing a clean checkout? | 12 | 2013-04-16 10:54:40 | <p>I have just discovered the <code>--dirty</code> option to <code>git describe</code> and it looks like it should do something very useful, i.e. append a suffix to the output of <code>git describe</code> when the working tree is dirty, however that doesn't seem to be the case on some of my repositories:</p>
<pre><cod... | 25,664 | 42,473 | 2023-04-28 23:10:09 | 17,537,385 | 14 | 2013-07-08 23:01:47 | 2,562,319 | 2013-07-08 23:25:28 | https://stackoverflow.com/q/16035240 | https://stackoverflow.com/a/17537385 | <p>If you are running git 1.7.6 or earlier, you need to run <code>git update-index --refresh</code> before using <code>git describe --dirty</code>, because the index may be stale. Your workaround of using <code>git diff --quiet HEAD</code> works because "git diff" is a porcelain command, and probably updates the index... | <p>If you are running git 1.7.6 or earlier, you need to run <code>git update-index --refresh</code> before using <code>git describe --dirty</code>, because the index may be stale. Your workaround of using <code>git diff --quiet HEAD</code> works because "git diff" is a porcelain command, and probably updates the index... | 119, 80455 | git, git-describe | <h1>Why is `git describe -dirty` adding a `-dirty` suffix when describing a clean checkout?</h1>
<p>I have just discovered the <code>--dirty</code> option to <code>git describe</code> and it looks like it should do something very useful, i.e. append a suffix to the output of <code>git describe</code> when the working t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,277 | git | # Why is `git describe -dirty` adding a `-dirty` suffix when describing a clean checkout?
I have just discovered the `--dirty` option to `git describe` and it looks like it should do something very useful, i.e. append a suffix to the output of `git describe` when the working tree is dirty, however that doesn't seem to... | If you are running git 1.7.6 or earlier, you need to run `git update-index --refresh` before using `git describe --dirty`, because the index may be stale. Your workaround of using `git diff --quiet HEAD` works because "git diff" is a porcelain command, and probably updates the index itself.
The [git commit that fixes ... |
16181279 | Find out which commit removed a particular word/line in GIT | 12 | 2013-04-24 00:15:19 | <p>With both GIT tools and command line, what is the easiest way to find out which commit removed a particular word from a file?</p>
| 4,080 | 390,227 | 2013-04-24 01:22:52 | 16,181,840 | 14 | 2013-04-24 01:22:52 | 1,043,187 | 2013-04-24 01:22:52 | https://stackoverflow.com/q/16181279 | https://stackoverflow.com/a/16181840 | <p>You could use the methods described in <a href="https://stackoverflow.com/questions/4404444/how-do-i-blame-a-deleted-line">this post</a>:</p>
<blockquote>
<p>If you know the contents of the line, this is an ideal use case for:</p>
</blockquote>
<pre><code>git log -S<string> path/to/file
git log -G<regex... | <p>You could use the methods described in <a href="https://stackoverflow.com/questions/4404444/how-do-i-blame-a-deleted-line">this post</a>:</p> <blockquote> <p>If you know the contents of the line, this is an ideal use case for:</p> </blockquote> <pre><code>git log -S<string> path/to/file git log -G<regex... | 119 | git | <h1>Find out which commit removed a particular word/line in GIT</h1>
<p>With both GIT tools and command line, what is the easiest way to find out which commit removed a particular word from a file?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,278 | git | # Find out which commit removed a particular word/line in GIT
With both GIT tools and command line, what is the easiest way to find out which commit removed a particular word from a file? | You could use the methods described in [this post](https://stackoverflow.com/questions/4404444/how-do-i-blame-a-deleted-line):
> If you know the contents of the line, this is an ideal use case for:
```
git log -S<string> path/to/file
git log -G<regex> path/to/file
```
Or you could try:
```
git blame --reverse
``` |
14405782 | Git fetch single file from remote repository programatically | 12 | 2013-01-18 19:01:53 | <p>I'll say up front that this question is similar in nature to <a href="https://stackoverflow.com/questions/1125476/git-retrieve-a-single-file-from-a-repository">this</a>. There's one key difference that makes this unique: I want to use the raw git protocol (see <a href="http://git-scm.com/book/en/Git-Internals-Transf... | 4,166 | 576,139 | 2013-04-18 09:25:52 | 14,610,427 | 14 | 2013-01-30 17:47:57 | 576,139 | 2013-01-30 17:55:56 | https://stackoverflow.com/q/14405782 | https://stackoverflow.com/a/14610427 | <p>Answering my own question. I found an acceptable (although barely documented) answer. I had to dig through a LOT of C code to figure this out.</p>
<p>First of all, the above requirements can't be achieved using <code>git-upload-packfile</code> because that's simply not what the program was designed to do. The corre... | <p>Answering my own question. I found an acceptable (although barely documented) answer. I had to dig through a LOT of C code to figure this out.</p> <p>First of all, the above requirements can't be achieved using <code>git-upload-packfile</code> because that's simply not what the program was designed to do. The corre... | 119, 4462 | git, protocols | <h1>Git fetch single file from remote repository programatically</h1>
<p>I'll say up front that this question is similar in nature to <a href="https://stackoverflow.com/questions/1125476/git-retrieve-a-single-file-from-a-repository">this</a>. There's one key difference that makes this unique: I want to use the raw git ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,280 | git | # Git fetch single file from remote repository programatically
I'll say up front that this question is similar in nature to [this](https://stackoverflow.com/questions/1125476/git-retrieve-a-single-file-from-a-repository). There's one key difference that makes this unique: I want to use the raw git protocol (see [here]... | Answering my own question. I found an acceptable (although barely documented) answer. I had to dig through a LOT of C code to figure this out.
First of all, the above requirements can't be achieved using `git-upload-packfile` because that's simply not what the program was designed to do. The correct answer as I suspec... |
14344832 | What to do after cloning repo from git | 12 | 2013-01-15 18:53:55 | <p>I am just a <strong>git starter</strong>, basically I clone a git repository and now I wanted to commit the changes that I made in a file. when I run the command <code>git commit</code> it says <code>not a git repository</code>,</p>
<p>So being a starter in git i just wanted to ask that do i need to run this comman... | 113,385 | 1,594,368 | 2023-11-20 21:22:37 | 14,345,201 | 14 | 2013-01-15 19:17:18 | 413,399 | 2014-08-24 04:02:37 | https://stackoverflow.com/q/14344832 | https://stackoverflow.com/a/14345201 | <p>As <em>jeremyharris</em> said, the <a href="http://git-scm.com/documentation" rel="noreferrer">git documentation site</a> and especially the <a href="http://git-scm.com/book" rel="noreferrer">online book</a> there will get you up to speed on the basics.</p>
<p>A few quick notes that might get you past your initial ... | <p>As <em>jeremyharris</em> said, the <a href="http://git-scm.com/documentation" rel="noreferrer">git documentation site</a> and especially the <a href="http://git-scm.com/book" rel="noreferrer">online book</a> there will get you up to speed on the basics.</p> <p>A few quick notes that might get you past your initial ... | 119, 8337, 34099, 53850 | bitbucket, git, git-clone, git-commit | <h1>What to do after cloning repo from git</h1>
<p>I am just a <strong>git starter</strong>, basically I clone a git repository and now I wanted to commit the changes that I made in a file. when I run the command <code>git commit</code> it says <code>not a git repository</code>,</p>
<p>So being a starter in git i just... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,281 | git | # What to do after cloning repo from git
I am just a **git starter**, basically I clone a git repository and now I wanted to commit the changes that I made in a file. when I run the command `git commit` it says `not a git repository`,
So being a starter in git i just wanted to ask that do i need to run this command f... | As *jeremyharris* said, the [git documentation site](http://git-scm.com/documentation) and especially the [online book](http://git-scm.com/book) there will get you up to speed on the basics.
A few quick notes that might get you past your initial issue.
`git clone` command is used to pull a copy (a clone) from an exis... |
9594169 | Create a git tree from working tree without touching the index? | 12 | 2012-03-07 00:40:19 | <p>I'm creating a tool that will allow people to store "solutions" to tests. Since I don't want to reinvent version control, I decided to use git's tree/blob/object stuff -- my idea is to create a git tree object out of the current working directory.</p>
<p>The problem is that I want this tool to not touch the state ... | 2,468 | 87,316 | 2012-03-07 00:49:05 | 9,594,221 | 14 | 2012-03-07 00:49:05 | 582 | 2012-03-07 00:49:05 | https://stackoverflow.com/q/9594169 | https://stackoverflow.com/a/9594221 | <p>Using <code>git mktree</code> is certainly doable. It reads in <code>ls-tree</code>-formatted text, but you can generate that yourself using whatever mechanism you want.</p>
<p>That said, it may be easier to go ahead and use the index. After all, you're free to specify whatever location you want as the index, via t... | <p>Using <code>git mktree</code> is certainly doable. It reads in <code>ls-tree</code>-formatted text, but you can generate that yourself using whatever mechanism you want.</p> <p>That said, it may be easier to go ahead and use the index. After all, you're free to specify whatever location you want as the index, via t... | 119, 456 | git, version-control | <h1>Create a git tree from working tree without touching the index?</h1>
<p>I'm creating a tool that will allow people to store "solutions" to tests. Since I don't want to reinvent version control, I decided to use git's tree/blob/object stuff -- my idea is to create a git tree object out of the current working direct... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,282 | git | # Create a git tree from working tree without touching the index?
I'm creating a tool that will allow people to store "solutions" to tests. Since I don't want to reinvent version control, I decided to use git's tree/blob/object stuff -- my idea is to create a git tree object out of the current working directory.
The ... | Using `git mktree` is certainly doable. It reads in `ls-tree`-formatted text, but you can generate that yourself using whatever mechanism you want.
That said, it may be easier to go ahead and use the index. After all, you're free to specify whatever location you want as the index, via the `GIT_INDEX_FILE` environment ... |
56723228 | How to add time on git command prompt | 11 | 2019-06-23 11:03:33 | <p>I want to add current time on git command prompt. with keeping the same actual parameters.</p>
<blockquote>
<p>How to do it like the following image.</p>
</blockquote>
<p><a href="https://i.sstatic.net/PtiEo.jpg" rel="noreferrer"><img src="https://i.sstatic.net/PtiEo.jpg" alt="enter image description here"></a><... | 2,303 | 7,065,610 | 2019-06-23 12:01:45 | 56,723,283 | 14 | 2019-06-23 11:10:33 | 5,759,072 | 2019-06-23 12:01:45 | https://stackoverflow.com/q/56723228 | https://stackoverflow.com/a/56723283 | <p>Navigate to your Git installation folder to where your profiles are located: <code>Git\etc\profile.d</code> and open the file called <code>git-prompt.sh</code>. Change the last block of code to include the time stamp like this:</p>
<pre><code>PS1="$PS1"'\[\033[0m\]' # change color
PS1="$PS1"' \A \D{%d/%m/%Y}... | <p>Navigate to your Git installation folder to where your profiles are located: <code>Git\etc\profile.d</code> and open the file called <code>git-prompt.sh</code>. Change the last block of code to include the time stamp like this:</p> <pre><code>PS1="$PS1"'\[\033[0m\]' # change color PS1="$PS1"' \A \D{%d/%m/%Y}... | 119, 9938 | command-prompt, git | <h1>How to add time on git command prompt</h1>
<p>I want to add current time on git command prompt. with keeping the same actual parameters.</p>
<blockquote>
<p>How to do it like the following image.</p>
</blockquote>
<p><a href="https://i.sstatic.net/PtiEo.jpg" rel="noreferrer"><img src="https://i.sstatic.net/PtiE... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,289 | git | # How to add time on git command prompt
I want to add current time on git command prompt. with keeping the same actual parameters.
> How to do it like the following image.
[](https://i.sstatic.net/PtiEo.jpg) | Navigate to your Git installation folder to where your profiles are located: `Git\etc\profile.d` and open the file called `git-prompt.sh`. Change the last block of code to include the time stamp like this:
```
PS1="$PS1"'\[\033[0m\]' # change color
PS1="$PS1"' \A \D{%d/%m/%Y}' # time & date
PS1="$PS1"'\n' ... |
54010580 | Git Log issue: date is not showing when oneline option in used | 11 | 2019-01-02 17:21:48 | <p>I see lots of great answers in <a href="https://stackoverflow.com/questions/1057564/pretty-git-branch-graphs">Pretty git branch graphs</a> that show the oneline option for <code>git log</code> being used <em>with dates</em>. However, when I run these commands my output is different, I don't see the dates. The option... | 4,572 | 573,778 | 2022-07-15 21:56:54 | 54,010,642 | 14 | 2019-01-02 17:27:27 | 520,275 | 2019-01-02 17:27:27 | https://stackoverflow.com/q/54010580 | https://stackoverflow.com/a/54010642 | <p>Should add the date in the <em><a href="https://git-scm.com/docs/pretty-formats" rel="noreferrer">format</a></em>.</p>
<p>For instance:</p>
<pre><code>git log --pretty=format:"%h %s %an %ad" --date=relative
</code></pre>
<p>Where <strong>%ad</strong> means "author date" using <em>--date</em> option value</p>
| <p>Should add the date in the <em><a href="https://git-scm.com/docs/pretty-formats" rel="noreferrer">format</a></em>.</p> <p>For instance:</p> <pre><code>git log --pretty=format:"%h %s %an %ad" --date=relative </code></pre> <p>Where <strong>%ad</strong> means "author date" using <em>--date</em> option value</p> | 119, 47913 | git, git-log | <h1>Git Log issue: date is not showing when oneline option in used</h1>
<p>I see lots of great answers in <a href="https://stackoverflow.com/questions/1057564/pretty-git-branch-graphs">Pretty git branch graphs</a> that show the oneline option for <code>git log</code> being used <em>with dates</em>. However, when I run ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,290 | git | # Git Log issue: date is not showing when oneline option in used
I see lots of great answers in [Pretty git branch graphs](https://stackoverflow.com/questions/1057564/pretty-git-branch-graphs) that show the oneline option for `git log` being used *with dates*. However, when I run these commands my output is different,... | Should add the date in the *[format](https://git-scm.com/docs/pretty-formats)*.
For instance:
```
git log --pretty=format:"%h %s %an %ad" --date=relative
```
Where **%ad** means "author date" using *--date* option value |
51829099 | Is there any way to save my current change without Commit or Stash in Git? | 11 | 2018-08-13 19:13:15 | <p>I have changed a lot of files and I realized my approach is not good. So, I want to try another approach. I know two solutions in this case:</p>
<ol>
<li>Commit: I don't want to use this feature since I know my current code doesn't work.</li>
<li>Stash: I don't want to use this as well since I miss several files an... | 15,821 | 513,413 | 2021-04-06 09:45:24 | 51,829,289 | 14 | 2018-08-13 19:26:54 | 7,203,016 | 2018-08-13 19:26:54 | https://stackoverflow.com/q/51829099 | https://stackoverflow.com/a/51829289 | <p>I think @Signey_Gijzen's answer is probably best, but you can do this with <code>git stash apply</code>, too. That is, you'll want to do:</p>
<pre><code>$ git stash # as usual, stashes the changes
... now your changes are gone from the working tree ...
$ git stash apply # unstashes, but keeps sta... | <p>I think @Signey_Gijzen's answer is probably best, but you can do this with <code>git stash apply</code>, too. That is, you'll want to do:</p> <pre><code>$ git stash # as usual, stashes the changes ... now your changes are gone from the working tree ... $ git stash apply # unstashes, but keeps sta... | 119 | git | <h1>Is there any way to save my current change without Commit or Stash in Git?</h1>
<p>I have changed a lot of files and I realized my approach is not good. So, I want to try another approach. I know two solutions in this case:</p>
<ol>
<li>Commit: I don't want to use this feature since I know my current code doesn't ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,291 | git | # Is there any way to save my current change without Commit or Stash in Git?
I have changed a lot of files and I realized my approach is not good. So, I want to try another approach. I know two solutions in this case:
1. Commit: I don't want to use this feature since I know my current code doesn't work.
2. Stash: I d... | I think @Signey_Gijzen's answer is probably best, but you can do this with `git stash apply`, too. That is, you'll want to do:
```
$ git stash # as usual, stashes the changes
... now your changes are gone from the working tree ...
$ git stash apply # unstashes, but keeps stash around
... now they're ... |
45513613 | How to proceed when Git rebase --continue is REALLY REALLY blocked by empty commit | 11 | 2017-08-04 18:44:52 | <p>I am rebasing a branch of several commits onto an upstream branch. I am blocked by a failure of some kind where I can't continue to the remaining commits in my branch, so I need a way to continue when git reset does not seem to work.</p>
<p>As I said I'm rebasing a branch. I do rebasing like this all the time, and ... | 11,277 | 606,961 | 2017-08-04 19:05:28 | 45,513,873 | 14 | 2017-08-04 19:05:28 | 606,961 | 2017-08-04 19:05:28 | https://stackoverflow.com/q/45513613 | https://stackoverflow.com/a/45513873 | <p>The take-away is to look carefully at the summary line. The answer turns out to be <code>git rebase --continue</code> if you notice that the summary line of the commit it says cannot be applied, is actually the next commit. I was thrown off by how similar the text on screen was to the usual empty commit message that... | <p>The take-away is to look carefully at the summary line. The answer turns out to be <code>git rebase --continue</code> if you notice that the summary line of the commit it says cannot be applied, is actually the next commit. I was thrown off by how similar the text on screen was to the usual empty commit message that... | 119, 8974, 53847 | branching-and-merging, git, rebase | <h1>How to proceed when Git rebase --continue is REALLY REALLY blocked by empty commit</h1>
<p>I am rebasing a branch of several commits onto an upstream branch. I am blocked by a failure of some kind where I can't continue to the remaining commits in my branch, so I need a way to continue when git reset does not seem ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,292 | git | # How to proceed when Git rebase --continue is REALLY REALLY blocked by empty commit
I am rebasing a branch of several commits onto an upstream branch. I am blocked by a failure of some kind where I can't continue to the remaining commits in my branch, so I need a way to continue when git reset does not seem to work.
... | The take-away is to look carefully at the summary line. The answer turns out to be `git rebase --continue` if you notice that the summary line of the commit it says cannot be applied, is actually the next commit. I was thrown off by how similar the text on screen was to the usual empty commit message that the command o... |
36367190 | git diff-files output changes after git status | 11 | 2016-04-01 23:09:13 | <p>I have a script, <code>update.py</code>, that downloads new versions of files tracked in my git repository:</p>
<pre><code>$ python update.py
Doing work...
Done
$ git status
On branch my-branch
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- ... | 1,322 | 1,292,061 | 2016-04-06 01:16:18 | 36,439,778 | 14 | 2016-04-06 01:16:18 | 1,292,061 | 2016-04-06 01:16:18 | https://stackoverflow.com/q/36367190 | https://stackoverflow.com/a/36439778 | <p><code>git diff-index</code> does not actually check the contents of files in the working tree. Instead, it uses the stat information of the file and compares it to the index. In fact, the <a href="https://git-scm.com/docs/git-diff-index" rel="noreferrer"><code>diff-index</code> man page notes</a>:</p>
<blockquote>
<... | <p><code>git diff-index</code> does not actually check the contents of files in the working tree. Instead, it uses the stat information of the file and compares it to the index. In fact, the <a href="https://git-scm.com/docs/git-diff-index" rel="noreferrer"><code>diff-index</code> man page notes</a>:</p> <blockquote> <... | 119, 9033 | git, git-diff | <h1>git diff-files output changes after git status</h1>
<p>I have a script, <code>update.py</code>, that downloads new versions of files tracked in my git repository:</p>
<pre><code>$ python update.py
Doing work...
Done
$ git status
On branch my-branch
Changes not staged for commit:
(use "git add <file>..." to... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,293 | git | # git diff-files output changes after git status
I have a script, `update.py`, that downloads new versions of files tracked in my git repository:
```
$ python update.py
Doing work...
Done
$ git status
On branch my-branch
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(us... | `git diff-index` does not actually check the contents of files in the working tree. Instead, it uses the stat information of the file and compares it to the index. In fact, the [`diff-index` man page notes](https://git-scm.com/docs/git-diff-index):
> As with other commands of this type, `git diff-index` does not actua... |
35361843 | Why does git cherry-pick not continue? | 11 | 2016-02-12 11:47:24 | <p>I am trying to cherry-pick changes from two different working brachnes to each other namely I want to cherry-pick the last 5 commits from branch <code>linear</code> to branch <code>diagonal</code>.</p>
<pre><code>git cherry-pick -n -x linear~6..linear
</code></pre>
<p>As expected there are some merging conflicts f... | 15,546 | 2,658,266 | 2016-02-12 15:03:00 | 35,362,636 | 14 | 2016-02-12 12:25:58 | 5,886,984 | 2016-02-12 14:05:53 | https://stackoverflow.com/q/35361843 | https://stackoverflow.com/a/35362636 | <p>Since you have already fixed the conflict file, you need to add it first to continue with git-cherry pick.</p>
<pre><code>git add <modified file-name>
git commit -m "committing changes for file"
git cherry-pick --continue
</code></pre>
<p>Hope it will help.</p>
| <p>Since you have already fixed the conflict file, you need to add it first to continue with git-cherry pick.</p> <pre><code>git add <modified file-name> git commit -m "committing changes for file" git cherry-pick --continue </code></pre> <p>Hope it will help.</p> | 119, 36489, 78810 | cherry-pick, git, git-cherry-pick | <h1>Why does git cherry-pick not continue?</h1>
<p>I am trying to cherry-pick changes from two different working brachnes to each other namely I want to cherry-pick the last 5 commits from branch <code>linear</code> to branch <code>diagonal</code>.</p>
<pre><code>git cherry-pick -n -x linear~6..linear
</code></pre>
<... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,294 | git | # Why does git cherry-pick not continue?
I am trying to cherry-pick changes from two different working brachnes to each other namely I want to cherry-pick the last 5 commits from branch `linear` to branch `diagonal`.
```
git cherry-pick -n -x linear~6..linear
```
As expected there are some merging conflicts for the ... | Since you have already fixed the conflict file, you need to add it first to continue with git-cherry pick.
```
git add <modified file-name>
git commit -m "committing changes for file"
git cherry-pick --continue
```
Hope it will help. |
26238157 | git still shows files as untracked despite .gitignore and rm -r --cached. What did I do wrong? | 11 | 2014-10-07 14:17:09 | <p>I'm not sure what I'm doing wrong in this case with my .gitignore file, but these files keep showing up.</p>
<h2>Background</h2>
<p>I'm using Jekyll to build a blog. Jekyll generates <code>_site</code> and <code>.sass-cache</code> directories when it begins serving.</p>
<p>I previously committed these directories... | 3,408 | 316,847 | 2014-10-07 16:59:03 | 26,240,786 | 14 | 2014-10-07 16:27:48 | 1,548,376 | 2014-10-07 16:59:03 | https://stackoverflow.com/q/26238157 | https://stackoverflow.com/a/26240786 | <p>Your <code>.gitignore</code> file is currently detected as UTF-16LE encoded. Changing encoding to UTF-8 is the solution.</p>
<p>To fix:</p>
<ul>
<li>Open the .gitignore file in a text editor such as Notepad++</li>
<li>Change the encoding (in np++, this is via the <code>Encoding</code> menu) to UTF-8 without BOM</l... | <p>Your <code>.gitignore</code> file is currently detected as UTF-16LE encoded. Changing encoding to UTF-8 is the solution.</p> <p>To fix:</p> <ul> <li>Open the .gitignore file in a text editor such as Notepad++</li> <li>Change the encoding (in np++, this is via the <code>Encoding</code> menu) to UTF-8 without BOM</l... | 119, 25056, 45963 | git, gitignore, jekyll | <h1>git still shows files as untracked despite .gitignore and rm -r --cached. What did I do wrong?</h1>
<p>I'm not sure what I'm doing wrong in this case with my .gitignore file, but these files keep showing up.</p>
<h2>Background</h2>
<p>I'm using Jekyll to build a blog. Jekyll generates <code>_site</code> and <code... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,297 | git | # git still shows files as untracked despite .gitignore and rm -r --cached. What did I do wrong?
I'm not sure what I'm doing wrong in this case with my .gitignore file, but these files keep showing up.
## Background
I'm using Jekyll to build a blog. Jekyll generates `_site` and `.sass-cache` directories when it begi... | Your `.gitignore` file is currently detected as UTF-16LE encoded. Changing encoding to UTF-8 is the solution.
To fix:
- Open the .gitignore file in a text editor such as Notepad++
- Change the encoding (in np++, this is via the `Encoding` menu) to UTF-8 without BOM
- Save the file.
- Add the .gitignore file into stag... |
15577847 | How do I get the list of branches not merged into master, ordered by most recent commit? | 11 | 2013-03-22 18:53:30 | <p>For our buildbot, I want to display the most recently-updated active (non-released) branches. Let's say I have a <code>master</code> branch, as well as the following, from oldest to newest commit:</p>
<ul>
<li><code>branch1</code> (not merged into <code>master</code>)</li>
<li><code>branch2</code> (merged)</li>
<l... | 5,646 | 358,804 | 2020-10-07 20:27:23 | 15,578,409 | 14 | 2013-03-22 19:30:29 | 1,253,222 | 2013-03-22 19:47:20 | https://stackoverflow.com/q/15577847 | https://stackoverflow.com/a/15578409 | <p>You could combine the two, like this:</p>
<pre><code>git for-each-ref --sort=-committerdate --format="%(committerdate:short) %(refname:short)" --count=15 $(git branch -r --no-merged origin/master | sed -e 's#^ *#refs/remotes/#')
</code></pre>
<p>That will limit the <code>for-each-ref</code> to processing only the ... | <p>You could combine the two, like this:</p> <pre><code>git for-each-ref --sort=-committerdate --format="%(committerdate:short) %(refname:short)" --count=15 $(git branch -r --no-merged origin/master | sed -e 's#^ *#refs/remotes/#') </code></pre> <p>That will limit the <code>for-each-ref</code> to processing only the ... | 119 | git | <h1>How do I get the list of branches not merged into master, ordered by most recent commit?</h1>
<p>For our buildbot, I want to display the most recently-updated active (non-released) branches. Let's say I have a <code>master</code> branch, as well as the following, from oldest to newest commit:</p>
<ul>
<li><code>b... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,299 | git | # How do I get the list of branches not merged into master, ordered by most recent commit?
For our buildbot, I want to display the most recently-updated active (non-released) branches. Let's say I have a `master` branch, as well as the following, from oldest to newest commit:
- `branch1` (not merged into `master`)
- ... | You could combine the two, like this:
```
git for-each-ref --sort=-committerdate --format="%(committerdate:short) %(refname:short)" --count=15 $(git branch -r --no-merged origin/master | sed -e 's#^ *#refs/remotes/#')
```
That will limit the `for-each-ref` to processing only the branches that `branch --no-merged` rep... |
15353858 | git init in a git subdirectory | 11 | 2013-03-12 05:19:30 | <p>I have a git repo which has some subdirectories:</p>
<pre><code>~/src
~/src/.git
~/src/mystuff
~/src/otherstuff
</code></pre>
<p>Now I want to share <code>src/otherstuff</code> with someone else. They should be able to clone it and push changes in <code>otherstuff</code>, but I don't want them to be able to access <... | 10,296 | 674,039 | 2025-11-25 14:05:56 | 15,355,297 | 14 | 2013-03-12 07:09:41 | 6,309 | 2025-11-25 14:05:56 | https://stackoverflow.com/q/15353858 | https://stackoverflow.com/a/15355297 | <p>2013: Making a <code>git init</code> within a git repo works: the directory in which you init the <em>nested</em> repo simply becomes ignored by the parent repo.</p>
<p>However, if the history of that subdirectory is important, is is best to <a href="https://stackoverflow.com/a/1662787/6309">export it as a separate ... | <p>2013: Making a <code>git init</code> within a git repo works: the directory in which you init the <em>nested</em> repo simply becomes ignored by the parent repo.</p> <p>However, if the history of that subdirectory is important, is is best to <a href="https://stackoverflow.com/a/1662787/6309">export it as a separate ... | 119, 41612, 68200 | git, git-submodules, git-subtree | <h1>git init in a git subdirectory</h1>
<p>I have a git repo which has some subdirectories:</p>
<pre><code>~/src
~/src/.git
~/src/mystuff
~/src/otherstuff
</code></pre>
<p>Now I want to share <code>src/otherstuff</code> with someone else. They should be able to clone it and push changes in <code>otherstuff</code>, but ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,300 | git | # git init in a git subdirectory
I have a git repo which has some subdirectories:
```
~/src
~/src/.git
~/src/mystuff
~/src/otherstuff
```
Now I want to share `src/otherstuff` with someone else. They should be able to clone it and push changes in `otherstuff`, but I don't want them to be able to access `src`, commits... | 2013: Making a `git init` within a git repo works: the directory in which you init the *nested* repo simply becomes ignored by the parent repo.
However, if the history of that subdirectory is important, is is best to [export it as a separate repo](https://stackoverflow.com/a/1662787/6309) (as [Nick](https://stackoverf... |
13819764 | indentation configuration only for some files | 11 | 2012-12-11 11:49:28 | <p>I want to use</p>
<pre><code>git config core.whitespace tab-in-indent,tabwidth=4
</code></pre>
<p>I want to have these settings for c++ files, so that I get warnings when there are wrong indentations when I use git diff. However, I have also Makefiles which need tabs. Is there a way to configure different whitespa... | 3,703 | 181,874 | 2019-07-28 19:46:40 | 13,823,013 | 14 | 2012-12-11 15:26:55 | 683,080 | 2015-08-27 01:47:13 | https://stackoverflow.com/q/13819764 | https://stackoverflow.com/a/13823013 | <p>You can use <a href="http://git-scm.com/docs/gitattributes" rel="noreferrer"><code>gitattributes</code></a> to tweak these settings. Here's a snippet of my .gitattributes file:</p>
<pre><code>*.c text diff=cpp whitespace=trailing-space,space-before-tab,tab-in-indent
*.cpp text diff=cpp whitespace=trailing-sp... | <p>You can use <a href="http://git-scm.com/docs/gitattributes" rel="noreferrer"><code>gitattributes</code></a> to tweak these settings. Here's a snippet of my .gitattributes file:</p> <pre><code>*.c text diff=cpp whitespace=trailing-space,space-before-tab,tab-in-indent *.cpp text diff=cpp whitespace=trailing-sp... | 119 | git | <h1>indentation configuration only for some files</h1>
<p>I want to use</p>
<pre><code>git config core.whitespace tab-in-indent,tabwidth=4
</code></pre>
<p>I want to have these settings for c++ files, so that I get warnings when there are wrong indentations when I use git diff. However, I have also Makefiles which ne... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,301 | git | # indentation configuration only for some files
I want to use
```
git config core.whitespace tab-in-indent,tabwidth=4
```
I want to have these settings for c++ files, so that I get warnings when there are wrong indentations when I use git diff. However, I have also Makefiles which need tabs. Is there a way to config... | You can use [`gitattributes`](http://git-scm.com/docs/gitattributes) to tweak these settings. Here's a snippet of my .gitattributes file:
```
*.c text diff=cpp whitespace=trailing-space,space-before-tab,tab-in-indent
*.cpp text diff=cpp whitespace=trailing-space,space-before-tab,tab-in-indent
*.h text diff=c... |
13250633 | Remove a file with a strange name from git | 11 | 2012-11-06 12:02:33 | <p>I have a file that managed to get itself named:</p>
<pre><code># file's name (both lines)
companies.yml
companies.yml
# entry in my git working tree
"test/fixtures/companies.yml\342\200\250companies.yml"
</code></pre>
<p>For annoying reasons, the working tree on this particular project is full of other fi... | 4,741 | 341,583 | 2018-06-03 22:20:57 | 13,250,936 | 14 | 2012-11-06 12:21:04 | 118,875 | 2012-11-06 12:21:04 | https://stackoverflow.com/q/13250633 | https://stackoverflow.com/a/13250936 | <p>Git is printing the literal octets of the UTF-8 encoding of the filename because they are non-ASCII characters, and printing them as octal escapes. However, your shell does not understand them and is sending literal backslashes and digits to the git command when you cut and paste, so you're actually entering a diffe... | <p>Git is printing the literal octets of the UTF-8 encoding of the filename because they are non-ASCII characters, and printing them as octal escapes. However, your shell does not understand them and is sending literal backslashes and digits to the git command when you cut and paste, so you're actually entering a diffe... | 119 | git | <h1>Remove a file with a strange name from git</h1>
<p>I have a file that managed to get itself named:</p>
<pre><code># file's name (both lines)
companies.yml
companies.yml
# entry in my git working tree
"test/fixtures/companies.yml\342\200\250companies.yml"
</code></pre>
<p>For annoying reasons, the working... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,302 | git | # Remove a file with a strange name from git
I have a file that managed to get itself named:
```
# file's name (both lines)
companies.yml
companies.yml
# entry in my git working tree
"test/fixtures/companies.yml\342\200\250companies.yml"
```
For annoying reasons, the working tree on this particular project is full ... | Git is printing the literal octets of the UTF-8 encoding of the filename because they are non-ASCII characters, and printing them as octal escapes. However, your shell does not understand them and is sending literal backslashes and digits to the git command when you cut and paste, so you're actually entering a differen... |
11461680 | Git workflow (Dev>Staging>Live) basic technical questions | 11 | 2012-07-12 22:30:03 | <p>I'm quite new to Git (and VC for that matter) and I'm struggling a bit to understand the concept behind the Dev>Staging>Live workflow using branches.</p>
<p>I'm trying to apply part of <strong><a href="http://nvie.com/posts/a-successful-git-branching-model/" rel="noreferrer">this</a></strong> workflow, that uses <e... | 6,854 | 376,756 | 2012-07-13 02:24:19 | 11,461,825 | 14 | 2012-07-12 22:45:20 | 912,144 | 2012-07-12 22:45:20 | https://stackoverflow.com/q/11461680 | https://stackoverflow.com/a/11461825 | <p>You don't need to create different repositories. What you should learn and you'll probably love about git is how easy it is to work with branches. So step 1:</p>
<ul>
<li>Forget about anything you know from your SVN background</li>
</ul>
<p>Now that we are all set, here is the idea. Let's say you have currently on... | <p>You don't need to create different repositories. What you should learn and you'll probably love about git is how easy it is to work with branches. So step 1:</p> <ul> <li>Forget about anything you know from your SVN background</li> </ul> <p>Now that we are all set, here is the idea. Let's say you have currently on... | 119, 758, 8337 | bitbucket, git, workflow | <h1>Git workflow (Dev>Staging>Live) basic technical questions</h1>
<p>I'm quite new to Git (and VC for that matter) and I'm struggling a bit to understand the concept behind the Dev>Staging>Live workflow using branches.</p>
<p>I'm trying to apply part of <strong><a href="http://nvie.com/posts/a-successful-git-branchin... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,303 | git | # Git workflow (Dev>Staging>Live) basic technical questions
I'm quite new to Git (and VC for that matter) and I'm struggling a bit to understand the concept behind the Dev>Staging>Live workflow using branches.
I'm trying to apply part of **[this](http://nvie.com/posts/a-successful-git-branching-model/)** workflow, th... | You don't need to create different repositories. What you should learn and you'll probably love about git is how easy it is to work with branches. So step 1:
- Forget about anything you know from your SVN background
Now that we are all set, here is the idea. Let's say you have currently only `master` on your bitbucke... |
10711664 | How to make `git log --stat -- <path>` show *all* files in selected commits? | 11 | 2012-05-22 23:51:00 | <p>When I use a <code><path></code> argument with <code>git log --stat</code> to limit the log to
commits modifying <code><path></code>, git lists <code><path></code> as the only modified file when
displaying the selected commits. I would instead like to see <em>all</em> modified
paths listed for eac... | 3,561 | 470,844 | 2015-02-20 18:29:44 | 10,713,967 | 14 | 2012-05-23 05:29:01 | 371,237 | 2012-05-23 05:29:01 | https://stackoverflow.com/q/10711664 | https://stackoverflow.com/a/10713967 | <p>You can get this behavior using the <code>--full-diff</code> option:</p>
<pre><code> --full-diff
Without this flag, "git log -p <path>..." shows commits that touch
the specified paths, and diffs about the same specified paths. With
this, the full diff is shown for commits that touch the... | <p>You can get this behavior using the <code>--full-diff</code> option:</p> <pre><code> --full-diff Without this flag, "git log -p <path>..." shows commits that touch the specified paths, and diffs about the same specified paths. With this, the full diff is shown for commits that touch the... | 119 | git | <h1>How to make `git log --stat -- <path>` show *all* files in selected commits?</h1>
<p>When I use a <code><path></code> argument with <code>git log --stat</code> to limit the log to
commits modifying <code><path></code>, git lists <code><path></code> as the only modified file when
displaying the sel... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,304 | git | # How to make `git log --stat -- ` show *all* files in selected commits?
When I use a `<path>` argument with `git log --stat` to limit the log to
commits modifying `<path>`, git lists `<path>` as the only modified file when
displaying the selected commits. I would instead like to see *all* modified
paths listed for ea... | You can get this behavior using the `--full-diff` option:
```
--full-diff
Without this flag, "git log -p <path>..." shows commits that touch
the specified paths, and diffs about the same specified paths. With
this, the full diff is shown for commits that touch the specified
paths; this m... |
10116190 | How can I determine why a Git merge deleted some lines of code? | 11 | 2012-04-12 01:18:44 | <p>We had a release and the commit in question (daf7110) was in the history that was merged back to master. At this point (85a13270), master has the lines of code that were added by daf7110.</p>
<p>When one of our developers merged master into his branch (dev-branch), the lines of code went away. They never existed i... | 9,415 | 166 | 2021-04-10 21:06:00 | 10,117,266 | 14 | 2012-04-12 04:12:37 | 69,755 | 2021-04-10 20:56:08 | https://stackoverflow.com/q/10116190 | https://stackoverflow.com/a/10117266 | <p>I don't know of a reason off the top of my head why this would happen, but I can give some debugging tips.</p>
<p>First, I would make sure that you don't have any odd settings. Do a fresh clone of a repository that has both of these branches, in an account that has no Git configuration. Try doing a merge. Does it st... | <p>I don't know of a reason off the top of my head why this would happen, but I can give some debugging tips.</p> <p>First, I would make sure that you don't have any odd settings. Do a fresh clone of a repository that has both of these branches, in an account that has no Git configuration. Try doing a merge. Does it st... | 119 | git | <h1>How can I determine why a Git merge deleted some lines of code?</h1>
<p>We had a release and the commit in question (daf7110) was in the history that was merged back to master. At this point (85a13270), master has the lines of code that were added by daf7110.</p>
<p>When one of our developers merged master into hi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,305 | git | # How can I determine why a Git merge deleted some lines of code?
We had a release and the commit in question (daf7110) was in the history that was merged back to master. At this point (85a13270), master has the lines of code that were added by daf7110.
When one of our developers merged master into his branch (dev-br... | I don't know of a reason off the top of my head why this would happen, but I can give some debugging tips.
First, I would make sure that you don't have any odd settings. Do a fresh clone of a repository that has both of these branches, in an account that has no Git configuration. Try doing a merge. Does it still happe... |
9141270 | Reverting a broken merge and reapplying selected commits with Git | 11 | 2012-02-04 13:38:42 | <p>We recently encountered a problem where a merge somehow led to all the changes leading to one parent being undone in the merge commit, and several commits have been applied after that point. All this has been pushed to our shared origin repository. I want to be able to revert the bad merge and reapply the other chan... | 8,265 | 28,875 | 2015-02-09 21:09:00 | 9,141,447 | 14 | 2012-02-04 14:08:14 | 75,170 | 2015-02-09 21:09:00 | https://stackoverflow.com/q/9141270 | https://stackoverflow.com/a/9141447 | <p>You want to wind up with something whose logical effect is:</p>
<pre><code>P-Q-1-2-3-4-A-B-C-D-X-Y-Z
</code></pre>
<p>There are a couple of approaches. Let's assume master points to <code>Z</code> right now.</p>
<hr>
<h2>Revert the merge commit (safest but messier)</h2>
<p>We need to revert the broken merge com... | <p>You want to wind up with something whose logical effect is:</p> <pre><code>P-Q-1-2-3-4-A-B-C-D-X-Y-Z </code></pre> <p>There are a couple of approaches. Let's assume master points to <code>Z</code> right now.</p> <hr> <h2>Revert the merge commit (safest but messier)</h2> <p>We need to revert the broken merge com... | 119, 717, 31409 | git, merge, tortoisegit | <h1>Reverting a broken merge and reapplying selected commits with Git</h1>
<p>We recently encountered a problem where a merge somehow led to all the changes leading to one parent being undone in the merge commit, and several commits have been applied after that point. All this has been pushed to our shared origin repos... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,306 | git | # Reverting a broken merge and reapplying selected commits with Git
We recently encountered a problem where a merge somehow led to all the changes leading to one parent being undone in the merge commit, and several commits have been applied after that point. All this has been pushed to our shared origin repository. I ... | You want to wind up with something whose logical effect is:
```
P-Q-1-2-3-4-A-B-C-D-X-Y-Z
```
There are a couple of approaches. Let's assume master points to `Z` right now.
---
## Revert the merge commit (safest but messier)
We need to revert the broken merge commit `M` first. We'll do that with:
```
git revert -... |
4996809 | How to commit a long Git merge in the middle of resolving conflicts | 11 | 2011-02-14 20:16:06 | <p>I have a big merge going on with over 300 conflicting files. I want to resolve these using mergetool, but there's no way I'm going to finish it all in one sitting. How can I commit the merge and then come back later and continue the same merge? Normally it seems git doesn't allow you to commit if there are conflicts... | 3,345 | 439,332 | 2011-02-14 21:33:09 | 4,997,518 | 14 | 2011-02-14 21:33:09 | 119,963 | 2011-02-14 21:33:09 | https://stackoverflow.com/q/4996809 | https://stackoverflow.com/a/4997518 | <p>I'm assuming by "can't do it in one sitting" you actually mean "want to do some other things before I finish" - since you could just leave the partially resolved merge in your work tree otherwise.</p>
<p>First, before you go to any trouble, note that you could simply create another clone of the repository - the par... | <p>I'm assuming by "can't do it in one sitting" you actually mean "want to do some other things before I finish" - since you could just leave the partially resolved merge in your work tree otherwise.</p> <p>First, before you go to any trouble, note that you could simply create another clone of the repository - the par... | 119, 717, 3146, 5597 | commit, conflict, git, merge | <h1>How to commit a long Git merge in the middle of resolving conflicts</h1>
<p>I have a big merge going on with over 300 conflicting files. I want to resolve these using mergetool, but there's no way I'm going to finish it all in one sitting. How can I commit the merge and then come back later and continue the same me... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,307 | git | # How to commit a long Git merge in the middle of resolving conflicts
I have a big merge going on with over 300 conflicting files. I want to resolve these using mergetool, but there's no way I'm going to finish it all in one sitting. How can I commit the merge and then come back later and continue the same merge? Norm... | I'm assuming by "can't do it in one sitting" you actually mean "want to do some other things before I finish" - since you could just leave the partially resolved merge in your work tree otherwise.
First, before you go to any trouble, note that you could simply create another clone of the repository - the partially res... |
1951137 | Git post-receive hook to update a local clone owned by a different user | 11 | 2009-12-23 07:06:05 | <p>I'm trying to set up a git post-receive hook such that when a commit is received, another clone of the repository on the machine gets updated (i.e. does a <code>git pull origin master</code>). I'm using gitosis to serve the repository and as such I believe a post-receive hook will be run as the <code>gitosis</code> ... | 5,986 | 90,551 | 2012-06-21 17:35:04 | 1,951,266 | 14 | 2009-12-23 07:50:20 | 180,174 | 2009-12-23 08:31:23 | https://stackoverflow.com/q/1951137 | https://stackoverflow.com/a/1951266 | <p>IMHO This should be on serverfault, but here's the answer nevertheless;</p>
<p>Add:</p>
<pre><code>gitosis ALL=(www-data) NOPASSWD: /path/to/git
</code></pre>
<p>to /etc/sudoers</p>
<p>and run the command as <code>sudo -u www-data <whatever the command is></code></p>
| <p>IMHO This should be on serverfault, but here's the answer nevertheless;</p> <p>Add:</p> <pre><code>gitosis ALL=(www-data) NOPASSWD: /path/to/git </code></pre> <p>to /etc/sudoers</p> <p>and run the command as <code>sudo -u www-data <whatever the command is></code></p> | 119, 853, 4884 | git, hook, setuid | <h1>Git post-receive hook to update a local clone owned by a different user</h1>
<p>I'm trying to set up a git post-receive hook such that when a commit is received, another clone of the repository on the machine gets updated (i.e. does a <code>git pull origin master</code>). I'm using gitosis to serve the repository a... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,308 | git | # Git post-receive hook to update a local clone owned by a different user
I'm trying to set up a git post-receive hook such that when a commit is received, another clone of the repository on the machine gets updated (i.e. does a `git pull origin master`). I'm using gitosis to serve the repository and as such I believe... | IMHO This should be on serverfault, but here's the answer nevertheless;
Add:
```
gitosis ALL=(www-data) NOPASSWD: /path/to/git
```
to /etc/sudoers
and run the command as `sudo -u www-data <whatever the command is>` |
59812841 | Git index and commit is very slow | 10 | 2020-01-19 17:58:06 | <p>I have a local git repository and use <code>git add file1 file2 file3...</code> to add my modifications to the git index. Afterwards I use a plain <code>git commit</code>. Each command takes around 3 to 6 seconds. My repository has around 150.000 commits.</p>
<p>I already executed <code>git gc</code> since I assume... | 11,111 | 10,050,942 | 2023-01-20 20:53:04 | 59,817,528 | 14 | 2020-01-20 05:38:36 | 6,309 | 2023-01-20 20:53:04 | https://stackoverflow.com/q/59812841 | https://stackoverflow.com/a/59817528 | <p>First, update to the latest Git 2.25: performance issues are resolved with each new version.</p>
<p>To investigate performance issues, set the <code>GIT_TRACE2_PERF</code> environment variable to <code>1</code> and run the <code>git</code> command. <a href="https://stackoverflow.com/a/56094711/6309">See this SO answ... | <p>First, update to the latest Git 2.25: performance issues are resolved with each new version.</p> <p>To investigate performance issues, set the <code>GIT_TRACE2_PERF</code> environment variable to <code>1</code> and run the <code>git</code> command. <a href="https://stackoverflow.com/a/56094711/6309">See this SO answ... | 119 | git | <h1>Git index and commit is very slow</h1>
<p>I have a local git repository and use <code>git add file1 file2 file3...</code> to add my modifications to the git index. Afterwards I use a plain <code>git commit</code>. Each command takes around 3 to 6 seconds. My repository has around 150.000 commits.</p>
<p>I already ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,312 | git | # Git index and commit is very slow
I have a local git repository and use `git add file1 file2 file3...` to add my modifications to the git index. Afterwards I use a plain `git commit`. Each command takes around 3 to 6 seconds. My repository has around 150.000 commits.
I already executed `git gc` since I assumed it w... | First, update to the latest Git 2.25: performance issues are resolved with each new version.
To investigate performance issues, set the `GIT_TRACE2_PERF` environment variable to `1` and run the `git` command. [See this SO answer for details about the `trace2` feature and how to interpret the output table](https://stac... |
53927301 | List all files changed by a specific user in a Git repository | 10 | 2018-12-26 04:03:00 | <p>How do I get a list of all files changed by a specific user in a Git repository?</p>
<p>Using <code>$ git blame</code> will tell you who has changed each line of a file, but that's only limited to one file, includes the whole line by default, and doesn't include historic changes that might have been overwritten.</p... | 6,233 | 1,420,079 | 2018-12-26 14:51:10 | 53,927,502 | 14 | 2018-12-26 04:42:58 | 6,330,106 | 2018-12-26 04:42:58 | https://stackoverflow.com/q/53927301 | https://stackoverflow.com/a/53927502 | <pre><code>git log --pretty= --committer=<username> --name-only | sort -u
</code></pre>
<p><code>--pretty=</code> suppresses the contents of commit logs as you don't need them here. <code>--committer=<username></code> limits the output to commits whose committer is <code>username</code>. If you want author... | <pre><code>git log --pretty= --committer=<username> --name-only | sort -u </code></pre> <p><code>--pretty=</code> suppresses the contents of commit logs as you don't need them here. <code>--committer=<username></code> limits the output to commits whose committer is <code>username</code>. If you want author... | 119 | git | <h1>List all files changed by a specific user in a Git repository</h1>
<p>How do I get a list of all files changed by a specific user in a Git repository?</p>
<p>Using <code>$ git blame</code> will tell you who has changed each line of a file, but that's only limited to one file, includes the whole line by default, an... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,315 | git | # List all files changed by a specific user in a Git repository
How do I get a list of all files changed by a specific user in a Git repository?
Using `$ git blame` will tell you who has changed each line of a file, but that's only limited to one file, includes the whole line by default, and doesn't include historic ... | ```
git log --pretty= --committer=<username> --name-only | sort -u
```
`--pretty=` suppresses the contents of commit logs as you don't need them here. `--committer=<username>` limits the output to commits whose committer is `username`. If you want author name, use `--author=<username>` instead. `--name-only` prints th... |
50639408 | How to `--assume-unchanged` file in project? | 10 | 2018-06-01 08:42:48 | <p>I have config file: <code>conf/local.conf</code> I run next command for it:</p>
<pre><code>git update-index --assume-unchanged local.conf
</code></pre>
<p>and it is OK until I switch to another branch or pull.</p>
<p>How to preserve <code>--assume-unchanged</code> flag between branches?</p>
<p><strong>UPD</stron... | 7,939 | 4,632,019 | 2018-06-01 14:24:54 | 50,645,616 | 14 | 2018-06-01 14:24:54 | 717,372 | 2018-06-01 14:24:54 | https://stackoverflow.com/q/50639408 | https://stackoverflow.com/a/50645616 | <p>Don't use <code>--assume-unchanged</code> that should be used for performance problem for big files not changing and that are costly to hash when doing a <code>git status</code>.</p>
<p>What you want is <code>--skip-worktree</code> that do nearly the same things but to handle files that you changed but don't want t... | <p>Don't use <code>--assume-unchanged</code> that should be used for performance problem for big files not changing and that are costly to hash when doing a <code>git status</code>.</p> <p>What you want is <code>--skip-worktree</code> that do nearly the same things but to handle files that you changed but don't want t... | 119, 108784 | git, git-assume-unchanged | <h1>How to `--assume-unchanged` file in project?</h1>
<p>I have config file: <code>conf/local.conf</code> I run next command for it:</p>
<pre><code>git update-index --assume-unchanged local.conf
</code></pre>
<p>and it is OK until I switch to another branch or pull.</p>
<p>How to preserve <code>--assume-unchanged</c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,317 | git | # How to `--assume-unchanged` file in project?
I have config file: `conf/local.conf` I run next command for it:
```
git update-index --assume-unchanged local.conf
```
and it is OK until I switch to another branch or pull.
How to preserve `--assume-unchanged` flag between branches?
**UPD**
Some examples what is c... | Don't use `--assume-unchanged` that should be used for performance problem for big files not changing and that are costly to hash when doing a `git status`.
What you want is `--skip-worktree` that do nearly the same things but to handle files that you changed but don't want to commit.
See <https://stackoverflow.com/a... |
38434161 | Is there a git command to show new upstream commits after fetch? | 10 | 2016-07-18 10:16:41 | <p>Is there some shortcut to specify the interval of fetched, new commits from remote tracking branch? Instead of typing this long command that is also branch specific:</p>
<pre><code>git log branchName..origin/branchName
</code></pre>
<p>I am looking for some git interval hack, that will represent interval of branch... | 3,798 | 2,331,529 | 2018-01-18 20:39:30 | 40,894,936 | 14 | 2016-11-30 17:47:08 | 33,342 | 2018-01-18 20:39:30 | https://stackoverflow.com/q/38434161 | https://stackoverflow.com/a/40894936 | <p>This will do what you want, provided you have remote tracking configured for your branch:</p>
<pre><code>git log ..@{u}
</code></pre>
<p>It will show all the commits on <code>remotes/branch</code> which are not already on your local <code>branch</code>. If you want to also see your local commits which have not be... | <p>This will do what you want, provided you have remote tracking configured for your branch:</p> <pre><code>git log ..@{u} </code></pre> <p>It will show all the commits on <code>remotes/branch</code> which are not already on your local <code>branch</code>. If you want to also see your local commits which have not be... | 119, 7201, 11225, 47913 | command-line-interface, git, git-log, shortcut | <h1>Is there a git command to show new upstream commits after fetch?</h1>
<p>Is there some shortcut to specify the interval of fetched, new commits from remote tracking branch? Instead of typing this long command that is also branch specific:</p>
<pre><code>git log branchName..origin/branchName
</code></pre>
<p>I am ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,319 | git | # Is there a git command to show new upstream commits after fetch?
Is there some shortcut to specify the interval of fetched, new commits from remote tracking branch? Instead of typing this long command that is also branch specific:
```
git log branchName..origin/branchName
```
I am looking for some git interval hac... | This will do what you want, provided you have remote tracking configured for your branch:
```
git log ..@{u}
```
It will show all the commits on `remotes/branch` which are not already on your local `branch`. If you want to also see your local commits which have not been pushed, use three dots:
```
git log ...@{u}
``... |
39878955 | Git stuck on master | MERGING | 10 | 2016-10-05 16:08:59 | <p>There are two remotes assigned, <code>origin</code> is used to pull the changes and <code>harmeet</code> is the production. </p>
<p>I tried <code>git reset --hard</code> but as soon as I pull latest changes the status reverts to <code>master | MERGING</code> and then I can't push latest code to <code>harmeet</code>... | 35,209 | 1,263,571 | 2017-12-15 11:29:04 | 39,880,054 | 14 | 2016-10-05 17:13:50 | 2,747,593 | 2016-10-05 17:13:50 | https://stackoverflow.com/q/39878955 | https://stackoverflow.com/a/39880054 | <p>As mentioned in <a href="//stackoverflow.com/questions/39878955/git-stuck-on-master-merging#comment67044603_39878955">@Holger's comment</a>, you can do <code>git merge --abort</code> to abort the merge. However, you might not want to do that. The merge happens because the remote (<code>origin</code>) has changes tha... | <p>As mentioned in <a href="//stackoverflow.com/questions/39878955/git-stuck-on-master-merging#comment67044603_39878955">@Holger's comment</a>, you can do <code>git merge --abort</code> to abort the merge. However, you might not want to do that. The merge happens because the remote (<code>origin</code>) has changes tha... | 119 | git | <h1>Git stuck on master | MERGING</h1>
<p>There are two remotes assigned, <code>origin</code> is used to pull the changes and <code>harmeet</code> is the production. </p>
<p>I tried <code>git reset --hard</code> but as soon as I pull latest changes the status reverts to <code>master | MERGING</code> and then I can't p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,320 | git | # Git stuck on master | MERGING
There are two remotes assigned, `origin` is used to pull the changes and `harmeet` is the production.
I tried `git reset --hard` but as soon as I pull latest changes the status reverts to `master | MERGING` and then I can't push latest code to `harmeet` because Git tells me everything ... | As mentioned in [@Holger's comment](//stackoverflow.com/questions/39878955/git-stuck-on-master-merging#comment67044603_39878955), you can do `git merge --abort` to abort the merge. However, you might not want to do that. The merge happens because the remote (`origin`) has changes that you don't have locally. Your histo... |
35320740 | Understanding "git pull --rebase" vs "git rebase" | 10 | 2016-02-10 16:31:59 | <p>According to my understanding of <code>git pull --rebase origin master</code>, it should be the equivalent of running the following commands:</p>
<pre><code>(from branch master): $ git fetch origin
(from branch master): $ git rebase origin/master
</code></pre>
<p>I seem to have found some case where this doesn't... | 4,223 | 191,289 | 2016-11-30 14:03:58 | 35,324,115 | 14 | 2016-02-10 19:22:10 | 1,256,452 | 2016-11-30 14:03:58 | https://stackoverflow.com/q/35320740 | https://stackoverflow.com/a/35324115 | <p>(Edit, 30 Nov 2016: see also <a href="https://stackoverflow.com/a/40886668/1256452">this answer</a> to <a href="https://stackoverflow.com/q/22790765/1256452">Why is git rebase discarding my commits?</a>. It is now virtually certain that it is due to the fork-point option.)</p>
<p>There <em>are</em> a few differenc... | <p>(Edit, 30 Nov 2016: see also <a href="https://stackoverflow.com/a/40886668/1256452">this answer</a> to <a href="https://stackoverflow.com/q/22790765/1256452">Why is git rebase discarding my commits?</a>. It is now virtually certain that it is due to the fork-point option.)</p> <p>There <em>are</em> a few differenc... | 119, 456, 8974 | git, rebase, version-control | <h1>Understanding "git pull --rebase" vs "git rebase"</h1>
<p>According to my understanding of <code>git pull --rebase origin master</code>, it should be the equivalent of running the following commands:</p>
<pre><code>(from branch master): $ git fetch origin
(from branch master): $ git rebase origin/master
</code><... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,321 | git | # Understanding "git pull --rebase" vs "git rebase"
According to my understanding of `git pull --rebase origin master`, it should be the equivalent of running the following commands:
```
(from branch master): $ git fetch origin
(from branch master): $ git rebase origin/master
```
I seem to have found some case whe... | (Edit, 30 Nov 2016: see also [this answer](https://stackoverflow.com/a/40886668/1256452) to [Why is git rebase discarding my commits?](https://stackoverflow.com/q/22790765/1256452). It is now virtually certain that it is due to the fork-point option.)
There *are* a few differences between manual and `pull`-based `git ... |
32849840 | How to create tag with forward slash in its name | 10 | 2015-09-29 17:05:54 | <p>Is there any way to create git tag with forward slash in its name when I already have the similar-looking one?</p>
<p>Suppose that I have "1.16.0" tag and I want to create "1.16.0/1.0.0" tag:</p>
<pre><code>$ git tag "1.16.0/1.0.0"
error: 'refs/tags/1.16.0' exists; cannot create 'refs/tags/1.16.0/1.0.0'
fatal: ref... | 4,087 | 1,608,835 | 2018-09-06 11:52:35 | 32,850,142 | 14 | 2015-09-29 17:24:20 | 1,229,023 | 2015-09-29 18:09:32 | https://stackoverflow.com/q/32849840 | https://stackoverflow.com/a/32850142 | <p>It's not possible. See, the name of tag (any reference, in fact; the same goes with branches) is treated as the name of the file system object, created in <code>$GIT_DIR/refs</code> folder of your repository. This object stores the hash commit the tag is attached to.</p>
<p>With tag <code>foo</code>, it's easy - fi... | <p>It's not possible. See, the name of tag (any reference, in fact; the same goes with branches) is treated as the name of the file system object, created in <code>$GIT_DIR/refs</code> folder of your repository. This object stores the hash commit the tag is attached to.</p> <p>With tag <code>foo</code>, it's easy - fi... | 115, 119, 60718 | git, git-tag, tags | <h1>How to create tag with forward slash in its name</h1>
<p>Is there any way to create git tag with forward slash in its name when I already have the similar-looking one?</p>
<p>Suppose that I have "1.16.0" tag and I want to create "1.16.0/1.0.0" tag:</p>
<pre><code>$ git tag "1.16.0/1.0.0"
error: 'refs/tags/1.16.0'... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,322 | git | # How to create tag with forward slash in its name
Is there any way to create git tag with forward slash in its name when I already have the similar-looking one?
Suppose that I have "1.16.0" tag and I want to create "1.16.0/1.0.0" tag:
```
$ git tag "1.16.0/1.0.0"
error: 'refs/tags/1.16.0' exists; cannot create 'ref... | It's not possible. See, the name of tag (any reference, in fact; the same goes with branches) is treated as the name of the file system object, created in `$GIT_DIR/refs` folder of your repository. This object stores the hash commit the tag is attached to.
With tag `foo`, it's easy - file `foo` is created in `$GIT_DIR... |
32838533 | Change the origin of git branch | 10 | 2015-09-29 07:49:05 | <p>I have created branch this way:</p>
<pre><code>git branch MyBranch origin/test
</code></pre>
<p><code>test</code> was branch parallel to master. Now test is merged into master</p>
<p>How can i change the origin of <code>MyBranch</code> so it points to master</p>
| 18,152 | 3,546,762 | 2015-09-29 07:56:23 | 32,838,663 | 14 | 2015-09-29 07:56:23 | 14,660 | 2015-09-29 07:56:23 | https://stackoverflow.com/q/32838533 | https://stackoverflow.com/a/32838663 | <p>There is no "origin" of a branch. A "branch" is just a label pointing at particular commit.</p>
<p>If you've made no commits to MyBranch, then you can delete and recreate it.</p>
<pre><code>git branch -d MyBranch
git branch MyBranch master
</code></pre>
<p>If you have done work on MyBranch, then things are a litt... | <p>There is no "origin" of a branch. A "branch" is just a label pointing at particular commit.</p> <p>If you've made no commits to MyBranch, then you can delete and recreate it.</p> <pre><code>git branch -d MyBranch git branch MyBranch master </code></pre> <p>If you have done work on MyBranch, then things are a litt... | 119, 41346 | git, git-remote | <h1>Change the origin of git branch</h1>
<p>I have created branch this way:</p>
<pre><code>git branch MyBranch origin/test
</code></pre>
<p><code>test</code> was branch parallel to master. Now test is merged into master</p>
<p>How can i change the origin of <code>MyBranch</code> so it points to master</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,323 | git | # Change the origin of git branch
I have created branch this way:
```
git branch MyBranch origin/test
```
`test` was branch parallel to master. Now test is merged into master
How can i change the origin of `MyBranch` so it points to master | There is no "origin" of a branch. A "branch" is just a label pointing at particular commit.
If you've made no commits to MyBranch, then you can delete and recreate it.
```
git branch -d MyBranch
git branch MyBranch master
```
If you have done work on MyBranch, then things are a little more complicated. Your situatio... |
31447637 | How to list all unchanged (tracked) files? | 10 | 2015-07-16 07:15:05 | <p>I unzipped an older "git-image" onto my git repository and most of the files have been changed. I would like to know which files remained untouched. How to list these files?</p>
| 1,468 | 3,719,454 | 2018-01-24 20:53:07 | 31,448,015 | 14 | 2015-07-16 07:32:48 | 2,082,964 | 2018-01-24 20:53:07 | https://stackoverflow.com/q/31447637 | https://stackoverflow.com/a/31448015 | <p>I didn't find anything purely git, but with some bash it is possible:</p>
<pre><code>( git ls-files --modified ; git ls-files ) | sort | uniq -u
</code></pre>
<p><strong>explanation</strong></p>
<ul>
<li><code>git ls-files</code> lists all files tracked by git </li>
<li><code>git ls-files --modified</code> lists ... | <p>I didn't find anything purely git, but with some bash it is possible:</p> <pre><code>( git ls-files --modified ; git ls-files ) | sort | uniq -u </code></pre> <p><strong>explanation</strong></p> <ul> <li><code>git ls-files</code> lists all files tracked by git </li> <li><code>git ls-files --modified</code> lists ... | 119, 54839 | git, git-status | <h1>How to list all unchanged (tracked) files?</h1>
<p>I unzipped an older "git-image" onto my git repository and most of the files have been changed. I would like to know which files remained untouched. How to list these files?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,324 | git | # How to list all unchanged (tracked) files?
I unzipped an older "git-image" onto my git repository and most of the files have been changed. I would like to know which files remained untouched. How to list these files? | I didn't find anything purely git, but with some bash it is possible:
```
( git ls-files --modified ; git ls-files ) | sort | uniq -u
```
**explanation**
- `git ls-files` lists all files tracked by git
- `git ls-files --modified` lists all the **modified** files tracked by git
- the rest is some bash scripting to re... |
27764857 | How does git-review work? | 10 | 2015-01-04 11:03:39 | <p>I want to know, how exactly does <code>git review</code> command work? I mean does it use <code>git push</code> command (internally) or something else to upload the changes to gerrit. This information would be useful for me while writing git hooks for <code>git review</code>.</p>
| 18,067 | 3,959,387 | 2015-04-26 21:21:20 | 27,765,424 | 14 | 2015-01-04 12:20:31 | 244,297 | 2015-01-04 12:20:31 | https://stackoverflow.com/q/27764857 | https://stackoverflow.com/a/27765424 | <p>From the <a href="http://www.mediawiki.org/wiki/Gerrit/git-review#What_happens_when_you_submit_a_change">fine manual</a>:</p>
<p>When you submit a change, <code>git review</code> does the following things:</p>
<ul>
<li>it looks up which branch to push to (production or whatever) in the <code>.gitreview</code> file... | <p>From the <a href="http://www.mediawiki.org/wiki/Gerrit/git-review#What_happens_when_you_submit_a_change">fine manual</a>:</p> <p>When you submit a change, <code>git review</code> does the following things:</p> <ul> <li>it looks up which branch to push to (production or whatever) in the <code>.gitreview</code> file... | 119, 43087, 52272, 87634 | gerrit, git, githooks, git-review | <h1>How does git-review work?</h1>
<p>I want to know, how exactly does <code>git review</code> command work? I mean does it use <code>git push</code> command (internally) or something else to upload the changes to gerrit. This information would be useful for me while writing git hooks for <code>git review</code>.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,326 | git | # How does git-review work?
I want to know, how exactly does `git review` command work? I mean does it use `git push` command (internally) or something else to upload the changes to gerrit. This information would be useful for me while writing git hooks for `git review`. | From the [fine manual](http://www.mediawiki.org/wiki/Gerrit/git-review#What_happens_when_you_submit_a_change):
When you submit a change, `git review` does the following things:
- it looks up which branch to push to (production or whatever) in the `.gitreview` file. If it can't find this information, it pushes to `mas... |
27361538 | How to show changes between commits with JGit | 10 | 2014-12-08 15:44:33 | <p>I am trying to show a git diff between two commits for a file. Basically, I did it as in <a href="https://github.com/centic9/jgit-cookbook/blob/master/src/main/java/org/dstadler/jgit/porcelain/ShowChangedFilesBetweenCommits.java" rel="noreferrer">https://github.com/centic9/jgit-cookbook/blob/master/src/main/java/org... | 16,694 | 1,584,115 | 2019-07-15 10:31:57 | 27,375,013 | 14 | 2014-12-09 09:07:31 | 2,986,905 | 2019-07-15 10:31:57 | https://stackoverflow.com/q/27361538 | https://stackoverflow.com/a/27375013 | <p>To obtain the tree of the head commit, call</p>
<pre><code>git.getRepository().resolve( "HEAD^{tree}" )
</code></pre>
<p>and to obtain the tree of the parent of the HEAD commit, call</p>
<pre><code>git.getRepository().resolve( "HEAD~1^{tree}" )
</code></pre>
<p>Search for 'Git caret and tilde' if you are interes... | <p>To obtain the tree of the head commit, call</p> <pre><code>git.getRepository().resolve( "HEAD^{tree}" ) </code></pre> <p>and to obtain the tree of the parent of the HEAD commit, call</p> <pre><code>git.getRepository().resolve( "HEAD~1^{tree}" ) </code></pre> <p>Search for 'Git caret and tilde' if you are interes... | 17, 61058 | java, jgit | <h1>How to show changes between commits with JGit</h1>
<p>I am trying to show a git diff between two commits for a file. Basically, I did it as in <a href="https://github.com/centic9/jgit-cookbook/blob/master/src/main/java/org/dstadler/jgit/porcelain/ShowChangedFilesBetweenCommits.java" rel="noreferrer">https://github.... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,327 | git | # How to show changes between commits with JGit
I am trying to show a git diff between two commits for a file. Basically, I did it as in <https://github.com/centic9/jgit-cookbook/blob/master/src/main/java/org/dstadler/jgit/porcelain/ShowChangedFilesBetweenCommits.java>
You can see my full code under <https://github.c... | To obtain the tree of the head commit, call
```
git.getRepository().resolve( "HEAD^{tree}" )
```
and to obtain the tree of the parent of the HEAD commit, call
```
git.getRepository().resolve( "HEAD~1^{tree}" )
```
Search for 'Git caret and tilde' if you are interested in more details.
To summarize, here goes a sni... |
25622974 | show fetched commits after git pull --rebase | 10 | 2014-09-02 12:03:18 | <p>Is there a way to see what commits have been pulled in from the remote repository after you do a <code>git pull --rebase</code>? </p>
<p>In other words: <code>git pull</code> will show a summary of changed files at the end (like <code>git diff --stat</code>). <code>Git pull --rebase</code> does not. How can I see t... | 1,337 | 2,875,891 | 2023-08-10 14:30:11 | 25,623,641 | 14 | 2014-09-02 12:37:47 | 1,256,452 | 2014-09-03 16:53:05 | https://stackoverflow.com/q/25622974 | https://stackoverflow.com/a/25623641 | <p>Actually, <code>git rebase</code> has had this all along (well, since 1.6.something). Remember that <code>git pull</code> is just <code>git fetch</code> followed by either <code>git merge</code> or <code>git rebase</code> (as directed by various options and settings). That is, <code>git pull</code> does a pair of ... | <p>Actually, <code>git rebase</code> has had this all along (well, since 1.6.something). Remember that <code>git pull</code> is just <code>git fetch</code> followed by either <code>git merge</code> or <code>git rebase</code> (as directed by various options and settings). That is, <code>git pull</code> does a pair of ... | 119, 4860, 8974, 9033, 67462 | diffstat, git, git-diff, pull, rebase | <h1>show fetched commits after git pull --rebase</h1>
<p>Is there a way to see what commits have been pulled in from the remote repository after you do a <code>git pull --rebase</code>? </p>
<p>In other words: <code>git pull</code> will show a summary of changed files at the end (like <code>git diff --stat</code>). <c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,328 | git | # show fetched commits after git pull --rebase
Is there a way to see what commits have been pulled in from the remote repository after you do a `git pull --rebase`?
In other words: `git pull` will show a summary of changed files at the end (like `git diff --stat`). `Git pull --rebase` does not. How can I see this inf... | Actually, `git rebase` has had this all along (well, since 1.6.something). Remember that `git pull` is just `git fetch` followed by either `git merge` or `git rebase` (as directed by various options and settings). That is, `git pull` does a pair of underlying git operations.
The reason it does not work after you have ... |
19059010 | git remove file starting with a colon | 10 | 2013-09-27 19:53:27 | <p>I accidentally created a file named <code>:w</code>. I managed to delete it by using zsh tab feature. But I cannot remove it from my git cache.</p>
<pre><code> git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: Gemfile
# modified: ... | 2,239 | 630,752 | 2013-09-27 23:15:16 | 19,059,020 | 14 | 2013-09-27 19:54:27 | 630,752 | 2013-09-27 19:54:27 | https://stackoverflow.com/q/19059010 | https://stackoverflow.com/a/19059020 | <p>found the answer not 5 minutes later</p>
<pre><code>git rm '\:w'
</code></pre>
| <p>found the answer not 5 minutes later</p> <pre><code>git rm '\:w' </code></pre> | 34, 119, 1062 | filenames, git, unix | <h1>git remove file starting with a colon</h1>
<p>I accidentally created a file named <code>:w</code>. I managed to delete it by using zsh tab feature. But I cannot remove it from my git cache.</p>
<pre><code> git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unst... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,331 | git | # git remove file starting with a colon
I accidentally created a file named `:w`. I managed to delete it by using zsh tab feature. But I cannot remove it from my git cache.
```
git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: Gemfile
# mo... | found the answer not 5 minutes later
```
git rm '\:w'
``` |
16357375 | Git Diff Indent/Pretty Print/Beautify Before Diff | 10 | 2013-05-03 11:00:25 | <p>Is there a way to make Git <code>indent</code>/beautify/pretty print two versions of C++ source files before diffing them?</p>
<p>I don't want Git to show me the myriads of changes introduced after someone auto-formatted the code.</p>
<p>Example usage: I hit <code>git difftool --indent-before-diffing path/to/file<... | 9,226 | 559,299 | 2021-04-21 11:03:32 | 16,357,501 | 14 | 2013-05-03 11:06:45 | 1,615,903 | 2021-04-21 11:03:32 | https://stackoverflow.com/q/16357375 | https://stackoverflow.com/a/16357501 | <p>If you can find an application that does the indenting for you, you could use the method described <a href="http://git-scm.com/book/en/Customizing-Git-Git-Attributes#Binary-Files" rel="nofollow noreferrer">here</a> for odt files:</p>
<blockquote>
<p>Add the following line to your .gitattributes file:</p>
<p><code>*.... | <p>If you can find an application that does the indenting for you, you could use the method described <a href="http://git-scm.com/book/en/Customizing-Git-Git-Attributes#Binary-Files" rel="nofollow noreferrer">here</a> for odt files:</p> <blockquote> <p>Add the following line to your .gitattributes file:</p> <p><code>*.... | 10, 119, 7309, 8194, 9033 | c++, git, git-diff, indentation, pretty-print | <h1>Git Diff Indent/Pretty Print/Beautify Before Diff</h1>
<p>Is there a way to make Git <code>indent</code>/beautify/pretty print two versions of C++ source files before diffing them?</p>
<p>I don't want Git to show me the myriads of changes introduced after someone auto-formatted the code.</p>
<p>Example usage: I h... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,332 | git | # Git Diff Indent/Pretty Print/Beautify Before Diff
Is there a way to make Git `indent`/beautify/pretty print two versions of C++ source files before diffing them?
I don't want Git to show me the myriads of changes introduced after someone auto-formatted the code.
Example usage: I hit `git difftool --indent-before-d... | If you can find an application that does the indenting for you, you could use the method described [here](http://git-scm.com/book/en/Customizing-Git-Git-Attributes#Binary-Files) for odt files:
> Add the following line to your .gitattributes file:
>
> `*.odt diff=odt`
>
> Now set up the odt diff filter in .git/config:
... |
12760450 | How to use git bisect: Using unit tests for determining the errorneous commit? | 10 | 2012-10-06 14:00:19 | <p>I'm new to git and just discovered "git bisect". How is it generally used when you can check for the error using a newly written unit test (that wasn't there beforehand)?</p>
<p>Say we have a repository containing unit tests, but - as so often - they weren't complete. In some version we discover that a feature isn'... | 4,391 | 829,568 | 2012-10-06 14:16:05 | 12,760,529 | 14 | 2012-10-06 14:10:54 | 56,076 | 2012-10-06 14:10:54 | https://stackoverflow.com/q/12760450 | https://stackoverflow.com/a/12760529 | <p>I usually use bisect to identify when a bug was introduced, so that I can look at a single commit for the cause of an error. This is useful when I know that something used to work and now doesn't. I first pick or find an old commit that worked, mark it with <code>git bisect good</code>, mark the head with <code>gi... | <p>I usually use bisect to identify when a bug was introduced, so that I can look at a single commit for the cause of an error. This is useful when I know that something used to work and now doesn't. I first pick or find an old commit that worked, mark it with <code>git bisect good</code>, mark the head with <code>gi... | 119, 1931, 47326 | git, git-bisect, unit-testing | <h1>How to use git bisect: Using unit tests for determining the errorneous commit?</h1>
<p>I'm new to git and just discovered "git bisect". How is it generally used when you can check for the error using a newly written unit test (that wasn't there beforehand)?</p>
<p>Say we have a repository containing unit tests, bu... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,334 | git | # How to use git bisect: Using unit tests for determining the errorneous commit?
I'm new to git and just discovered "git bisect". How is it generally used when you can check for the error using a newly written unit test (that wasn't there beforehand)?
Say we have a repository containing unit tests, but - as so often ... | I usually use bisect to identify when a bug was introduced, so that I can look at a single commit for the cause of an error. This is useful when I know that something used to work and now doesn't. I first pick or find an old commit that worked, mark it with `git bisect good`, mark the head with `git bisect bad`, then w... |
12438946 | E: Unable to locate package git - Ubuntu on EC2 | 10 | 2012-09-15 16:07:08 | <p>Looks to me like there may be a problem with the Ubuntu EC2 mirrors. After a fresh apt-get update, I'm seeting this:</p>
<pre><code>$ apt-get install -yq git
E: Unable to locate package git
</code></pre>
<p>After a few more <code>apt-get</code>'s, it will often succeed.</p>
| 24,380 | 1,224,443 | 2023-09-22 07:51:32 | 12,571,429 | 14 | 2012-09-24 19:20:43 | 1,224,443 | 2012-09-24 19:20:43 | https://stackoverflow.com/q/12438946 | https://stackoverflow.com/a/12571429 | <p>The mirrors still seem to be broken, but I was able to work around the issue with a dumb loop:</p>
<pre><code># stupid loop to get around ubuntu package mirror problems
for attempt in 1 2 3; do
if [ ! -z "`which git`" ]; then
break
fi
echo "Trying to install git, attempt $attempt"
sudo apt-get update -y... | <p>The mirrors still seem to be broken, but I was able to work around the issue with a dumb loop:</p> <pre><code># stupid loop to get around ubuntu package mirror problems for attempt in 1 2 3; do if [ ! -z "`which git`" ]; then break fi echo "Trying to install git, attempt $attempt" sudo apt-get update -y... | 119, 549, 2010, 2080, 12375 | amazon-ec2, apt, git, packaging, ubuntu | <h1>E: Unable to locate package git - Ubuntu on EC2</h1>
<p>Looks to me like there may be a problem with the Ubuntu EC2 mirrors. After a fresh apt-get update, I'm seeting this:</p>
<pre><code>$ apt-get install -yq git
E: Unable to locate package git
</code></pre>
<p>After a few more <code>apt-get</code>'s, it will o... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,335 | git | # E: Unable to locate package git - Ubuntu on EC2
Looks to me like there may be a problem with the Ubuntu EC2 mirrors. After a fresh apt-get update, I'm seeting this:
```
$ apt-get install -yq git
E: Unable to locate package git
```
After a few more `apt-get`'s, it will often succeed. | The mirrors still seem to be broken, but I was able to work around the issue with a dumb loop:
```
# stupid loop to get around ubuntu package mirror problems
for attempt in 1 2 3; do
if [ ! -z "`which git`" ]; then
break
fi
echo "Trying to install git, attempt $attempt"
sudo apt-get update -yq --fix-missin... |
9746225 | What is the most efficient way to get a clean git sandbox? | 10 | 2012-03-17 00:40:29 | <p>For my continuous integration builds, I want to make sure no stray files have been deposited in my git sandbox, and none of the files have been inadvertently changed.</p>
<p>I know about <code>git reset --hard HEAD</code>, and this solves part of the problem. But I guess what I want to do is delete all the untracke... | 3,019 | 77,939 | 2012-03-17 05:32:38 | 9,746,440 | 14 | 2012-03-17 01:21:16 | 422,353 | 2012-03-17 04:33:05 | https://stackoverflow.com/q/9746225 | https://stackoverflow.com/a/9746440 | <p>(<em>Expanded for posterity</em>)</p>
<p>Your problem can be split in two: Returning modified files to their state in the last commit and removing any extra files that don't belong in the repository:</p>
<pre><code>git reset --hard HEAD
</code></pre>
<p>will take your files back to the state they have in HEAD, re... | <p>(<em>Expanded for posterity</em>)</p> <p>Your problem can be split in two: Returning modified files to their state in the last commit and removing any extra files that don't belong in the repository:</p> <pre><code>git reset --hard HEAD </code></pre> <p>will take your files back to the state they have in HEAD, re... | 119, 1066 | continuous-integration, git | <h1>What is the most efficient way to get a clean git sandbox?</h1>
<p>For my continuous integration builds, I want to make sure no stray files have been deposited in my git sandbox, and none of the files have been inadvertently changed.</p>
<p>I know about <code>git reset --hard HEAD</code>, and this solves part of t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,336 | git | # What is the most efficient way to get a clean git sandbox?
For my continuous integration builds, I want to make sure no stray files have been deposited in my git sandbox, and none of the files have been inadvertently changed.
I know about `git reset --hard HEAD`, and this solves part of the problem. But I guess wha... | (*Expanded for posterity*)
Your problem can be split in two: Returning modified files to their state in the last commit and removing any extra files that don't belong in the repository:
```
git reset --hard HEAD
```
will take your files back to the state they have in HEAD, removing any modifications (even if they we... |
7052429 | Why do I get CRLF line breaks in source files, although I'm on a Mac+Linux-only environment with Git and IDEA? | 10 | 2011-08-13 18:24:57 | <p>My boss and I are the only ones working on our project and we use Macs exclusively for development. We are doing groovy/grails development, and deploy to Linux servers. There is no use of MS Windows involved anywhere in our development process whatsoever, yet somehow, when I'm diffing files with git in the bash sh... | 9,438 | 192,819 | 2011-08-23 20:31:18 | 7,052,550 | 14 | 2011-08-13 18:44:06 | 839,646 | 2011-08-13 18:44:06 | https://stackoverflow.com/q/7052429 | https://stackoverflow.com/a/7052550 | <p>Locally, use <code>git config --global core.autocrlf input</code>. This will translate all CRLF's to LF's upon commit. I don't know of a way to configure this on gitolite, and the only line ending setup I know of in IntelliJ is one that lets you specify what to use for new files. It's in Settings at Code Style -> Ge... | <p>Locally, use <code>git config --global core.autocrlf input</code>. This will translate all CRLF's to LF's upon commit. I don't know of a way to configure this on gitolite, and the only line ending setup I know of in IntelliJ is one that lets you specify what to use for new files. It's in Settings at Code Style -> Ge... | 119, 8945, 59139 | core.autocrlf, git, intellij-idea | <h1>Why do I get CRLF line breaks in source files, although I'm on a Mac+Linux-only environment with Git and IDEA?</h1>
<p>My boss and I are the only ones working on our project and we use Macs exclusively for development. We are doing groovy/grails development, and deploy to Linux servers. There is no use of MS Wind... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,338 | git | # Why do I get CRLF line breaks in source files, although I'm on a Mac+Linux-only environment with Git and IDEA?
My boss and I are the only ones working on our project and we use Macs exclusively for development. We are doing groovy/grails development, and deploy to Linux servers. There is no use of MS Windows involve... | Locally, use `git config --global core.autocrlf input`. This will translate all CRLF's to LF's upon commit. I don't know of a way to configure this on gitolite, and the only line ending setup I know of in IntelliJ is one that lets you specify what to use for new files. It's in Settings at Code Style -> General toward t... |
5479823 | Automatically commit an empty .gitignore file after git init? | 10 | 2011-03-29 22:46:57 | <p>I would like to start off all my git repositories with an "empty" initial commit by simply touching an empty .gitignore file and committing it. My reasons are roughly the same as in <a href="https://stackoverflow.com/questions/645450/git-how-to-insert-a-commit-as-the-first-shifting-all-the-others">this question</a>.... | 4,324 | 125,921 | 2011-03-30 18:46:48 | 5,480,439 | 14 | 2011-03-30 00:08:18 | 119,963 | 2011-03-30 00:08:18 | https://stackoverflow.com/q/5479823 | https://stackoverflow.com/a/5480439 | <p>If you want a commit in the repo, don't use <code>git init</code> - it makes empty repos! Use <code>git clone</code> instead. Just make one repository with a commit of your empty gitignore, and clone that whenever you want this particular pseudo-empty repository. (You could host it publicly on github if you want it ... | <p>If you want a commit in the repo, don't use <code>git init</code> - it makes empty repos! Use <code>git clone</code> instead. Just make one repository with a commit of your empty gitignore, and clone that whenever you want this particular pseudo-empty repository. (You could host it publicly on github if you want it ... | 119 | git | <h1>Automatically commit an empty .gitignore file after git init?</h1>
<p>I would like to start off all my git repositories with an "empty" initial commit by simply touching an empty .gitignore file and committing it. My reasons are roughly the same as in <a href="https://stackoverflow.com/questions/645450/git-how-to-i... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,339 | git | # Automatically commit an empty .gitignore file after git init?
I would like to start off all my git repositories with an "empty" initial commit by simply touching an empty .gitignore file and committing it. My reasons are roughly the same as in [this question](https://stackoverflow.com/questions/645450/git-how-to-ins... | If you want a commit in the repo, don't use `git init` - it makes empty repos! Use `git clone` instead. Just make one repository with a commit of your empty gitignore, and clone that whenever you want this particular pseudo-empty repository. (You could host it publicly on github if you want it available anywhere.)
Alt... |
4768225 | see all history of git | 10 | 2011-01-22 14:00:27 | <p>Let's say, my current git log is </p>
<p>commit3</p>
<p>commit2</p>
<p>commit1</p>
<p>I reset the head to commit2.</p>
<p>Now I want to go back to commit3, but I <strong>forget</strong> the sha-1 of commit3, so I want to look at the log , but "git log" will only show commit2, commit1, my question is how to rese... | 17,549 | 98,563 | 2017-01-04 11:16:53 | 4,768,277 | 14 | 2011-01-22 14:10:39 | 36,723 | 2011-01-22 14:10:39 | https://stackoverflow.com/q/4768225 | https://stackoverflow.com/a/4768277 | <p>Use <a href="http://www.kernel.org/pub/software/scm/git/docs/git-reflog.html" rel="noreferrer"><code>git reflog</code></a> to find the old reference and pass it to <code>git log</code> directly. Note that the reflog is purged periodically, and old commits will be eventually deleted unless they're part of a branch - ... | <p>Use <a href="http://www.kernel.org/pub/software/scm/git/docs/git-reflog.html" rel="noreferrer"><code>git reflog</code></a> to find the old reference and pass it to <code>git log</code> directly. Note that the reflog is purged periodically, and old commits will be eventually deleted unless they're part of a branch - ... | 119 | git | <h1>see all history of git</h1>
<p>Let's say, my current git log is </p>
<p>commit3</p>
<p>commit2</p>
<p>commit1</p>
<p>I reset the head to commit2.</p>
<p>Now I want to go back to commit3, but I <strong>forget</strong> the sha-1 of commit3, so I want to look at the log , but "git log" will only show commit2, com... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,340 | git | # see all history of git
Let's say, my current git log is
commit3
commit2
commit1
I reset the head to commit2.
Now I want to go back to commit3, but I **forget** the sha-1 of commit3, so I want to look at the log , but "git log" will only show commit2, commit1, my question is how to reset to commit3 or let the lo... | Use [`git reflog`](http://www.kernel.org/pub/software/scm/git/docs/git-reflog.html) to find the old reference and pass it to `git log` directly. Note that the reflog is purged periodically, and old commits will be eventually deleted unless they're part of a branch - if you want to undo a commit but leave it in history,... |
4323886 | how to undelete a deleted remote branch | 10 | 2010-12-01 11:32:57 | <p>I accidently did this:</p>
<pre><code>$ git push origin :development
To git@xxxxx.com:yyyyy/projects/web.git
- [deleted] development
</code></pre>
<p>How do I undo? What is the second best thing I can do?</p>
| 7,505 | 496,852 | 2015-11-07 20:07:59 | 4,324,043 | 14 | 2010-12-01 11:52:50 | 6,309 | 2015-11-07 20:07:59 | https://stackoverflow.com/q/4323886 | https://stackoverflow.com/a/4324043 | <p>If your branch was fairly up-to-date with the remote one, a simple:</p>
<pre><code>git push origin development:development
</code></pre>
<p>should be enough, as <a href="https://web.archive.org/web/20090929124732/http://support.github.com/discussions/repos/1299-deleted-master-branch" rel="nofollow noreferrer">illu... | <p>If your branch was fairly up-to-date with the remote one, a simple:</p> <pre><code>git push origin development:development </code></pre> <p>should be enough, as <a href="https://web.archive.org/web/20090929124732/http://support.github.com/discussions/repos/1299-deleted-master-branch" rel="nofollow noreferrer">illu... | 119 | git | <h1>how to undelete a deleted remote branch</h1>
<p>I accidently did this:</p>
<pre><code>$ git push origin :development
To git@xxxxx.com:yyyyy/projects/web.git
- [deleted] development
</code></pre>
<p>How do I undo? What is the second best thing I can do?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,341 | git | # how to undelete a deleted remote branch
I accidently did this:
```
$ git push origin :development
To git@xxxxx.com:yyyyy/projects/web.git
- [deleted] development
```
How do I undo? What is the second best thing I can do? | If your branch was fairly up-to-date with the remote one, a simple:
```
git push origin development:development
```
should be enough, as [illustrated by this thread](https://web.archive.org/web/20090929124732/http://support.github.com/discussions/repos/1299-deleted-master-branch).
If not, a local action needs to be... |
3310611 | If I have a GIT repo (bare) on my server, can I move it to another server easily? | 10 | 2010-07-22 15:33:42 | <p>I have a server that is hosting my 'bare' GIT repo for a few projects.</p>
<p>I want to know what it takes to move the GIT to another server?</p>
| 5,601 | 39,677 | 2010-07-24 02:45:15 | 3,310,704 | 14 | 2010-07-22 15:45:20 | 350,351 | 2010-07-22 18:52:40 | https://stackoverflow.com/q/3310611 | https://stackoverflow.com/a/3310704 | <p>Just copy the parent directory to the new machine and have the checked out copies update their remote with <code>git remote set-url <remotename> <url></code>. Once you've verified that the users can push/pull properly with the new remote you can delete the copy from the old machine.</p>
| <p>Just copy the parent directory to the new machine and have the checked out copies update their remote with <code>git remote set-url <remotename> <url></code>. Once you've verified that the users can push/pull properly with the new remote you can delete the copy from the old machine.</p> | 119 | git | <h1>If I have a GIT repo (bare) on my server, can I move it to another server easily?</h1>
<p>I have a server that is hosting my 'bare' GIT repo for a few projects.</p>
<p>I want to know what it takes to move the GIT to another server?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,342 | git | # If I have a GIT repo (bare) on my server, can I move it to another server easily?
I have a server that is hosting my 'bare' GIT repo for a few projects.
I want to know what it takes to move the GIT to another server? | Just copy the parent directory to the new machine and have the checked out copies update their remote with `git remote set-url <remotename> <url>`. Once you've verified that the users can push/pull properly with the new remote you can delete the copy from the old machine. |
46618351 | Display .git directory on VS-CODE? | 9 | 2017-10-07 08:46:47 | <p>I would like to see the <code>.git/</code> folder on Visual Studio Code editor, but for some reason, it's not showing up on the sidebar where all the project folders are. I don't know if this can help you understand better the problem but this is what I get when I do a <code>ls -la</code> on my directory</p>
<p><co... | 3,701 | 4,950,734 | 2017-10-07 09:59:48 | 46,618,939 | 14 | 2017-10-07 09:59:48 | 6,309 | 2017-10-07 09:59:48 | https://stackoverflow.com/q/46618351 | https://stackoverflow.com/a/46618939 | <p>Check your <a href="https://code.visualstudio.com/docs/getstarted/settings" rel="noreferrer">Visual Studio Code settings</a>, for "<code>files.exclude</code>"</p>
<pre><code> // Configure glob patterns for excluding files and folders. For example, the files explorer decides which files and folders to show or hide... | <p>Check your <a href="https://code.visualstudio.com/docs/getstarted/settings" rel="noreferrer">Visual Studio Code settings</a>, for "<code>files.exclude</code>"</p> <pre><code> // Configure glob patterns for excluding files and folders. For example, the files explorer decides which files and folders to show or hide... | 119, 111608 | git, visual-studio-code | <h1>Display .git directory on VS-CODE?</h1>
<p>I would like to see the <code>.git/</code> folder on Visual Studio Code editor, but for some reason, it's not showing up on the sidebar where all the project folders are. I don't know if this can help you understand better the problem but this is what I get when I do a <co... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,344 | git | # Display .git directory on VS-CODE?
I would like to see the `.git/` folder on Visual Studio Code editor, but for some reason, it's not showing up on the sidebar where all the project folders are. I don't know if this can help you understand better the problem but this is what I get when I do a `ls -la` on my director... | Check your [Visual Studio Code settings](https://code.visualstudio.com/docs/getstarted/settings), for "`files.exclude`"
```
// Configure glob patterns for excluding files and folders. For example, the files explorer decides which files and folders to show or hide based on this setting.
"files.exclude": {
"**/.... |
45732458 | Ignore files committed to git and also remove them from history | 9 | 2017-08-17 10:18:45 | <p>I forgot to add certain files to my .gitignore when I began my project and consequently committed files I shouldn't have. <a href="https://stackoverflow.com/questions/1139762/ignore-files-that-have-already-been-committed-to-a-git-repository">I ignored the files afterwards as described here.</a> The damage has alread... | 6,688 | 7,545,915 | 2020-11-26 07:51:35 | 45,751,110 | 14 | 2017-08-18 07:39:55 | 6,936,103 | 2020-11-26 07:51:35 | https://stackoverflow.com/q/45732458 | https://stackoverflow.com/a/45751110 | <p>To <strong>reset the commit histories as original</strong>, you can use <code>git reset --hard origin/branchname</code>.</p>
<p>To <strong>ignore files and remove them from history</strong>, you can follow below two aspects:</p>
<h3>1. Ignore files which already committed to git</h3>
<ul>
<li>Create a <code>.gitigno... | <p>To <strong>reset the commit histories as original</strong>, you can use <code>git reset --hard origin/branchname</code>.</p> <p>To <strong>ignore files and remove them from history</strong>, you can follow below two aspects:</p> <h3>1. Ignore files which already committed to git</h3> <ul> <li>Create a <code>.gitigno... | 119, 456, 25056 | git, gitignore, version-control | <h1>Ignore files committed to git and also remove them from history</h1>
<p>I forgot to add certain files to my .gitignore when I began my project and consequently committed files I shouldn't have. <a href="https://stackoverflow.com/questions/1139762/ignore-files-that-have-already-been-committed-to-a-git-repository">I ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,345 | git | # Ignore files committed to git and also remove them from history
I forgot to add certain files to my .gitignore when I began my project and consequently committed files I shouldn't have. [I ignored the files afterwards as described here.](https://stackoverflow.com/questions/1139762/ignore-files-that-have-already-been... | To **reset the commit histories as original**, you can use `git reset --hard origin/branchname`.
To **ignore files and remove them from history**, you can follow below two aspects:
### 1. Ignore files which already committed to git
- Create a `.gitignore` file (if you don’t have) by `touch .gitignore`.
- Add files a... |
40354999 | How to make git switch to newly created branch automatically? | 9 | 2016-11-01 06:15:06 | <pre><code>1: git checkout master
2: git branch feature
3: git commit 'commit msg'
</code></pre>
<p>I am expecting git to switch branch on line 2 <em>(but it doesn't which is really annoying because I have to revert the check-in on master)</em>.</p>
<p>Is there any way to make git switch the branch?</p>
| 5,170 | 1,252,307 | 2016-11-01 07:44:16 | 40,355,032 | 14 | 2016-11-01 06:19:23 | 6,773,669 | 2016-11-01 06:19:23 | https://stackoverflow.com/q/40354999 | https://stackoverflow.com/a/40355032 | <p><code>git checkout -b yourBranchName</code> will do it for you</p>
| <p><code>git checkout -b yourBranchName</code> will do it for you</p> | 119, 76220 | git, git-branch | <h1>How to make git switch to newly created branch automatically?</h1>
<pre><code>1: git checkout master
2: git branch feature
3: git commit 'commit msg'
</code></pre>
<p>I am expecting git to switch branch on line 2 <em>(but it doesn't which is really annoying because I have to revert the check-in on master)</em>.</p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,348 | git | # How to make git switch to newly created branch automatically?
```
1: git checkout master
2: git branch feature
3: git commit 'commit msg'
```
I am expecting git to switch branch on line 2 *(but it doesn't which is really annoying because I have to revert the check-in on master)*.
Is there any way to make git switc... | `git checkout -b yourBranchName` will do it for you |
39911851 | .git/info/exclude replacement for git submodule? | 9 | 2016-10-07 07:33:52 | <p>I'm having python script to download dependencies for my library (that is extracted as git <strong>repository</strong>) and it adds lines to <code>.git/info/exclude</code> for git repository. But when it's extracted as <strong>submodule</strong> no .git/info/exclude file exists and i still need to exclude some paths... | 1,071 | 1,103,561 | 2016-10-13 15:00:17 | 40,024,358 | 14 | 2016-10-13 14:50:58 | 3,938,741 | 2016-10-13 15:00:17 | https://stackoverflow.com/q/39911851 | https://stackoverflow.com/a/40024358 | <p>Seems that git adds another structure for modules in <code>mainrepo/.git/modules/path-to-submodule/info/exclude</code>.</p>
<p>Adding path to your model:
<pre>
repo
├─.git
│ ├─info
│ ├─└─exclude
│ └─<b>modules</b>
│ └─<b>mylibrary</b>
│ └─<b>info</b>
│ └─<b>exclude (f... | <p>Seems that git adds another structure for modules in <code>mainrepo/.git/modules/path-to-submodule/info/exclude</code>.</p> <p>Adding path to your model: <pre> repo ├─.git │ ├─info │ ├─└─exclude │ └─<b>modules</b> │ └─<b>mylibrary</b> │ └─<b>info</b> │ └─<b>exclude (f... | 119, 25056 | git, gitignore | <h1>.git/info/exclude replacement for git submodule?</h1>
<p>I'm having python script to download dependencies for my library (that is extracted as git <strong>repository</strong>) and it adds lines to <code>.git/info/exclude</code> for git repository. But when it's extracted as <strong>submodule</strong> no .git/info/... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,349 | git | # .git/info/exclude replacement for git submodule?
I'm having python script to download dependencies for my library (that is extracted as git **repository**) and it adds lines to `.git/info/exclude` for git repository. But when it's extracted as **submodule** no .git/info/exclude file exists and i still need to exclud... | Seems that git adds another structure for modules in `mainrepo/.git/modules/path-to-submodule/info/exclude`.
Adding path to your model:
```
repo
├─.git
│ ├─info
│ ├─└─exclude
│ └─modules
│ └─mylibrary
│ └─info
│ └─exclude (for mylibrary module)
└─mylibrary (as_submodule... |
27615126 | Print symbolic name for HEAD | 9 | 2014-12-23 06:24:30 | <p>I am looking for a Git command that will print the symbolic name for <code>HEAD</code>. I
was using this command</p>
<pre><code>$ git name-rev --name-only HEAD
master
$ git checkout HEAD~2
$ git name-rev --name-only HEAD
master~2
</code></pre>
<p>However I noticed that it does not work on a new repository</p>
<pr... | 3,256 | 1,002,260 | 2015-02-23 08:03:34 | 27,660,482 | 14 | 2014-12-26 18:17:07 | 2,541,573 | 2015-02-23 08:03:34 | https://stackoverflow.com/q/27615126 | https://stackoverflow.com/a/27660482 | <p>You write:</p>
<blockquote>
<p>I am looking for a Git command that will print the symbolic name for <code>HEAD</code>.</p>
</blockquote>
<p>The following may suffice to demonstrate that what you're asking for does not make sense in all situations, simply because <code>HEAD</code> may not be unambiguously associa... | <p>You write:</p> <blockquote> <p>I am looking for a Git command that will print the symbolic name for <code>HEAD</code>.</p> </blockquote> <p>The following may suffice to demonstrate that what you're asking for does not make sense in all situations, simply because <code>HEAD</code> may not be unambiguously associa... | 119, 1879, 41034 | branch, git, symbolic-references | <h1>Print symbolic name for HEAD</h1>
<p>I am looking for a Git command that will print the symbolic name for <code>HEAD</code>. I
was using this command</p>
<pre><code>$ git name-rev --name-only HEAD
master
$ git checkout HEAD~2
$ git name-rev --name-only HEAD
master~2
</code></pre>
<p>However I noticed that it does... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,354 | git | # Print symbolic name for HEAD
I am looking for a Git command that will print the symbolic name for `HEAD`. I
was using this command
```
$ git name-rev --name-only HEAD
master
$ git checkout HEAD~2
$ git name-rev --name-only HEAD
master~2
```
However I noticed that it does not work on a new repository
```
$ git ini... | You write:
> I am looking for a Git command that will print the symbolic name for `HEAD`.
The following may suffice to demonstrate that what you're asking for does not make sense in all situations, simply because `HEAD` may not be unambiguously associated with one reference. Read on.
## What `git name-rev` does
In ... |
26434452 | How is a merge-base done in JGit? | 9 | 2014-10-17 22:49:58 | <p>I'm looking at the <a href="http://www.eclipse.org/jgit/documentation/" rel="nofollow noreferrer">JGit Documentation</a>, currently at version <em>3.5.1.201410131835-r</em>, and I cannot find the equivalent of <a href="http://git-scm.com/docs/git-merge-base" rel="nofollow noreferrer">git-merge-base</a>.</p>
<p>I wo... | 2,822 | 231,573 | 2023-03-19 19:06:04 | 26,436,588 | 14 | 2014-10-18 05:23:38 | 305,973 | 2023-03-19 19:06:04 | https://stackoverflow.com/q/26434452 | https://stackoverflow.com/a/26436588 | <p>You can use <code>RevFilter.MERGE_BASE</code> for that:</p>
<pre><code>RevWalk walk = new RevWalk(repository);
walk.setRevFilter(RevFilter.MERGE_BASE);
walk.markStart(commit1);
walk.markStart(commit2);
RevCommit mergeBase = walk.next();
</code></pre>
<p>Also note that there is <a href="http://download.eclipse.org/jg... | <p>You can use <code>RevFilter.MERGE_BASE</code> for that:</p> <pre><code>RevWalk walk = new RevWalk(repository); walk.setRevFilter(RevFilter.MERGE_BASE); walk.markStart(commit1); walk.markStart(commit2); RevCommit mergeBase = walk.next(); </code></pre> <p>Also note that there is <a href="http://download.eclipse.org/jg... | 17, 119, 61058 | git, java, jgit | <h1>How is a merge-base done in JGit?</h1>
<p>I'm looking at the <a href="http://www.eclipse.org/jgit/documentation/" rel="nofollow noreferrer">JGit Documentation</a>, currently at version <em>3.5.1.201410131835-r</em>, and I cannot find the equivalent of <a href="http://git-scm.com/docs/git-merge-base" rel="nofollow n... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,355 | git | # How is a merge-base done in JGit?
I'm looking at the [JGit Documentation](http://www.eclipse.org/jgit/documentation/), currently at version *3.5.1.201410131835-r*, and I cannot find the equivalent of [git-merge-base](http://git-scm.com/docs/git-merge-base).
I would like to determine if a branch is up-to-date, behin... | You can use `RevFilter.MERGE_BASE` for that:
```
RevWalk walk = new RevWalk(repository);
walk.setRevFilter(RevFilter.MERGE_BASE);
walk.markStart(commit1);
walk.markStart(commit2);
RevCommit mergeBase = walk.next();
```
Also note that there is [BranchTrackingStatus](http://download.eclipse.org/jgit/site/3.5.1.20141013... |
19391327 | Regex-like shell glob patterns for gitignore | 9 | 2013-10-15 21:21:39 | <p>When I compile my C++ project, many shared object files are created with extensions such as</p>
<pre><code>.so
.so.0
.so.7
.so.0.7
</code></pre>
<p>I need to add all those to my <code>.gitignore</code> file. Were this a regex, I could use</p>
<pre><code>\.so[\.0-9]*
</code></pre>
<p>However, <a href="http://git-... | 5,775 | 938,782 | 2018-05-10 09:16:52 | 24,551,612 | 14 | 2014-07-03 10:46:43 | 1,860,929 | 2014-07-08 06:17:41 | https://stackoverflow.com/q/19391327 | https://stackoverflow.com/a/24551612 | <p>While the answer by @SpeakEasy can ignore <code>.so</code> files in a single step using <code>*.so*</code>, for your use case of ignoring files in formats specified, you can use two entries in your <code>.gitignore</code> for more specific ignore rule</p>
<pre><code>*.so
*.so.[0-9]*
</code></pre>
<hr />
<p>From <a h... | <p>While the answer by @SpeakEasy can ignore <code>.so</code> files in a single step using <code>*.so*</code>, for your use case of ignoring files in formats specified, you can use two entries in your <code>.gitignore</code> for more specific ignore rule</p> <pre><code>*.so *.so.[0-9]* </code></pre> <hr /> <p>From <a h... | 119, 3889, 25056 | git, gitignore, glob | <h1>Regex-like shell glob patterns for gitignore</h1>
<p>When I compile my C++ project, many shared object files are created with extensions such as</p>
<pre><code>.so
.so.0
.so.7
.so.0.7
</code></pre>
<p>I need to add all those to my <code>.gitignore</code> file. Were this a regex, I could use</p>
<pre><code>\.so[\... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,356 | git | # Regex-like shell glob patterns for gitignore
When I compile my C++ project, many shared object files are created with extensions such as
```
.so
.so.0
.so.7
.so.0.7
```
I need to add all those to my `.gitignore` file. Were this a regex, I could use
```
\.so[\.0-9]*
```
However, [the documentation](http://git-scm... | While the answer by @SpeakEasy can ignore `.so` files in a single step using `*.so*`, for your use case of ignoring files in formats specified, you can use two entries in your `.gitignore` for more specific ignore rule
```
*.so
*.so.[0-9]*
```
---
From [gitignore man page](https://www.kernel.org/pub/software/scm/git... |
22841295 | git config --global user.email "some@email.com" throws "error: only one config file at a time." | 9 | 2014-04-03 14:51:38 | <p>Using <code>git config user.email "some@email.com"</code> sets user email in <strong>global</strong> config file.</p>
<p>Using <code>git config --global user.email "some@email.com"</code> or <code>git config --local user.email "some@email.com"</code> (from within a repo) throws:</p>
<blockquote>
<p>"error: only ... | 5,035 | 451,962 | 2024-04-11 18:21:02 | 24,529,635 | 14 | 2014-07-02 11:11:39 | 2,142,030 | 2014-07-02 11:11:39 | https://stackoverflow.com/q/22841295 | https://stackoverflow.com/a/24529635 | <p>git config --global does not seem to work when the environment variable GIT_CONFIG is set.</p>
<p>Try to unset GIT_CONFIG and then list your global config with</p>
<pre><code>unset GIT_CONFIG
git config --global --list
</code></pre>
| <p>git config --global does not seem to work when the environment variable GIT_CONFIG is set.</p> <p>Try to unset GIT_CONFIG and then list your global config with</p> <pre><code>unset GIT_CONFIG git config --global --list </code></pre> | 119, 32868 | git, git-config | <h1>git config --global user.email "some@email.com" throws "error: only one config file at a time."</h1>
<p>Using <code>git config user.email "some@email.com"</code> sets user email in <strong>global</strong> config file.</p>
<p>Using <code>git config --global user.email "some@email.com"</code> or <code>git config --l... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,357 | git | # git config --global user.email "some@email.com" throws "error: only one config file at a time."
Using `git config user.email "some@email.com"` sets user email in **global** config file.
Using `git config --global user.email "some@email.com"` or `git config --local user.email "some@email.com"` (from within a repo) t... | git config --global does not seem to work when the environment variable GIT_CONFIG is set.
Try to unset GIT_CONFIG and then list your global config with
```
unset GIT_CONFIG
git config --global --list
``` |
24103490 | Need help to understand merge conflict example | 9 | 2014-06-08 06:09:35 | <p>I am following an example from a book which does not show the step to resolve a merge conflict. The tutorial which teaches that did not work for me as mentioned in this post - <a href="https://stackoverflow.com/questions/24094185/simulate-multiple-users-committers-on-local-system">Simulate multiple users/committer&#... | 19,926 | 3,681,785 | 2021-11-27 21:21:09 | 24,103,709 | 14 | 2014-06-08 06:47:16 | 6,309 | 2014-06-08 09:26:50 | https://stackoverflow.com/q/24103490 | https://stackoverflow.com/a/24103709 | <p>Those are merge markers:</p>
<pre><code><<<<<<<
Changes made on the branch that is being merged into. In most cases,
this is the branch that I have currently checked out (i.e. HEAD).
|||||||
The common ancestor version.
=======
Changes made on the branch that is being merged in. This is often a... | <p>Those are merge markers:</p> <pre><code><<<<<<< Changes made on the branch that is being merged into. In most cases, this is the branch that I have currently checked out (i.e. HEAD). ||||||| The common ancestor version. ======= Changes made on the branch that is being merged in. This is often a... | 119, 717 | git, merge | <h1>Need help to understand merge conflict example</h1>
<p>I am following an example from a book which does not show the step to resolve a merge conflict. The tutorial which teaches that did not work for me as mentioned in this post - <a href="https://stackoverflow.com/questions/24094185/simulate-multiple-users-committ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,358 | git | # Need help to understand merge conflict example
I am following an example from a book which does not show the step to resolve a merge conflict. The tutorial which teaches that did not work for me as mentioned in this post - [Simulate multiple users/committer's on local system](https://stackoverflow.com/questions/2409... | Those are merge markers:
```
<<<<<<<
Changes made on the branch that is being merged into. In most cases,
this is the branch that I have currently checked out (i.e. HEAD).
|||||||
The common ancestor version.
=======
Changes made on the branch that is being merged in. This is often a
feature/topic branch.
>>>>>>>
```... |
21678688 | where is the repository remote URL stored? | 9 | 2014-02-10 13:34:53 | <p>Where is the git repository URL for remote is stored ?</p>
<p>the one that I get when I execute this : <code>git config --get remote.origin.url</code></p>
<p>So the below command would set different for each repo by itself ?</p>
<pre><code>git remote set-url origin ssh://newhost.com/usr/local/gitroot/myproject.gi... | 4,688 | 3,311,276 | 2014-02-10 13:36:12 | 21,678,714 | 14 | 2014-02-10 13:36:12 | 2,149,092 | 2014-02-10 13:36:12 | https://stackoverflow.com/q/21678688 | https://stackoverflow.com/a/21678714 | <p>All repo configuration would be inside <code>/project-root/.git/config</code> file</p>
| <p>All repo configuration would be inside <code>/project-root/.git/config</code> file</p> | 119 | git | <h1>where is the repository remote URL stored?</h1>
<p>Where is the git repository URL for remote is stored ?</p>
<p>the one that I get when I execute this : <code>git config --get remote.origin.url</code></p>
<p>So the below command would set different for each repo by itself ?</p>
<pre><code>git remote set-url ori... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,359 | git | # where is the repository remote URL stored?
Where is the git repository URL for remote is stored ?
the one that I get when I execute this : `git config --get remote.origin.url`
So the below command would set different for each repo by itself ?
```
git remote set-url origin ssh://newhost.com/usr/local/gitroot/mypro... | All repo configuration would be inside `/project-root/.git/config` file |
19208359 | Combine multiple orphan branches into one branch | 9 | 2013-10-06 11:27:13 | <p>I had a directory that contains multiple repositories and it looks like this:</p>
<pre><code>folder
|- repo1
| |- .git
| |- File1.txt
|- repo2
| |- .git
| |- File2.txt
|- repo3
| |- .git
| |- File3
</code></pre>
<p>I wanted to combine them into single git repository and I did that by
following <a href="http... | 5,372 | 61,363 | 2016-04-10 10:14:34 | 19,208,499 | 14 | 2013-10-06 11:44:13 | 6,309 | 2016-04-10 10:14:34 | https://stackoverflow.com/q/19208359 | https://stackoverflow.com/a/19208499 | <p>You could rebase the two orphan branches on top of your current <code>master</code> (from <code>repo1</code>)</p>
<pre><code>git checkout branch2
git rebase master
git checkout master
git merge branch2 # fast-forward master to branch2
git checkout branch3
git rebase master
git checkout master
git merge branch3 # f... | <p>You could rebase the two orphan branches on top of your current <code>master</code> (from <code>repo1</code>)</p> <pre><code>git checkout branch2 git rebase master git checkout master git merge branch2 # fast-forward master to branch2 git checkout branch3 git rebase master git checkout master git merge branch3 # f... | 119 | git | <h1>Combine multiple orphan branches into one branch</h1>
<p>I had a directory that contains multiple repositories and it looks like this:</p>
<pre><code>folder
|- repo1
| |- .git
| |- File1.txt
|- repo2
| |- .git
| |- File2.txt
|- repo3
| |- .git
| |- File3
</code></pre>
<p>I wanted to combine them into single... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,360 | git | # Combine multiple orphan branches into one branch
I had a directory that contains multiple repositories and it looks like this:
```
folder
|- repo1
| |- .git
| |- File1.txt
|- repo2
| |- .git
| |- File2.txt
|- repo3
| |- .git
| |- File3
```
I wanted to combine them into single git repository and I did that by... | You could rebase the two orphan branches on top of your current `master` (from `repo1`)
```
git checkout branch2
git rebase master
git checkout master
git merge branch2 # fast-forward master to branch2
git checkout branch3
git rebase master
git checkout master
git merge branch3 # fast-forward master to branch3
```
-... |
18602471 | How to ignore .gitignore files in git status? | 9 | 2013-09-03 22:24:14 | <p>When I run <code>git status</code>, it lists a bunch of <code>.gitignore</code> files that I am not interested in seeing in the list (they got updated locally by <code>Eclipse</code>). I browsed numerous posts in regards to this seemingly common issue but none of the suggested solutions worked for me.</p>
<p>E.g. ... | 15,558 | 1,312,080 | 2017-06-04 19:18:52 | 18,605,053 | 14 | 2013-09-04 03:45:04 | 893 | 2013-09-04 03:45:04 | https://stackoverflow.com/q/18602471 | https://stackoverflow.com/a/18605053 | <p>It sounds like you might be misunderstanding what "ignore" means to Git. A file name mentioned in <code>.gitignore</code> means that if a file is <em>untracked</em>, then <code>git status</code> will not show that file as an untracked file.</p>
<p>Ignoring a file does <em>not</em> do anything when the file is track... | <p>It sounds like you might be misunderstanding what "ignore" means to Git. A file name mentioned in <code>.gitignore</code> means that if a file is <em>untracked</em>, then <code>git status</code> will not show that file as an untracked file.</p> <p>Ignoring a file does <em>not</em> do anything when the file is track... | 119, 25056 | git, gitignore | <h1>How to ignore .gitignore files in git status?</h1>
<p>When I run <code>git status</code>, it lists a bunch of <code>.gitignore</code> files that I am not interested in seeing in the list (they got updated locally by <code>Eclipse</code>). I browsed numerous posts in regards to this seemingly common issue but none ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,361 | git | # How to ignore .gitignore files in git status?
When I run `git status`, it lists a bunch of `.gitignore` files that I am not interested in seeing in the list (they got updated locally by `Eclipse`). I browsed numerous posts in regards to this seemingly common issue but none of the suggested solutions worked for me.
... | It sounds like you might be misunderstanding what "ignore" means to Git. A file name mentioned in `.gitignore` means that if a file is *untracked*, then `git status` will not show that file as an untracked file.
Ignoring a file does *not* do anything when the file is tracked by Git, and has been modified. That is cons... |
17047339 | Trying to delete remote branch; listed locally, repos says it doesn't exist | 9 | 2013-06-11 14:59:54 | <p>Here is what I have tried so far:</p>
<pre><code>I:\Work\bitbucket\test.gadget [master]> git remote update
Fetching origin
I:\Work\bitbucket\test.gadget [master]> git branch -r
origin/HEAD -> origin/master
origin/imagesTest
origin/master
origin/work2
I:\Work\bitbucket\test.gadget [master]> git p... | 2,505 | 107,037 | 2016-03-10 01:01:05 | 17,047,453 | 14 | 2013-06-11 15:04:50 | 894,194 | 2013-06-11 15:04:50 | https://stackoverflow.com/q/17047339 | https://stackoverflow.com/a/17047453 | <p>Remote branch was probably deleted by another person, but your local repo isn't aware of this until you run a <code>git fetch --prune</code>.</p>
<p>This command will delete from your local repo branches that doesn't exists anymore on remote.</p>
| <p>Remote branch was probably deleted by another person, but your local repo isn't aware of this until you run a <code>git fetch --prune</code>.</p> <p>This command will delete from your local repo branches that doesn't exists anymore on remote.</p> | 119 | git | <h1>Trying to delete remote branch; listed locally, repos says it doesn't exist</h1>
<p>Here is what I have tried so far:</p>
<pre><code>I:\Work\bitbucket\test.gadget [master]> git remote update
Fetching origin
I:\Work\bitbucket\test.gadget [master]> git branch -r
origin/HEAD -> origin/master
origin/image... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,362 | git | # Trying to delete remote branch; listed locally, repos says it doesn't exist
Here is what I have tried so far:
```
I:\Work\bitbucket\test.gadget [master]> git remote update
Fetching origin
I:\Work\bitbucket\test.gadget [master]> git branch -r
origin/HEAD -> origin/master
origin/imagesTest
origin/master
origi... | Remote branch was probably deleted by another person, but your local repo isn't aware of this until you run a `git fetch --prune`.
This command will delete from your local repo branches that doesn't exists anymore on remote. |
16571407 | Pull branch from Team Foundation Service to Visual Studio 2012 | 9 | 2013-05-15 17:28:31 | <p>I'm working on a project with 2 others, and we're using Visual Studio 2012 with Git and Team Foundation Service.</p>
<p>I'm able to clone the repository from TFS to my machine, however I can't get a separate development branch to pull as well, while I'm able to see it on the TFS website. </p>
<p>Does anyone know h... | 7,354 | 1,222,008 | 2013-12-06 09:14:03 | 16,583,231 | 14 | 2013-05-16 09:04:27 | 1,222,008 | 2013-05-21 19:08:46 | https://stackoverflow.com/q/16571407 | https://stackoverflow.com/a/16583231 | <p>Found it, apparently it's a bug in Visual Studio Tools for Git:</p>
<blockquote>
<p>To summarize this issue: Visual studio tools for git does not automatically show new published branches in coworker machines. With version 8.5.1. you have to remove the tagopt = --tags option from .git/config, then go to command l... | <p>Found it, apparently it's a bug in Visual Studio Tools for Git:</p> <blockquote> <p>To summarize this issue: Visual studio tools for git does not automatically show new published branches in coworker machines. With version 8.5.1. you have to remove the tagopt = --tags option from .git/config, then go to command l... | 119, 28896, 76220, 80825, 116537 | azure-devops, git, git-branch, git-pull, visual-studio-2012 | <h1>Pull branch from Team Foundation Service to Visual Studio 2012</h1>
<p>I'm working on a project with 2 others, and we're using Visual Studio 2012 with Git and Team Foundation Service.</p>
<p>I'm able to clone the repository from TFS to my machine, however I can't get a separate development branch to pull as well, ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,363 | git | # Pull branch from Team Foundation Service to Visual Studio 2012
I'm working on a project with 2 others, and we're using Visual Studio 2012 with Git and Team Foundation Service.
I'm able to clone the repository from TFS to my machine, however I can't get a separate development branch to pull as well, while I'm able t... | Found it, apparently it's a bug in Visual Studio Tools for Git:
> To summarize this issue: Visual studio tools for git does not automatically show new published branches in coworker machines. With version 8.5.1. you have to remove the tagopt = --tags option from .git/config, then go to command line and do a `git fetch... |
16163829 | git: get effective GIT_DIR, if current dir is a working tree subdir and $GIT_DIR is unset | 9 | 2013-04-23 07:50:14 | <p>From a script, how to determine the current GIT_DIR?
If not overriden, it's just the top level dir or the top level dir of a bare repo.</p>
<p>I want something like:</p>
<pre><code>[/git/repo1/subdir]$ git show-git-dir
/git/repo1/.git
</code></pre>
| 1,308 | 447,503 | 2013-04-23 08:11:36 | 16,163,976 | 14 | 2013-04-23 07:58:04 | 20,261 | 2013-04-23 07:58:04 | https://stackoverflow.com/q/16163829 | https://stackoverflow.com/a/16163976 | <p>This can be done with <a href="http://jk.gs/git-rev-parse.html" rel="noreferrer">rev-parse</a>:</p>
<pre><code>git rev-parse --git-dir
</code></pre>
| <p>This can be done with <a href="http://jk.gs/git-rev-parse.html" rel="noreferrer">rev-parse</a>:</p> <pre><code>git rev-parse --git-dir </code></pre> | 119 | git | <h1>git: get effective GIT_DIR, if current dir is a working tree subdir and $GIT_DIR is unset</h1>
<p>From a script, how to determine the current GIT_DIR?
If not overriden, it's just the top level dir or the top level dir of a bare repo.</p>
<p>I want something like:</p>
<pre><code>[/git/repo1/subdir]$ git show-git-d... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,364 | git | # git: get effective GIT_DIR, if current dir is a working tree subdir and $GIT_DIR is unset
From a script, how to determine the current GIT_DIR?
If not overriden, it's just the top level dir or the top level dir of a bare repo.
I want something like:
```
[/git/repo1/subdir]$ git show-git-dir
/git/repo1/.git
``` | This can be done with [rev-parse](http://jk.gs/git-rev-parse.html):
```
git rev-parse --git-dir
``` |
14624209 | xcode git unable to pull changes from the remote repository | 9 | 2013-01-31 11:04:41 | <p>I'm developing an iPhone application with another developer. Our git repository is situated on the remote server.</p>
<p>So we are working with our working copies and then we do commit, pull, push one by one and we get our local working copies synchronized with server and with each other.</p>
<p>Everything worked ... | 16,064 | 1,897,723 | 2013-01-31 12:12:46 | 14,625,535 | 14 | 2013-01-31 12:12:46 | 1,854,924 | 2013-01-31 12:12:46 | https://stackoverflow.com/q/14624209 | https://stackoverflow.com/a/14625535 | <p>I guess xcode uses option to force fast-forward merges when pulling from repository. That is not bad idea, becouse it prevents you from undesired merges.</p>
<p>Try to use <code>git pull --rebase</code> (resp. check some appropriate checkbox in xcode), it should remove your changes, download new version and then ap... | <p>I guess xcode uses option to force fast-forward merges when pulling from repository. That is not bad idea, becouse it prevents you from undesired merges.</p> <p>Try to use <code>git pull --rebase</code> (resp. check some appropriate checkbox in xcode), it should remove your changes, download new version and then ap... | 119, 908 | git, xcode | <h1>xcode git unable to pull changes from the remote repository</h1>
<p>I'm developing an iPhone application with another developer. Our git repository is situated on the remote server.</p>
<p>So we are working with our working copies and then we do commit, pull, push one by one and we get our local working copies syn... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,366 | git | # xcode git unable to pull changes from the remote repository
I'm developing an iPhone application with another developer. Our git repository is situated on the remote server.
So we are working with our working copies and then we do commit, pull, push one by one and we get our local working copies synchronized with s... | I guess xcode uses option to force fast-forward merges when pulling from repository. That is not bad idea, becouse it prevents you from undesired merges.
Try to use `git pull --rebase` (resp. check some appropriate checkbox in xcode), it should remove your changes, download new version and then apply your removed chan... |
13886042 | Git branches: tracking upstream | 9 | 2012-12-14 20:49:13 | <p>I don't know if I'm misusing Git, or if I've got a configuration problem.</p>
<p>I clone my GitHub repos onto machine A and B, then on machine A I do:</p>
<pre><code>git checkout -b branchA
// make edits
git add .
git commit -am "initial"
git push
</code></pre>
<p>Then on machine B I do:</p>
<pre><code>git... | 6,709 | 28,543 | 2024-06-01 17:33:18 | 13,886,400 | 14 | 2012-12-14 21:21:01 | 6,309 | 2012-12-14 21:21:01 | https://stackoverflow.com/q/13886042 | https://stackoverflow.com/a/13886400 | <p>since <code>git config push.default</code> doesn't return anything, that means, with "git 1.8.0.msysgit.0", your <code>git push</code> means <code>git push origin :</code>, with the refspec '<code>:</code>' standing for "matching" branch.</p>
<p>Here it creates a matching <code>branchA</code> on the remote side.</p... | <p>since <code>git config push.default</code> doesn't return anything, that means, with "git 1.8.0.msysgit.0", your <code>git push</code> means <code>git push origin :</code>, with the refspec '<code>:</code>' standing for "matching" branch.</p> <p>Here it creates a matching <code>branchA</code> on the remote side.</p... | 119 | git | <h1>Git branches: tracking upstream</h1>
<p>I don't know if I'm misusing Git, or if I've got a configuration problem.</p>
<p>I clone my GitHub repos onto machine A and B, then on machine A I do:</p>
<pre><code>git checkout -b branchA
// make edits
git add .
git commit -am "initial"
git push
</code></pre>
<p>T... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,367 | git | # Git branches: tracking upstream
I don't know if I'm misusing Git, or if I've got a configuration problem.
I clone my GitHub repos onto machine A and B, then on machine A I do:
```
git checkout -b branchA
// make edits
git add .
git commit -am "initial"
git push
```
Then on machine B I do:
```
git pull
git checko... | since `git config push.default` doesn't return anything, that means, with "git 1.8.0.msysgit.0", your `git push` means `git push origin :`, with the refspec '`:`' standing for "matching" branch.
Here it creates a matching `branchA` on the remote side.
But that doesn't make it a remote tracking branch.
In other word... |
13170263 | What's the easiest way to merge all but one change from a branch in Git? | 9 | 2012-11-01 02:50:56 | <p>It's kind of like I want to cherry pick all commits from the branch except for one, but I'd like to do that in one command...</p>
<p>• We cut a release, which creates a branch</p>
<p>• The release changes the version number in all our poms, on the branch to one number, and on master to a different number</p>
<p>•... | 3,418 | 243,104 | 2015-03-20 01:30:02 | 13,170,293 | 14 | 2012-11-01 02:54:44 | 148,870 | 2012-11-01 03:22:37 | https://stackoverflow.com/q/13170263 | https://stackoverflow.com/a/13170293 | <p>Here's what I'd suggest doing. First, do a regular merge but don't commit it:</p>
<pre><code>git checkout master
git merge --no-commit <branch>
</code></pre>
<p>then, revert all of the pom files:</p>
<pre><code>for file in $(find . -name 'pom.xml'); do git checkout HEAD "$file"; done
</code></pre>
<p>then ... | <p>Here's what I'd suggest doing. First, do a regular merge but don't commit it:</p> <pre><code>git checkout master git merge --no-commit <branch> </code></pre> <p>then, revert all of the pom files:</p> <pre><code>for file in $(find . -name 'pom.xml'); do git checkout HEAD "$file"; done </code></pre> <p>then ... | 119, 717, 1879, 36489, 38469 | branch, cherry-pick, git, merge, pom.xml | <h1>What's the easiest way to merge all but one change from a branch in Git?</h1>
<p>It's kind of like I want to cherry pick all commits from the branch except for one, but I'd like to do that in one command...</p>
<p>• We cut a release, which creates a branch</p>
<p>• The release changes the version number in all ou... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,368 | git | # What's the easiest way to merge all but one change from a branch in Git?
It's kind of like I want to cherry pick all commits from the branch except for one, but I'd like to do that in one command...
• We cut a release, which creates a branch
• The release changes the version number in all our poms, on the branch t... | Here's what I'd suggest doing. First, do a regular merge but don't commit it:
```
git checkout master
git merge --no-commit <branch>
```
then, revert all of the pom files:
```
for file in $(find . -name 'pom.xml'); do git checkout HEAD "$file"; done
```
then you should be able to commit the final result:
```
git c... |
11267074 | How I undo some changes in my workspace and get back to my last commit? | 9 | 2012-06-29 18:27:35 | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/5004237/git-revert-to-previous-commit-status">Git: Revert to previous commit status</a> </p>
</blockquote>
<p>I've tried some changes in my code but I messed up too many things (never work when you're tired and... | 27,206 | 847,818 | 2012-06-30 18:24:45 | 11,267,196 | 14 | 2012-06-29 18:36:10 | 2,726 | 2012-06-29 18:36:10 | https://stackoverflow.com/q/11267074 | https://stackoverflow.com/a/11267196 | <p>The answers mentioning <code>reset --hard</code> will do what you want (as well as some other things that you may or may not), but you were correct in thinking that <code>checkout</code> was the command you needed. The problem is that <code>checkout</code> does two different things, so you need to supply it with a p... | <p>The answers mentioning <code>reset --hard</code> will do what you want (as well as some other things that you may or may not), but you were correct in thinking that <code>checkout</code> was the command you needed. The problem is that <code>checkout</code> does two different things, so you need to supply it with a p... | 119 | git | <h1>How I undo some changes in my workspace and get back to my last commit?</h1>
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/5004237/git-revert-to-previous-commit-status">Git: Revert to previous commit status</a> </p>
</blockquote>
<p>I've tried some cha... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,369 | git | # How I undo some changes in my workspace and get back to my last commit?
> **Possible Duplicate:**
> [Git: Revert to previous commit status](https://stackoverflow.com/questions/5004237/git-revert-to-previous-commit-status)
I've tried some changes in my code but I messed up too many things (never work when you're t... | The answers mentioning `reset --hard` will do what you want (as well as some other things that you may or may not), but you were correct in thinking that `checkout` was the command you needed. The problem is that `checkout` does two different things, so you need to supply it with a path argument:
`git checkout .`
fro... |
9974718 | Git rebase and moving directory in submodule | 9 | 2012-04-02 10:27:33 | <p>I have moved subdirectory in separate repository and then included it as submodule.</p>
<p>Now I want to rebase another branch on top of that change.</p>
<pre><code>israfel:proj almad$ git rebase -i origin/master
error: could not apply ae1fd9a... Commit message
hint: after resolving the conflicts, mark the correct... | 8,853 | 123,558 | 2012-08-22 21:10:01 | 9,979,918 | 14 | 2012-04-02 16:15:28 | 86,072 | 2012-04-02 16:15:28 | https://stackoverflow.com/q/9974718 | https://stackoverflow.com/a/9979918 | <p>First call reset :</p>
<pre><code>git reset views/docs/examples
git rm -rf views/docs/examples
</code></pre>
| <p>First call reset :</p> <pre><code>git reset views/docs/examples git rm -rf views/docs/examples </code></pre> | 119, 29934, 41612 | git, git-rebase, git-submodules | <h1>Git rebase and moving directory in submodule</h1>
<p>I have moved subdirectory in separate repository and then included it as submodule.</p>
<p>Now I want to rebase another branch on top of that change.</p>
<pre><code>israfel:proj almad$ git rebase -i origin/master
error: could not apply ae1fd9a... Commit message... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,370 | git | # Git rebase and moving directory in submodule
I have moved subdirectory in separate repository and then included it as submodule.
Now I want to rebase another branch on top of that change.
```
israfel:proj almad$ git rebase -i origin/master
error: could not apply ae1fd9a... Commit message
hint: after resolving the ... | First call reset :
```
git reset views/docs/examples
git rm -rf views/docs/examples
``` |
9730937 | Conditional pre-commit hook controlled from command line for GIT: Is it possible? | 9 | 2012-03-16 02:14:15 | <p>We have a nice pre-commit hook for GIT, as well as a nice commit-msg. The pre-commit hook does a syntax validation and the commit-msg does some other business logic. It all works well.</p>
<p>However, I'd like to add Coding Standards validation to the pre-commit hook. In fact, it's already added. However, I don't w... | 4,889 | 38,947 | 2012-03-16 04:34:42 | 9,730,976 | 14 | 2012-03-16 02:18:14 | 148,870 | 2012-03-16 02:18:14 | https://stackoverflow.com/q/9730937 | https://stackoverflow.com/a/9730976 | <p>A simple way of doing this would be to simply use an environment variable:</p>
<pre><code>STANDARDS=no git commit
</code></pre>
<p>and then in the script (example in Bash, but you could read env vars in whatever language your hook is in):</p>
<pre><code>if [ "$STANDARDS" != "no" ]; then
...check for code stan... | <p>A simple way of doing this would be to simply use an environment variable:</p> <pre><code>STANDARDS=no git commit </code></pre> <p>and then in the script (example in Bash, but you could read env vars in whatever language your hook is in):</p> <pre><code>if [ "$STANDARDS" != "no" ]; then ...check for code stan... | 119, 43087 | git, githooks | <h1>Conditional pre-commit hook controlled from command line for GIT: Is it possible?</h1>
<p>We have a nice pre-commit hook for GIT, as well as a nice commit-msg. The pre-commit hook does a syntax validation and the commit-msg does some other business logic. It all works well.</p>
<p>However, I'd like to add Coding S... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,371 | git | # Conditional pre-commit hook controlled from command line for GIT: Is it possible?
We have a nice pre-commit hook for GIT, as well as a nice commit-msg. The pre-commit hook does a syntax validation and the commit-msg does some other business logic. It all works well.
However, I'd like to add Coding Standards validat... | A simple way of doing this would be to simply use an environment variable:
```
STANDARDS=no git commit
```
and then in the script (example in Bash, but you could read env vars in whatever language your hook is in):
```
if [ "$STANDARDS" != "no" ]; then
...check for code standards...
fi
```
---
Git doesn't norm... |
7944757 | Configuring a diff-tool for Git on Windows | 9 | 2011-10-30 12:00:57 | <p>Since <code>git diff</code> in powershell mostly results in a unreadable amount of whitespace or strange characters, I installed Perforce P4Merge, to handle merging and diff.</p>
<p>However, I can't make <code>git diff</code> open the p4merge application to view the diff in. So far my <strong>.gitconfig</strong> lo... | 27,768 | 95,309 | 2024-12-06 07:01:06 | 9,610,494 | 14 | 2012-03-07 23:02:50 | 1,255,889 | 2012-03-07 23:12:03 | https://stackoverflow.com/q/7944757 | https://stackoverflow.com/a/9610494 | <p>In your command prompt, try: <code>git config --global diff.tool p4diff</code></p>
<p>That worked for me, using a config file set up as you had described:</p>
<pre><code>[diff]
tool = p4merge
[difftool "p4diff"]
external = '"C:/Program Files/Perforce/p4merge.exe" "$LOCAL" "$REMOTE"'
</code></pre>
<p... | <p>In your command prompt, try: <code>git config --global diff.tool p4diff</code></p> <p>That worked for me, using a config file set up as you had described:</p> <pre><code>[diff] tool = p4merge [difftool "p4diff"] external = '"C:/Program Files/Perforce/p4merge.exe" "$LOCAL" "$REMOTE"' </code></pre> <p... | 119, 606, 717 | diff, git, merge | <h1>Configuring a diff-tool for Git on Windows</h1>
<p>Since <code>git diff</code> in powershell mostly results in a unreadable amount of whitespace or strange characters, I installed Perforce P4Merge, to handle merging and diff.</p>
<p>However, I can't make <code>git diff</code> open the p4merge application to view t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,372 | git | # Configuring a diff-tool for Git on Windows
Since `git diff` in powershell mostly results in a unreadable amount of whitespace or strange characters, I installed Perforce P4Merge, to handle merging and diff.
However, I can't make `git diff` open the p4merge application to view the diff in. So far my **.gitconfig** l... | In your command prompt, try: `git config --global diff.tool p4diff`
That worked for me, using a config file set up as you had described:
```
[diff]
tool = p4merge
[difftool "p4diff"]
external = '"C:/Program Files/Perforce/p4merge.exe" "$LOCAL" "$REMOTE"'
```
Running `git difftool` opened p4merge as exp... |
3269086 | git: Can I stash an untracked file without adding it to the index? | 9 | 2010-07-16 21:46:14 | <p>A related question <a href="https://stackoverflow.com/questions/835501/git-how-do-you-stash-an-untracked-file">How do you stash an untracked file?</a> was answered with "track the file." This doesn't work for my particular needs, however.</p>
<p>I'm trying to stash everything that isn't in the index with <code>git... | 2,243 | 336,925 | 2012-04-10 16:24:33 | 7,626,960 | 14 | 2011-10-02 14:30:41 | 438,911 | 2012-04-10 16:24:33 | https://stackoverflow.com/q/3269086 | https://stackoverflow.com/a/7626960 | <p>As I answered on the related question, the answer is now YES:</p>
<p>As of git 1.7.7, <code>git stash</code> accepts the <code>--include-untracked</code> option to include untracked files in your stash.</p>
<pre><code>git stash --include-untracked
</code></pre>
<p>Or you can use the short <code>-u</code> option.<... | <p>As I answered on the related question, the answer is now YES:</p> <p>As of git 1.7.7, <code>git stash</code> accepts the <code>--include-untracked</code> option to include untracked files in your stash.</p> <pre><code>git stash --include-untracked </code></pre> <p>Or you can use the short <code>-u</code> option.<... | 119, 13091, 25281 | git, git-stash, pre-commit-hook | <h1>git: Can I stash an untracked file without adding it to the index?</h1>
<p>A related question <a href="https://stackoverflow.com/questions/835501/git-how-do-you-stash-an-untracked-file">How do you stash an untracked file?</a> was answered with "track the file." This doesn't work for my particular needs, however.</... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,376 | git | # git: Can I stash an untracked file without adding it to the index?
A related question [How do you stash an untracked file?](https://stackoverflow.com/questions/835501/git-how-do-you-stash-an-untracked-file) was answered with "track the file." This doesn't work for my particular needs, however.
I'm trying to stash e... | As I answered on the related question, the answer is now YES:
As of git 1.7.7, `git stash` accepts the `--include-untracked` option to include untracked files in your stash.
```
git stash --include-untracked
```
Or you can use the short `-u` option.
```
git stash -u
``` |
6194311 | Integrating MsBuild with Git | 9 | 2011-05-31 22:30:58 | <p>Im looking for way to integrate MsBuild scripts with Git source control. The first thing I would like to make is to create Task that creates Git Tag at sources.</p>
<p>MsBuild Comunity Tasks looks like doesn't have any support for Git.
Any ideas how to connect these two is much appreciated.</p>
| 5,292 | 59,528 | 2018-11-06 11:17:33 | 6,194,595 | 14 | 2011-05-31 23:11:32 | 526,535 | 2011-05-31 23:11:32 | https://stackoverflow.com/q/6194311 | https://stackoverflow.com/a/6194595 | <p>Depending what you are doing and if you want to keep it simple, just use the <code>Exec</code> task to call the appropriate git command, like <code>git tag</code></p>
<p>You can otherwise look at extending MSBuild and write tasks that make use of these <code>git commands</code> or you can make use of <a href="https... | <p>Depending what you are doing and if you want to keep it simple, just use the <code>Exec</code> task to call the appropriate git command, like <code>git tag</code></p> <p>You can otherwise look at extending MSBuild and write tasks that make use of these <code>git commands</code> or you can make use of <a href="https... | 119, 265 | git, msbuild | <h1>Integrating MsBuild with Git</h1>
<p>Im looking for way to integrate MsBuild scripts with Git source control. The first thing I would like to make is to create Task that creates Git Tag at sources.</p>
<p>MsBuild Comunity Tasks looks like doesn't have any support for Git.
Any ideas how to connect these two is much... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,377 | git | # Integrating MsBuild with Git
Im looking for way to integrate MsBuild scripts with Git source control. The first thing I would like to make is to create Task that creates Git Tag at sources.
MsBuild Comunity Tasks looks like doesn't have any support for Git.
Any ideas how to connect these two is much appreciated. | Depending what you are doing and if you want to keep it simple, just use the `Exec` task to call the appropriate git command, like `git tag`
You can otherwise look at extending MSBuild and write tasks that make use of these `git commands` or you can make use of [GitSharp](https://github.com/henon/GitSharp) |
5823148 | When subproject is a subtree merge, how do I revert a commit that came from the subtree remote? | 9 | 2011-04-28 18:12:22 | <p>I have a <a href="http://wuertele.com/sites/wuertele.com/files/test-subtree-revert." rel="noreferrer"><strong>testcase shell script</strong></a>. I want to <strong>downgrade a sub-project</strong>, but can't figure out how. Here's the story:</p>
<p>I created two repos, "<strong>subproject</strong>" and "<strong>su... | 5,549 | 728,100 | 2011-04-29 07:54:23 | 5,829,350 | 14 | 2011-04-29 07:41:24 | 193,688 | 2011-04-29 07:54:23 | https://stackoverflow.com/q/5823148 | https://stackoverflow.com/a/5829350 | <p>Ultimately <code>git revert v3</code> in <code>superproject</code> fails because it does not account for the fact that <code>v3</code> is “behind” a subtree merge (thus the recorded pathnames differ in <code>N</code> and <code>v3</code>).</p>
<h1>Revert atop <code>superproject</code> history</h1>
<p>With Git 1.7.5... | <p>Ultimately <code>git revert v3</code> in <code>superproject</code> fails because it does not account for the fact that <code>v3</code> is “behind” a subtree merge (thus the recorded pathnames differ in <code>N</code> and <code>v3</code>).</p> <h1>Revert atop <code>superproject</code> history</h1> <p>With Git 1.7.5... | 119 | git | <h1>When subproject is a subtree merge, how do I revert a commit that came from the subtree remote?</h1>
<p>I have a <a href="http://wuertele.com/sites/wuertele.com/files/test-subtree-revert." rel="noreferrer"><strong>testcase shell script</strong></a>. I want to <strong>downgrade a sub-project</strong>, but can't fig... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,378 | git | # When subproject is a subtree merge, how do I revert a commit that came from the subtree remote?
I have a [**testcase shell script**](http://wuertele.com/sites/wuertele.com/files/test-subtree-revert.). I want to **downgrade a sub-project**, but can't figure out how. Here's the story:
I created two repos, "**subproje... | Ultimately `git revert v3` in `superproject` fails because it does not account for the fact that `v3` is “behind” a subtree merge (thus the recorded pathnames differ in `N` and `v3`).
# Revert atop `superproject` history
With Git 1.7.5 you can use
```
git revert --strategy subtree -X subtree=subproject v3
```
in pl... |
5186371 | Problem with modified files showing up in Git but not updating? | 9 | 2011-03-03 20:49:59 | <p>I've got some files/folders that just wont leave the Git staging area?</p>
<pre><code># On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# (commit or discard the untr... | 7,753 | 387,640 | 2012-10-23 07:30:22 | 5,186,451 | 14 | 2011-03-03 20:57:22 | 6,309 | 2011-03-03 20:57:22 | https://stackoverflow.com/q/5186371 | https://stackoverflow.com/a/5186451 | <p>Those could be <strong>submodules</strong>, in which case their status would be displayed from the status of the parent repo.</p>
<p>Unless, that is, you use the <code>--ignore-submodules[=<when>]</code> option of <a href="http://www.kernel.org/pub/software/scm/git/docs/git-status.html" rel="noreferrer">git s... | <p>Those could be <strong>submodules</strong>, in which case their status would be displayed from the status of the parent repo.</p> <p>Unless, that is, you use the <code>--ignore-submodules[=<when>]</code> option of <a href="http://www.kernel.org/pub/software/scm/git/docs/git-status.html" rel="noreferrer">git s... | 119, 20002, 41612 | git, git-submodules, staging | <h1>Problem with modified files showing up in Git but not updating?</h1>
<p>I've got some files/folders that just wont leave the Git staging area?</p>
<pre><code># On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..."... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,379 | git | # Problem with modified files showing up in Git but not updating?
I've got some files/folders that just wont leave the Git staging area?
```
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working d... | Those could be **submodules**, in which case their status would be displayed from the status of the parent repo.
Unless, that is, you use the `--ignore-submodules[=<when>]` option of [git status](http://www.kernel.org/pub/software/scm/git/docs/git-status.html):
> Ignore changes to submodules when looking for changes.... |
4586988 | Why does git confuse removal with rename/copy? | 9 | 2011-01-03 18:06:32 | <p>The status report currently shows the following:</p>
<p><a href="https://i.sstatic.net/VpRM9.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/VpRM9.png" alt="" /></a><br />
<sub>(source: <a href="http://gyazo.com/29176f171b2cdd21ba6a929799b45358.png" rel="nofollow noreferrer">gyazo.com</a>)</sub></p>
<... | 1,444 | 238,180 | 2019-08-08 05:06:51 | 4,587,001 | 14 | 2011-01-03 18:09:10 | 501,250 | 2011-01-03 18:14:18 | https://stackoverflow.com/q/4586988 | https://stackoverflow.com/a/4587001 | <p>Git <em>is</em> just removing the file. Renames are detected heuristically based on the amount of identical content in the two files, but <strong>this information is not stored in the commit.</strong> When you look up the commit later, Git will again determine heuristically if a rename happened based only on the n... | <p>Git <em>is</em> just removing the file. Renames are detected heuristically based on the amount of identical content in the two files, but <strong>this information is not stored in the commit.</strong> When you look up the commit later, Git will again determine heuristically if a rename happened based only on the n... | 119 | git | <h1>Why does git confuse removal with rename/copy?</h1>
<p>The status report currently shows the following:</p>
<p><a href="https://i.sstatic.net/VpRM9.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/VpRM9.png" alt="" /></a><br />
<sub>(source: <a href="http://gyazo.com/29176f171b2cdd21ba6a929799b45358.p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,380 | git | # Why does git confuse removal with rename/copy?
The status report currently shows the following:
[](https://i.sstatic.net/VpRM9.png)
(source: [gyazo.com](http://gyazo.com/29176f171b2cdd21ba6a929799b45358.png))
However, when I do
`git rm include/oogl/Buffer.hpp`
the following ... | Git *is* just removing the file. Renames are detected heuristically based on the amount of identical content in the two files, but **this information is not stored in the commit.** When you look up the commit later, Git will again determine heuristically if a rename happened based only on the new and removed files. So ... |
2534773 | what is dereference in the context of git show-ref -d | 9 | 2010-03-28 22:08:00 | <p>Here is the man page for <a href="http://git-scm.com/docs/git-show-ref" rel="noreferrer">git show-ref -d</a> . They also have an example at the bottom. Still I am not able to understand what dereference does?</p>
| 2,457 | 253,470 | 2022-07-27 12:42:07 | 2,534,787 | 14 | 2010-03-28 22:13:35 | 119,963 | 2022-07-27 12:42:07 | https://stackoverflow.com/q/2534773 | https://stackoverflow.com/a/2534787 | <p>In Git, a "normal" (annotated, not lightweight) <a href="https://git-scm.com/book/sv/v2/Git-Internals-Git-References#_tags" rel="nofollow noreferrer">tag is an object unto itself</a>, containing metadata and the SHA1 of the object it tags. Chapter <a href="https://git-scm.com/book/en/v2/Git-Internals-Git-O... | <p>In Git, a "normal" (annotated, not lightweight) <a href="https://git-scm.com/book/sv/v2/Git-Internals-Git-References#_tags" rel="nofollow noreferrer">tag is an object unto itself</a>, containing metadata and the SHA1 of the object it tags. Chapter <a href="https://git-scm.com/book/en/v2/Git-Internals-Git-O... | 119 | git | <h1>what is dereference in the context of git show-ref -d</h1>
<p>Here is the man page for <a href="http://git-scm.com/docs/git-show-ref" rel="noreferrer">git show-ref -d</a> . They also have an example at the bottom. Still I am not able to understand what dereference does?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,381 | git | # what is dereference in the context of git show-ref -d
Here is the man page for [git show-ref -d](http://git-scm.com/docs/git-show-ref) . They also have an example at the bottom. Still I am not able to understand what dereference does? | In Git, a "normal" (annotated, not lightweight) [tag is an object unto itself](https://git-scm.com/book/sv/v2/Git-Internals-Git-References#_tags), containing metadata and the SHA1 of the object it tags. Chapter [10.2 Git Internals - Git Objects](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects) in the Git commu... |
734256 | Is there a way to "git svn dcommit" from a cloned git-svn repository : | 9 | 2009-04-09 13:35:04 | <p>Is there a way to "git svn dcommit" from a cloned git-svn repository :</p>
<p>I have several branches in my svn, sometimes it is very small branch and it is nice to have it in the same directory, but sometimes these branches grow big and it is nice to move the whole thing to another folder.</p>
<p>But when I do a ... | 1,813 | 4,508 | 2023-10-03 20:59:22 | 735,984 | 14 | 2009-04-09 21:27:15 | 69,755 | 2023-10-03 20:29:14 | https://stackoverflow.com/q/734256 | https://stackoverflow.com/a/735984 | <p>Once you've cloned a <code>git-svn</code> repo, you can pull in the information you need by running <code>git svn init</code> with the same parameters as the original repo was created with. According to <a href="http://trac.webkit.org/wiki/UsingGitWithWebKit" rel="nofollow noreferrer">the WebKit <code>git-svn</code>... | <p>Once you've cloned a <code>git-svn</code> repo, you can pull in the information you need by running <code>git svn init</code> with the same parameters as the original repo was created with. According to <a href="http://trac.webkit.org/wiki/UsingGitWithWebKit" rel="nofollow noreferrer">the WebKit <code>git-svn</code>... | 119, 6452 | git, git-svn | <h1>Is there a way to "git svn dcommit" from a cloned git-svn repository :</h1>
<p>Is there a way to "git svn dcommit" from a cloned git-svn repository :</p>
<p>I have several branches in my svn, sometimes it is very small branch and it is nice to have it in the same directory, but sometimes these branches grow big an... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,382 | git | # Is there a way to "git svn dcommit" from a cloned git-svn repository :
Is there a way to "git svn dcommit" from a cloned git-svn repository :
I have several branches in my svn, sometimes it is very small branch and it is nice to have it in the same directory, but sometimes these branches grow big and it is nice to ... | Once you've cloned a `git-svn` repo, you can pull in the information you need by running `git svn init` with the same parameters as the original repo was created with. According to [the WebKit `git-svn` instructions](http://trac.webkit.org/wiki/UsingGitWithWebKit), the trick is to use [`update-ref`](https://git-scm.com... |
60417906 | Is it possible to git rebase and skip all conflicts? | 8 | 2020-02-26 16:01:05 | <p>Is it possible to git rebase without having to manually call <code>git rebase --skip</code> for each individual conflict. Can you just call something like <code>git rebase --skip all</code>?</p>
| 5,760 | 5,181,480 | 2020-02-26 16:50:44 | 60,418,776 | 14 | 2020-02-26 16:50:44 | 2,437,508 | 2020-02-26 16:50:44 | https://stackoverflow.com/q/60417906 | https://stackoverflow.com/a/60418776 | <p>I guess you could try with a bash while:</p>
<pre><code>while [ true ]; do git rebase --skip; if [ $? -eq 0 ]; then break; fi; done
</code></pre>
<p>So, you will be cycling issuing <code>git rebase --skip</code> every single time that git stops with a problem.... when it <em>does not</em> end with a problem (in wh... | <p>I guess you could try with a bash while:</p> <pre><code>while [ true ]; do git rebase --skip; if [ $? -eq 0 ]; then break; fi; done </code></pre> <p>So, you will be cycling issuing <code>git rebase --skip</code> every single time that git stops with a problem.... when it <em>does not</em> end with a problem (in wh... | 119 | git | <h1>Is it possible to git rebase and skip all conflicts?</h1>
<p>Is it possible to git rebase without having to manually call <code>git rebase --skip</code> for each individual conflict. Can you just call something like <code>git rebase --skip all</code>?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,387 | git | # Is it possible to git rebase and skip all conflicts?
Is it possible to git rebase without having to manually call `git rebase --skip` for each individual conflict. Can you just call something like `git rebase --skip all`? | I guess you could try with a bash while:
```
while [ true ]; do git rebase --skip; if [ $? -eq 0 ]; then break; fi; done
```
So, you will be cycling issuing `git rebase --skip` every single time that git stops with a problem.... when it *does not* end with a problem (in which case I assume it would have an exit code ... |
33628862 | GIT: error: pathspec 'xxx did not match any file(s) known to git | 8 | 2015-11-10 11:23:47 | <p>I have some trouble with a git repository of mine and I cant find the error :(</p>
<p>Thing is, I had this repository already in use for a PHP project. everything was fine. Then, I "added" composer to it. I.e., I copied the composer file to the repositorie's root, created a composer.json, and used "composer install... | 74,321 | 3,996,393 | 2025-01-24 19:13:25 | 54,200,220 | 14 | 2019-01-15 13:49:56 | 3,996,393 | 2019-01-15 13:49:56 | https://stackoverflow.com/q/33628862 | https://stackoverflow.com/a/54200220 | <p>Well, years passed, new git versions were released, yet the problem still show up for me from time to time. The posted fixes unfortunately do not help. Yet, instead of committing with <code>git commit . -m "xyz"</code> doing a </p>
<p><code>git commit -a -m "xyz"</code></p>
<p>does wonders.</p>
<p>Cheers.</p>
| <p>Well, years passed, new git versions were released, yet the problem still show up for me from time to time. The posted fixes unfortunately do not help. Yet, instead of committing with <code>git commit . -m "xyz"</code> doing a </p> <p><code>git commit -a -m "xyz"</code></p> <p>does wonders.</p> <p>Cheers.</p> | 119 | git | <h1>GIT: error: pathspec 'xxx did not match any file(s) known to git</h1>
<p>I have some trouble with a git repository of mine and I cant find the error :(</p>
<p>Thing is, I had this repository already in use for a PHP project. everything was fine. Then, I "added" composer to it. I.e., I copied the composer file to t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,390 | git | # GIT: error: pathspec 'xxx did not match any file(s) known to git
I have some trouble with a git repository of mine and I cant find the error :(
Thing is, I had this repository already in use for a PHP project. everything was fine. Then, I "added" composer to it. I.e., I copied the composer file to the repositorie's... | Well, years passed, new git versions were released, yet the problem still show up for me from time to time. The posted fixes unfortunately do not help. Yet, instead of committing with `git commit . -m "xyz"` doing a
`git commit -a -m "xyz"`
does wonders.
Cheers. |
42927151 | Difference between git merge and git fetch? | 8 | 2017-03-21 12:27:05 | <p>What is the difference between 'git merge' and 'git fetch'?
I have some problems with these two commands.
I don't know when I should use one or the other.</p>
| 13,997 | 7,573,550 | 2017-07-10 13:55:15 | 42,927,657 | 14 | 2017-03-21 12:49:25 | 7,050,130 | 2017-07-10 13:55:15 | https://stackoverflow.com/q/42927151 | https://stackoverflow.com/a/42927657 | <p><strong>UPDATE</strong> - Good grief, my merge diagrams have been wrong this whole time. A merge doesn't move the "other" branch's ref...</p>
<hr>
<p><code>git fetch</code> is about retrieving data from a remote repository.</p>
<p><code>git merge</code> is about combining work from multiple lines of work (usuall... | <p><strong>UPDATE</strong> - Good grief, my merge diagrams have been wrong this whole time. A merge doesn't move the "other" branch's ref...</p> <hr> <p><code>git fetch</code> is about retrieving data from a remote repository.</p> <p><code>git merge</code> is about combining work from multiple lines of work (usuall... | 119 | git | <h1>Difference between git merge and git fetch?</h1>
<p>What is the difference between 'git merge' and 'git fetch'?
I have some problems with these two commands.
I don't know when I should use one or the other.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,394 | git | # Difference between git merge and git fetch?
What is the difference between 'git merge' and 'git fetch'?
I have some problems with these two commands.
I don't know when I should use one or the other. | **UPDATE** - Good grief, my merge diagrams have been wrong this whole time. A merge doesn't move the "other" branch's ref...
---
`git fetch` is about retrieving data from a remote repository.
`git merge` is about combining work from multiple lines of work (usually local branches, but see below).
`git pull` (I know ... |
36799362 | How do you merge the master branch into a feature branch with GitPython? | 8 | 2016-04-22 16:50:18 | <p>I'm trying to automate some of my standard workflow and one thing I find myself doing often is to merge changes to a remote master branch into my own local branch and push the result.</p>
<p>So the steps are as follows:</p>
<ol>
<li>Switch to master</li>
<li>Pull changes from remote</li>
<li>Switch to original fea... | 12,906 | 15,369 | 2022-03-24 11:25:43 | 36,802,900 | 14 | 2016-04-22 20:35:21 | 147,356 | 2020-12-09 19:04:14 | https://stackoverflow.com/q/36799362 | https://stackoverflow.com/a/36802900 | <p>Absent a very compelling reason, I would suggest just using the <code>git</code> binary to perform your tasks. However, if you want to do this using <a href="https://gitpython.readthedocs.io/en/stable/" rel="nofollow noreferrer">GitPython</a>, take a look at the <a href="http://gitpython.readthedocs.org/en/stable/t... | <p>Absent a very compelling reason, I would suggest just using the <code>git</code> binary to perform your tasks. However, if you want to do this using <a href="https://gitpython.readthedocs.io/en/stable/" rel="nofollow noreferrer">GitPython</a>, take a look at the <a href="http://gitpython.readthedocs.org/en/stable/t... | 16, 119, 61013 | git, gitpython, python | <h1>How do you merge the master branch into a feature branch with GitPython?</h1>
<p>I'm trying to automate some of my standard workflow and one thing I find myself doing often is to merge changes to a remote master branch into my own local branch and push the result.</p>
<p>So the steps are as follows:</p>
<ol>
<li>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,395 | git | # How do you merge the master branch into a feature branch with GitPython?
I'm trying to automate some of my standard workflow and one thing I find myself doing often is to merge changes to a remote master branch into my own local branch and push the result.
So the steps are as follows:
1. Switch to master
2. Pull c... | Absent a very compelling reason, I would suggest just using the `git` binary to perform your tasks. However, if you want to do this using [GitPython](https://gitpython.readthedocs.io/en/stable/), take a look at the [Advanced Repo usage](http://gitpython.readthedocs.org/en/stable/tutorial.html#advanced-repo-usage) secti... |
35974964 | Authentification with JGit 's PullCommand | 8 | 2016-03-13 19:49:07 | <p>I am using JGit and want to pull from the remote repository to my local repository.</p>
<p>The first approch was to clone the repository and that worked fine:</p>
<pre><code>CredentialsProvider cp = new UsernamePasswordCredentialsProvider(username, password);
try (Git result = Git.cloneRepository()
.setURI("ht... | 22,495 | 846,507 | 2022-09-21 09:31:59 | 35,976,190 | 14 | 2016-03-13 21:38:10 | 2,986,905 | 2019-05-17 07:11:50 | https://stackoverflow.com/q/35974964 | https://stackoverflow.com/a/35976190 | <p>You can pass a <code>CredentialsProvider</code> to the <code>PushCommand</code> in the same way as with the <code>CloneCommand</code>.</p>
<p>For example:</p>
<pre class="lang-java prettyprint-override"><code>CredentialsProvider cp = new UsernamePasswordCredentialsProvider(username, password);
git.pull().setCreden... | <p>You can pass a <code>CredentialsProvider</code> to the <code>PushCommand</code> in the same way as with the <code>CloneCommand</code>.</p> <p>For example:</p> <pre class="lang-java prettyprint-override"><code>CredentialsProvider cp = new UsernamePasswordCredentialsProvider(username, password); git.pull().setCreden... | 17, 119, 61058 | git, java, jgit | <h1>Authentification with JGit 's PullCommand</h1>
<p>I am using JGit and want to pull from the remote repository to my local repository.</p>
<p>The first approch was to clone the repository and that worked fine:</p>
<pre><code>CredentialsProvider cp = new UsernamePasswordCredentialsProvider(username, password);
try ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,397 | git | # Authentification with JGit 's PullCommand
I am using JGit and want to pull from the remote repository to my local repository.
The first approch was to clone the repository and that worked fine:
```
CredentialsProvider cp = new UsernamePasswordCredentialsProvider(username, password);
try (Git result = Git.cloneRepo... | You can pass a `CredentialsProvider` to the `PushCommand` in the same way as with the `CloneCommand`.
For example:
```
CredentialsProvider cp = new UsernamePasswordCredentialsProvider(username, password);
git.pull().setCredentialsProvider(cp).call();
```
All commands that connect to a remote repository, have a commo... |
27330132 | I can't uninstall Git | 8 | 2014-12-06 09:16:34 | <p>I tried to update my git version on Mac OS X 10.7, but it doesn't change the version.
It's still on 2.0.</p>
<p>If I run, </p>
<pre><code>rm -rf /usr/local/git
rm /etc/paths.d/git
rm /etc/manpaths.d/git
</code></pre>
<p>the new version gets uninstalled, but the old one is still there (<code>git</code> is still a ... | 32,399 | 2,399,736 | 2014-12-06 10:02:15 | 27,330,167 | 14 | 2014-12-06 09:21:32 | 6,309 | 2014-12-06 09:48:48 | https://stackoverflow.com/q/27330132 | https://stackoverflow.com/a/27330167 | <p>To see where git is installed:</p>
<pre><code>which git
</code></pre>
<p>See for instance those guides:</p>
<ul>
<li>"<a href="http://burnedpixel.com/blog/setting-up-git-and-github-on-your-mac/" rel="noreferrer">Beginner's Setup Guide for Git & Github on Mac OS X</a>"</li>
<li>"<a href="http://coolestguideson... | <p>To see where git is installed:</p> <pre><code>which git </code></pre> <p>See for instance those guides:</p> <ul> <li>"<a href="http://burnedpixel.com/blog/setting-up-git-and-github-on-your-mac/" rel="noreferrer">Beginner's Setup Guide for Git & Github on Mac OS X</a>"</li> <li>"<a href="http://coolestguideson... | 119, 369, 14038, 71219 | git, macos, osx-lion, uninstallation | <h1>I can't uninstall Git</h1>
<p>I tried to update my git version on Mac OS X 10.7, but it doesn't change the version.
It's still on 2.0.</p>
<p>If I run, </p>
<pre><code>rm -rf /usr/local/git
rm /etc/paths.d/git
rm /etc/manpaths.d/git
</code></pre>
<p>the new version gets uninstalled, but the old one is still ther... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,399 | git | # I can't uninstall Git
I tried to update my git version on Mac OS X 10.7, but it doesn't change the version.
It's still on 2.0.
If I run,
```
rm -rf /usr/local/git
rm /etc/paths.d/git
rm /etc/manpaths.d/git
```
the new version gets uninstalled, but the old one is still there (`git` is still a valid command).
How ... | To see where git is installed:
```
which git
```
See for instance those guides:
- "[Beginner's Setup Guide for Git & Github on Mac OS X](http://burnedpixel.com/blog/setting-up-git-and-github-on-your-mac/)"
- "[Install and Update to latest version Git on Mac OSX 10.10 Yosemite](http://coolestguidesontheplanet.com/ins... |
27141309 | git: checkout all files from a branch (but stay at current branch) | 8 | 2014-11-26 04:24:14 | <p>I can checkout a particular file from a branch into current branch with <code>git checkout branchname filename</code>. How can I checkout <strong>all the files</strong> in <code>branchname</code> into current branch?</p>
<p><code>git checkout branchname</code> does not fit my need since that will switch me away fro... | 5,389 | 4,195,568 | 2022-06-28 16:02:18 | 27,141,335 | 14 | 2014-11-26 04:27:26 | 148,870 | 2014-11-26 04:27:26 | https://stackoverflow.com/q/27141309 | https://stackoverflow.com/a/27141335 | <pre><code>git reset --hard branchname
</code></pre>
<p>Note that this <em>will</em> get rid of any changes you had in the current branch that aren't in the other branch, and any uncommitted changes you might have had laying around. It will keep you on your current branch but change it to point at the commit which <co... | <pre><code>git reset --hard branchname </code></pre> <p>Note that this <em>will</em> get rid of any changes you had in the current branch that aren't in the other branch, and any uncommitted changes you might have had laying around. It will keep you on your current branch but change it to point at the commit which <co... | 119 | git | <h1>git: checkout all files from a branch (but stay at current branch)</h1>
<p>I can checkout a particular file from a branch into current branch with <code>git checkout branchname filename</code>. How can I checkout <strong>all the files</strong> in <code>branchname</code> into current branch?</p>
<p><code>git checko... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,400 | git | # git: checkout all files from a branch (but stay at current branch)
I can checkout a particular file from a branch into current branch with `git checkout branchname filename`. How can I checkout **all the files** in `branchname` into current branch?
`git checkout branchname` does not fit my need since that will swit... | ```
git reset --hard branchname
```
Note that this *will* get rid of any changes you had in the current branch that aren't in the other branch, and any uncommitted changes you might have had laying around. It will keep you on your current branch but change it to point at the commit which `branchname` refers to.
If yo... |
23616706 | Git squash and merge | 8 | 2014-05-12 18:55:25 | <p>Could anyone please tell me what the difference between these two commands:</p>
<pre><code>git merge --squash
</code></pre>
<p>and</p>
<pre><code>git merge --no-ff
</code></pre>
| 5,834 | 1,459,831 | 2014-05-12 19:25:09 | 23,617,119 | 14 | 2014-05-12 19:19:13 | 224,286 | 2014-05-12 19:25:09 | https://stackoverflow.com/q/23616706 | https://stackoverflow.com/a/23617119 | <p>I think your question indicates a bit of a misunderstanding. <code>--no-ff</code> and <code>--squash</code> are not opposites, rather they are subtly different operations. Keep that in mind while reading.</p>
<h2>git merge --squash</h2>
<p>The <a href="https://www.kernel.org/pub/software/scm/git/docs/git-merge.htm... | <p>I think your question indicates a bit of a misunderstanding. <code>--no-ff</code> and <code>--squash</code> are not opposites, rather they are subtly different operations. Keep that in mind while reading.</p> <h2>git merge --squash</h2> <p>The <a href="https://www.kernel.org/pub/software/scm/git/docs/git-merge.htm... | 119, 717, 42532 | git, merge, squash | <h1>Git squash and merge</h1>
<p>Could anyone please tell me what the difference between these two commands:</p>
<pre><code>git merge --squash
</code></pre>
<p>and</p>
<pre><code>git merge --no-ff
</code></pre>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,401 | git | # Git squash and merge
Could anyone please tell me what the difference between these two commands:
```
git merge --squash
```
and
```
git merge --no-ff
``` | I think your question indicates a bit of a misunderstanding. `--no-ff` and `--squash` are not opposites, rather they are subtly different operations. Keep that in mind while reading.
## git merge --squash
The [help page for merge](https://www.kernel.org/pub/software/scm/git/docs/git-merge.html) says the following abo... |
18635405 | git update-index assume-unchanged error: assume-unchanged: does not exist and --remove not passed | 8 | 2013-09-05 11:43:34 | <p>I am trying to tell Git to ignore changes I make to a properties file so that I don't accidentally commit it to my git repository. I am using:</p>
<p>git update-index assume-unchanged [file]</p>
<p>Which gives the output:</p>
<p>error: assume-unchanged: does not exist and --remove not passed
fatal: Unable to proc... | 6,984 | 480,316 | 2013-09-05 12:04:57 | 18,635,849 | 14 | 2013-09-05 12:04:57 | 383,243 | 2013-09-05 12:04:57 | https://stackoverflow.com/q/18635405 | https://stackoverflow.com/a/18635849 | <p>Maybe it's an accidental error when you wrote the question, but I think the "--" is missing in front of the argument.</p>
<p>Does <code>git update-index --assume-unchanged [file]</code> work?</p>
| <p>Maybe it's an accidental error when you wrote the question, but I think the "--" is missing in front of the argument.</p> <p>Does <code>git update-index --assume-unchanged [file]</code> work?</p> | 119 | git | <h1>git update-index assume-unchanged error: assume-unchanged: does not exist and --remove not passed</h1>
<p>I am trying to tell Git to ignore changes I make to a properties file so that I don't accidentally commit it to my git repository. I am using:</p>
<p>git update-index assume-unchanged [file]</p>
<p>Which give... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,403 | git | # git update-index assume-unchanged error: assume-unchanged: does not exist and --remove not passed
I am trying to tell Git to ignore changes I make to a properties file so that I don't accidentally commit it to my git repository. I am using:
git update-index assume-unchanged [file]
Which gives the output:
error: a... | Maybe it's an accidental error when you wrote the question, but I think the "--" is missing in front of the argument.
Does `git update-index --assume-unchanged [file]` work? |
16172696 | Prevent git from treating delete & new file w/ changes as a move | 8 | 2013-04-23 14:59:34 | <p>I'm using Git to track changes to XML configurations for virtual machines. Many of the XML configurations are similar, with just a few fields that are different. I often delete VM configurations and add new ones. When adding these changes to the repo, Git treats it as a file rename, with just a few changes. I could ... | 4,342 | 899,199 | 2013-04-23 15:18:28 | 16,172,940 | 14 | 2013-04-23 15:10:21 | 113,325 | 2013-04-23 15:18:28 | https://stackoverflow.com/q/16172696 | https://stackoverflow.com/a/16172940 | <p>Renames are only something shown in the output, internally they are stored just as regular deletions and creations.</p>
<p>If you want to disable the renames detection, you can use the <code>--no-renames</code> option:</p>
<pre><code>git log --stat --no-renames
</code></pre>
<p>(also works with <code>git diff</co... | <p>Renames are only something shown in the output, internally they are stored just as regular deletions and creations.</p> <p>If you want to disable the renames detection, you can use the <code>--no-renames</code> option:</p> <pre><code>git log --stat --no-renames </code></pre> <p>(also works with <code>git diff</co... | 119 | git | <h1>Prevent git from treating delete & new file w/ changes as a move</h1>
<p>I'm using Git to track changes to XML configurations for virtual machines. Many of the XML configurations are similar, with just a few fields that are different. I often delete VM configurations and add new ones. When adding these changes to t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,405 | git | # Prevent git from treating delete & new file w/ changes as a move
I'm using Git to track changes to XML configurations for virtual machines. Many of the XML configurations are similar, with just a few fields that are different. I often delete VM configurations and add new ones. When adding these changes to the repo, ... | Renames are only something shown in the output, internally they are stored just as regular deletions and creations.
If you want to disable the renames detection, you can use the `--no-renames` option:
```
git log --stat --no-renames
```
(also works with `git diff`, `git show`, etc.)
If you don't want to add this op... |
11377827 | Executing git commands on a bare repository | 8 | 2012-07-07 19:02:32 | <p>On my server, I host some bare git repositories that I'm working on. I'd like to display some basic statistics about each repository on my website; for now, let's just say I want to do simple stuff like listing all the files in the repository. On a non-bare git repository, this can be done with</p>
<pre><code>git... | 5,278 | 1,506,795 | 2014-09-30 13:28:25 | 11,381,436 | 14 | 2012-07-08 07:27:35 | 490,930 | 2012-07-08 07:27:35 | https://stackoverflow.com/q/11377827 | https://stackoverflow.com/a/11381436 | <p>You can run this one:</p>
<pre><code>git ls-tree -r HEAD --name-only
</code></pre>
<p>Obviously you have to specify a branch or reference, because there is no working tree or index in a bare repository.</p>
<p>I don't know for other commands but you can actually do most of them in a bare repository, but those tha... | <p>You can run this one:</p> <pre><code>git ls-tree -r HEAD --name-only </code></pre> <p>Obviously you have to specify a branch or reference, because there is no working tree or index in a bare repository.</p> <p>I don't know for other commands but you can actually do most of them in a bare repository, but those tha... | 119, 64465 | git, git-bare | <h1>Executing git commands on a bare repository</h1>
<p>On my server, I host some bare git repositories that I'm working on. I'd like to display some basic statistics about each repository on my website; for now, let's just say I want to do simple stuff like listing all the files in the repository. On a non-bare git ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,407 | git | # Executing git commands on a bare repository
On my server, I host some bare git repositories that I'm working on. I'd like to display some basic statistics about each repository on my website; for now, let's just say I want to do simple stuff like listing all the files in the repository. On a non-bare git repository,... | You can run this one:
```
git ls-tree -r HEAD --name-only
```
Obviously you have to specify a branch or reference, because there is no working tree or index in a bare repository.
I don't know for other commands but you can actually do most of them in a bare repository, but those that require a working tree. |
9125156 | Git alias to delete remote branch | 8 | 2012-02-03 07:31:28 | <p>I am trying to make an alias to delete a remote branch but I can't seem to get it, here is my latest attempt that I really expected to work but no luck.</p>
<pre><code>rmrb = !git push origin :$1
</code></pre>
<p>I also tried, <code>rmrb = branch -r -d</code> but this doesn't do the same thing as <code>git push or... | 1,060 | 239,380 | 2012-02-03 08:10:04 | 9,125,538 | 14 | 2012-02-03 08:10:04 | 526,535 | 2012-02-03 08:10:04 | https://stackoverflow.com/q/9125156 | https://stackoverflow.com/a/9125538 | <p>You just have to define it like this:</p>
<pre><code>[alias]
rmrb = "push --delete origin"
</code></pre>
<p>And do <code>git rmrb mybranch</code></p>
| <p>You just have to define it like this:</p> <pre><code>[alias] rmrb = "push --delete origin" </code></pre> <p>And do <code>git rmrb mybranch</code></p> | 119, 1448 | alias, git | <h1>Git alias to delete remote branch</h1>
<p>I am trying to make an alias to delete a remote branch but I can't seem to get it, here is my latest attempt that I really expected to work but no luck.</p>
<pre><code>rmrb = !git push origin :$1
</code></pre>
<p>I also tried, <code>rmrb = branch -r -d</code> but this doe... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,409 | git | # Git alias to delete remote branch
I am trying to make an alias to delete a remote branch but I can't seem to get it, here is my latest attempt that I really expected to work but no luck.
```
rmrb = !git push origin :$1
```
I also tried, `rmrb = branch -r -d` but this doesn't do the same thing as `git push origin :... | You just have to define it like this:
```
[alias]
rmrb = "push --delete origin"
```
And do `git rmrb mybranch` |
7891736 | How to join all markers with paths in Google Maps? | 8 | 2011-10-25 15:31:31 | <p>I'm new to Google Maps (API) and I need to get the following result:</p>
<p><img src="https://i.sstatic.net/4IrLU.jpg" alt="paths"></p>
<p>At the moment, I know how to render the map and place markers on it (based on longitude and latitude).</p>
<pre><code>var map;
map = new google.maps.Map(document.getElementBy... | 14,471 | 458,610 | 2016-09-21 06:28:31 | 7,891,971 | 14 | 2011-10-25 15:47:08 | 352,796 | 2011-10-25 15:52:13 | https://stackoverflow.com/q/7891736 | https://stackoverflow.com/a/7891971 | <p>An example from <a href="http://code.google.com/apis/maps/documentation/javascript/overlays.html#Polylines" rel="noreferrer">Google's tutorial</a>:</p>
<pre><code> var flightPlanCoordinates = [
new google.maps.LatLng(37.772323, -122.214897),
new google.maps.LatLng(21.291982, -157.821856),
new google.ma... | <p>An example from <a href="http://code.google.com/apis/maps/documentation/javascript/overlays.html#Polylines" rel="noreferrer">Google's tutorial</a>:</p> <pre><code> var flightPlanCoordinates = [ new google.maps.LatLng(37.772323, -122.214897), new google.maps.LatLng(21.291982, -157.821856), new google.ma... | 3, 218, 1819, 6268, 20301 | directory, google-maps, javascript, latitude-longitude, path | <h1>How to join all markers with paths in Google Maps?</h1>
<p>I'm new to Google Maps (API) and I need to get the following result:</p>
<p><img src="https://i.sstatic.net/4IrLU.jpg" alt="paths"></p>
<p>At the moment, I know how to render the map and place markers on it (based on longitude and latitude).</p>
<pre><co... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,411 | git | # How to join all markers with paths in Google Maps?
I'm new to Google Maps (API) and I need to get the following result:

At the moment, I know how to render the map and place markers on it (based on longitude and latitude).
```
var map;
map = new google.maps.Map(document.... | An example from [Google's tutorial](http://code.google.com/apis/maps/documentation/javascript/overlays.html#Polylines):
```
var flightPlanCoordinates = [
new google.maps.LatLng(37.772323, -122.214897),
new google.maps.LatLng(21.291982, -157.821856),
new google.maps.LatLng(-18.142599, 178.431),
new go... |
6359143 | make Git repository global writable | 8 | 2011-06-15 14:16:13 | <p>We have 3 people using a shared Git repo. We don't have sudo permission to create/change the group. Since the machine is safe, we were asked to make the Git global writable(<code>chmod +R o+rw *</code>). However we get this error from time to time.</p>
<p><code>error: insufficient permission for adding an object to... | 8,757 | 397,390 | 2011-06-15 14:47:06 | 6,359,621 | 14 | 2011-06-15 14:47:06 | 263,871 | 2011-06-15 14:47:06 | https://stackoverflow.com/q/6359143 | https://stackoverflow.com/a/6359621 | <p>We just came across the same issue. Here's how we've tackled it, in addition to running
<code>git repo-config core.sharedRepository true</code>.</p>
<p>Note: this was on an Ubuntu Linux server - you may need different commands on your OS but the approach should be broadly similar. Note that many of these commands ... | <p>We just came across the same issue. Here's how we've tackled it, in addition to running <code>git repo-config core.sharedRepository true</code>.</p> <p>Note: this was on an Ubuntu Linux server - you may need different commands on your OS but the approach should be broadly similar. Note that many of these commands ... | 99, 119, 359 | filesystems, git, permissions | <h1>make Git repository global writable</h1>
<p>We have 3 people using a shared Git repo. We don't have sudo permission to create/change the group. Since the machine is safe, we were asked to make the Git global writable(<code>chmod +R o+rw *</code>). However we get this error from time to time.</p>
<p><code>error: in... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,412 | git | # make Git repository global writable
We have 3 people using a shared Git repo. We don't have sudo permission to create/change the group. Since the machine is safe, we were asked to make the Git global writable(`chmod +R o+rw *`). However we get this error from time to time.
`error: insufficient permission for adding... | We just came across the same issue. Here's how we've tackled it, in addition to running
`git repo-config core.sharedRepository true`.
Note: this was on an Ubuntu Linux server - you may need different commands on your OS but the approach should be broadly similar. Note that many of these commands will need to be run as... |
4917472 | Add new local directory to a git remote branch | 8 | 2011-02-07 01:31:29 | <p>I have a directory on my PC I'd like to add to a particular branch in a remote git repo on my server. I have git, the branch was created fresh off the master from the server, but I've got an entire project with which I would like to use git.</p>
<p>What is the best way to go about this?</p>
| 17,277 | 476,382 | 2017-09-06 12:45:18 | 4,918,100 | 14 | 2011-02-07 04:39:20 | 2,774 | 2011-02-07 04:39:20 | https://stackoverflow.com/q/4917472 | https://stackoverflow.com/a/4918100 | <p>Clone the remote repository on to your PC. </p>
<p><code>git clone user@example.com:myproject.git</code></p>
<p>Checkout the branch to which you would like to add those files. </p>
<p><code>cd myproject</code></p>
<p><code>git checkout -b my_new_branch</code></p>
<p>Move the files into your project directory, t... | <p>Clone the remote repository on to your PC. </p> <p><code>git clone user@example.com:myproject.git</code></p> <p>Checkout the branch to which you would like to add those files. </p> <p><code>cd myproject</code></p> <p><code>git checkout -b my_new_branch</code></p> <p>Move the files into your project directory, t... | 119 | git | <h1>Add new local directory to a git remote branch</h1>
<p>I have a directory on my PC I'd like to add to a particular branch in a remote git repo on my server. I have git, the branch was created fresh off the master from the server, but I've got an entire project with which I would like to use git.</p>
<p>What is the... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,414 | git | # Add new local directory to a git remote branch
I have a directory on my PC I'd like to add to a particular branch in a remote git repo on my server. I have git, the branch was created fresh off the master from the server, but I've got an entire project with which I would like to use git.
What is the best way to go ... | Clone the remote repository on to your PC.
`git clone user@example.com:myproject.git`
Checkout the branch to which you would like to add those files.
`cd myproject`
`git checkout -b my_new_branch`
Move the files into your project directory, then add & commit them.
`git add .`
`git commit -m "new files for my new... |
3603534 | Ignoring files already in a repo WITHOUT deleting them | 8 | 2010-08-30 19:25:12 | <p>Let's say I have a <code>.noise</code> file in the root of my repository. This file is frequently modified and committed to the remote repo by others on my team. </p>
<p>I want to completely ignore this file while I'm committing anything myself, but I still want to pull in the changes from the others, and I don't w... | 1,054 | 66,584 | 2010-08-30 22:07:47 | 3,604,598 | 14 | 2010-08-30 22:07:47 | 28,804 | 2010-08-30 22:07:47 | https://stackoverflow.com/q/3603534 | https://stackoverflow.com/a/3604598 | <p>You can use:</p>
<pre><code>$ git update-index --assume-unchanged -- .noise
</code></pre>
<p><code>update-index --assume-unchanged</code> will make Git continue to track the file, but <em>your</em> changes won't be reflected in the index or added to the repo.</p>
| <p>You can use:</p> <pre><code>$ git update-index --assume-unchanged -- .noise </code></pre> <p><code>update-index --assume-unchanged</code> will make Git continue to track the file, but <em>your</em> changes won't be reflected in the index or added to the repo.</p> | 119 | git | <h1>Ignoring files already in a repo WITHOUT deleting them</h1>
<p>Let's say I have a <code>.noise</code> file in the root of my repository. This file is frequently modified and committed to the remote repo by others on my team. </p>
<p>I want to completely ignore this file while I'm committing anything myself, but I ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,415 | git | # Ignoring files already in a repo WITHOUT deleting them
Let's say I have a `.noise` file in the root of my repository. This file is frequently modified and committed to the remote repo by others on my team.
I want to completely ignore this file while I'm committing anything myself, but I still want to pull in the ch... | You can use:
```
$ git update-index --assume-unchanged -- .noise
```
`update-index --assume-unchanged` will make Git continue to track the file, but *your* changes won't be reflected in the index or added to the repo. |
2083807 | Using git-shell and restricting developers to commit to their own projects | 8 | 2010-01-18 03:52:50 | <p>We are using <code>git-shell</code> to ensure that the git account is only used for git operations. This works great.</p>
<p>However before we move to using git full time, how do we set it up similar to github whereby depending on your public key you may only commit to your own repositories?</p>
<p>As far as I can... | 5,340 | 150,172 | 2013-04-26 06:24:14 | 2,089,298 | 14 | 2010-01-18 21:20:14 | null | 2013-04-26 06:16:35 | https://stackoverflow.com/q/2083807 | https://stackoverflow.com/a/2089298 | <p>I use something a bit simpler, all you need is to setup three files, the <code>authorized_keys</code> file, the <code>gitsecurity.rb</code> file and a permissions file <code>gitpermissions</code>. For simplicity they can all go in the git accounts .ssh folder. (Basic unix admin skills required to understand herein)<... | <p>I use something a bit simpler, all you need is to setup three files, the <code>authorized_keys</code> file, the <code>gitsecurity.rb</code> file and a permissions file <code>gitpermissions</code>. For simplicity they can all go in the git accounts .ssh folder. (Basic unix admin skills required to understand herein)<... | 119 | git | <h1>Using git-shell and restricting developers to commit to their own projects</h1>
<p>We are using <code>git-shell</code> to ensure that the git account is only used for git operations. This works great.</p>
<p>However before we move to using git full time, how do we set it up similar to github whereby depending on y... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 22,416 | git | # Using git-shell and restricting developers to commit to their own projects
We are using `git-shell` to ensure that the git account is only used for git operations. This works great.
However before we move to using git full time, how do we set it up similar to github whereby depending on your public key you may only... | I use something a bit simpler, all you need is to setup three files, the `authorized_keys` file, the `gitsecurity.rb` file and a permissions file `gitpermissions`. For simplicity they can all go in the git accounts .ssh folder. (Basic unix admin skills required to understand herein)
The `gitpermissions` file looks lik... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.