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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
16490873 | How to avoid git conflicts in a team? | 57 | 2013-05-10 21:10:06 | <p>We are some developers who work on same project and we use git for the project. If two or more of us happen to work on same file, we receive git conflicts which are hard to deal with, sometimes changes done by one developer are lost when these conflicts happen.</p>
<p>How do they work with git in a team? What shoul... | 30,514 | 1,806,275 | 2018-11-07 12:37:43 | 16,493,578 | 65 | 2013-05-11 03:55:24 | 877,115 | 2013-05-11 13:09:06 | https://stackoverflow.com/q/16490873 | https://stackoverflow.com/a/16493578 | <p>Before you dig deep into your workflow, before you spend a moment of time or a dollar of money rebuilding your communication processes, ask your team three questions:</p>
<ol>
<li>Do we enforce whitespace conventions?</li>
<li>If we use IDEs, do they all use the same formatting and keyword settings? For example, Ec... | <p>Before you dig deep into your workflow, before you spend a moment of time or a dollar of money rebuilding your communication processes, ask your team three questions:</p> <ol> <li>Do we enforce whitespace conventions?</li> <li>If we use IDEs, do they all use the same formatting and keyword settings? For example, Ec... | 119, 456, 62599 | git, merge-conflict-resolution, version-control | <h1>How to avoid git conflicts in a team?</h1>
<p>We are some developers who work on same project and we use git for the project. If two or more of us happen to work on same file, we receive git conflicts which are hard to deal with, sometimes changes done by one developer are lost when these conflicts happen.</p>
<p>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,798 | git | # How to avoid git conflicts in a team?
We are some developers who work on same project and we use git for the project. If two or more of us happen to work on same file, we receive git conflicts which are hard to deal with, sometimes changes done by one developer are lost when these conflicts happen.
How do they work... | Before you dig deep into your workflow, before you spend a moment of time or a dollar of money rebuilding your communication processes, ask your team three questions:
1. Do we enforce whitespace conventions?
2. If we use IDEs, do they all use the same formatting and keyword settings? For example, Eclipse can automatic... |
15314760 | Managing SSH keys within Jenkins for Git | 55 | 2013-03-09 19:11:01 | <p>I'm trying to get Jenkins up and running with a GitHub hosted repository (using the Jenkins Git plugin). The repository has multiple git submodules, so I'm not sure I want to try and manage multiple deploy keys.</p>
<p>My personal GitHub user account is a collaborator of each of the projects I wish to pull in with ... | 143,820 | 1,240,134 | 2017-09-22 16:29:13 | 15,314,924 | 65 | 2013-03-09 19:27:43 | 380,757 | 2013-03-09 21:39:14 | https://stackoverflow.com/q/15314760 | https://stackoverflow.com/a/15314924 | <p>It looks like the <code>github.com</code> host which jenkins tries to connect to is not listed under the Jenkins user's <code>$HOME/.ssh/known_hosts</code>. Jenkins runs on most distros as the user <code>jenkins</code> and hence has its own <code>.ssh</code> directory to store the list of public keys and <code>known... | <p>It looks like the <code>github.com</code> host which jenkins tries to connect to is not listed under the Jenkins user's <code>$HOME/.ssh/known_hosts</code>. Jenkins runs on most distros as the user <code>jenkins</code> and hence has its own <code>.ssh</code> directory to store the list of public keys and <code>known... | 119, 386, 1066, 64999 | continuous-integration, git, jenkins, ssh | <h1>Managing SSH keys within Jenkins for Git</h1>
<p>I'm trying to get Jenkins up and running with a GitHub hosted repository (using the Jenkins Git plugin). The repository has multiple git submodules, so I'm not sure I want to try and manage multiple deploy keys.</p>
<p>My personal GitHub user account is a collaborat... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,799 | git | # Managing SSH keys within Jenkins for Git
I'm trying to get Jenkins up and running with a GitHub hosted repository (using the Jenkins Git plugin). The repository has multiple git submodules, so I'm not sure I want to try and manage multiple deploy keys.
My personal GitHub user account is a collaborator of each of th... | It looks like the `github.com` host which jenkins tries to connect to is not listed under the Jenkins user's `$HOME/.ssh/known_hosts`. Jenkins runs on most distros as the user `jenkins` and hence has its own `.ssh` directory to store the list of public keys and `known_hosts`.
The easiest solution I can think of to fix... |
4010962 | How do I synchronize two branches in the same Git repository? | 53 | 2010-10-24 23:13:58 | <p>Here's a common workflow hurdle I encounter often:</p>
<h2><em>master</em> is our "stable" branch</h2>
<pre><code>$ git status
# On branch master
nothing to commit (working directory clean)
</code></pre>
<h2>Create a module on a branch</h2>
<pre><code>$ git checkout -b foo
$ echo "hello" > world
$ git add .
$... | 83,340 | 184,600 | 2022-03-30 12:09:44 | 4,010,971 | 65 | 2010-10-24 23:16:39 | 66,229 | 2011-06-10 03:39:23 | https://stackoverflow.com/q/4010962 | https://stackoverflow.com/a/4010971 | <p><strong>If you don't need the branch around:</strong></p>
<p>If you've merged foo back to master, "git branch -d foo" to kill the topic branch, and then "checkout -b foo" in the future when you need to hack on it again.</p>
<p><strong>If you do need the branch around:</strong></p>
<p>You can rebase your topic bra... | <p><strong>If you don't need the branch around:</strong></p> <p>If you've merged foo back to master, "git branch -d foo" to kill the topic branch, and then "checkout -b foo" in the future when you need to hack on it again.</p> <p><strong>If you do need the branch around:</strong></p> <p>You can rebase your topic bra... | 119, 758, 29934, 76220 | git, git-branch, git-rebase, workflow | <h1>How do I synchronize two branches in the same Git repository?</h1>
<p>Here's a common workflow hurdle I encounter often:</p>
<h2><em>master</em> is our "stable" branch</h2>
<pre><code>$ git status
# On branch master
nothing to commit (working directory clean)
</code></pre>
<h2>Create a module on a branch</h2>
<... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,800 | git | # How do I synchronize two branches in the same Git repository?
Here's a common workflow hurdle I encounter often:
## *master* is our "stable" branch
```
$ git status
# On branch master
nothing to commit (working directory clean)
```
## Create a module on a branch
```
$ git checkout -b foo
$ echo "hello" > world
$... | **If you don't need the branch around:**
If you've merged foo back to master, "git branch -d foo" to kill the topic branch, and then "checkout -b foo" in the future when you need to hack on it again.
**If you do need the branch around:**
You can rebase your topic branch against the master branch:
```
git checkout f... |
3564598 | Remove a file from the list that will be committed | 52 | 2010-08-25 09:47:39 | <p>I have a list of changed files in git repository. There is one file I don't wanna commit for the current moment. Can I do:</p>
<pre><code>git commit -a
</code></pre>
<p>To commit all files and then somehow remove that file from current commit? After such removing it should still be in the list of uncommited files.... | 143,048 | 87,152 | 2024-05-10 14:01:15 | 3,565,962 | 65 | 2010-08-25 12:50:55 | 119,963 | 2010-08-25 12:50:55 | https://stackoverflow.com/q/3564598 | https://stackoverflow.com/a/3565962 | <p>You want to do this:</p>
<pre><code>git add -u
git reset HEAD path/to/file
git commit
</code></pre>
<p>Be sure and do this from the top level of the repo; <code>add -u</code> adds changes in the current directory (recursively).</p>
<p>The key line tells git to reset the version of the given path in the index (the... | <p>You want to do this:</p> <pre><code>git add -u git reset HEAD path/to/file git commit </code></pre> <p>Be sure and do this from the top level of the repo; <code>add -u</code> adds changes in the current directory (recursively).</p> <p>The key line tells git to reset the version of the given path in the index (the... | 119, 5310, 5597 | commit, file, git | <h1>Remove a file from the list that will be committed</h1>
<p>I have a list of changed files in git repository. There is one file I don't wanna commit for the current moment. Can I do:</p>
<pre><code>git commit -a
</code></pre>
<p>To commit all files and then somehow remove that file from current commit? After such ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,801 | git | # Remove a file from the list that will be committed
I have a list of changed files in git repository. There is one file I don't wanna commit for the current moment. Can I do:
```
git commit -a
```
To commit all files and then somehow remove that file from current commit? After such removing it should still be in th... | You want to do this:
```
git add -u
git reset HEAD path/to/file
git commit
```
Be sure and do this from the top level of the repo; `add -u` adds changes in the current directory (recursively).
The key line tells git to reset the version of the given path in the index (the staging area for the commit) to the version ... |
69619604 | Visual Studio Code: Review Merge Changes Side by Side, rather than top down | 49 | 2021-10-18 16:37:31 | <p>Is there any way to compare file changes in Visual Studio Code Side By Side, rather than top down? Regular Visual Studio Enterprise has this option.</p>
<p>This is during git merge conflict resolution.</p>
<p><a href="https://i.sstatic.net/HRfye.png" rel="noreferrer"><img src="https://i.sstatic.net/HRfye.png" alt="... | 39,180 | 15,435,022 | 2022-08-31 13:03:56 | 69,626,228 | 65 | 2021-10-19 06:51:06 | 6,309 | 2022-08-31 13:03:56 | https://stackoverflow.com/q/69619604 | https://stackoverflow.com/a/69626228 | <p>2022: update for <a href="https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_69.md#3-way-merge-editor" rel="noreferrer">VSCode 1.69 (June 2022)</a>, as noted in <a href="https://stackoverflow.com/users/10158227/audwin-oyong">Audwin Oyong</a>'s <a href="https://stackoverflow.com/a/72995431/6309">ans... | <p>2022: update for <a href="https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_69.md#3-way-merge-editor" rel="noreferrer">VSCode 1.69 (June 2022)</a>, as noted in <a href="https://stackoverflow.com/users/10158227/audwin-oyong">Audwin Oyong</a>'s <a href="https://stackoverflow.com/a/72995431/6309">ans... | 119, 111608, 152352 | git, visual-studio-code, vscode-git | <h1>Visual Studio Code: Review Merge Changes Side by Side, rather than top down</h1>
<p>Is there any way to compare file changes in Visual Studio Code Side By Side, rather than top down? Regular Visual Studio Enterprise has this option.</p>
<p>This is during git merge conflict resolution.</p>
<p><a href="https://i.sst... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,802 | git | # Visual Studio Code: Review Merge Changes Side by Side, rather than top down
Is there any way to compare file changes in Visual Studio Code Side By Side, rather than top down? Regular Visual Studio Enterprise has this option.
This is during git merge conflict resolution.
[](https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_69.md#3-way-merge-editor), as noted in [Audwin Oyong](https://stackoverflow.com/users/10158227/audwin-oyong)'s [answer](https://stackoverflow.com/a/72995431/6309), there is now a 3-way merge view, which allow... |
33592008 | git log/show etc. replaces the terminal screen | 49 | 2015-11-08 08:18:59 | <p>I recently started to use <code>zsh</code> (oh-my-zsh, without customizations) on iTerm2. But, I'm having a trouble in <code>git log</code> or <code>git show</code>.</p>
<p>Previously, for example, the <code>git log</code> results were just a part of the terminal, just like <code>ls -l</code> result. After quitting... | 7,409 | 614,702 | 2020-06-11 09:34:22 | 33,592,270 | 65 | 2015-11-08 08:57:15 | 6,309 | 2015-11-08 08:57:15 | https://stackoverflow.com/q/33592008 | https://stackoverflow.com/a/33592270 | <p>Can you try with:</p>
<pre><code>git config --global --replace-all core.pager "less -F -X"
</code></pre>
<p>From "How do I prevent git diff from using a pager?":</p>
<blockquote>
<p>passing the <code>-F</code> option to less causes it to quit if the content is less than one screen, <strong>however after doing s... | <p>Can you try with:</p> <pre><code>git config --global --replace-all core.pager "less -F -X" </code></pre> <p>From "How do I prevent git diff from using a pager?":</p> <blockquote> <p>passing the <code>-F</code> option to less causes it to quit if the content is less than one screen, <strong>however after doing s... | 119, 391, 47913, 93854 | git, git-log, oh-my-zsh, terminal | <h1>git log/show etc. replaces the terminal screen</h1>
<p>I recently started to use <code>zsh</code> (oh-my-zsh, without customizations) on iTerm2. But, I'm having a trouble in <code>git log</code> or <code>git show</code>.</p>
<p>Previously, for example, the <code>git log</code> results were just a part of the termi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,803 | git | # git log/show etc. replaces the terminal screen
I recently started to use `zsh` (oh-my-zsh, without customizations) on iTerm2. But, I'm having a trouble in `git log` or `git show`.
Previously, for example, the `git log` results were just a part of the terminal, just like `ls -l` result. After quitting `git log` by p... | Can you try with:
```
git config --global --replace-all core.pager "less -F -X"
```
From "How do I prevent git diff from using a pager?":
> passing the `-F` option to less causes it to quit if the content is less than one screen, **however after doing so the screen is reset and you end up not seeing the content**, t... |
27749193 | How to build Docker Images with Dockerfile behind HTTP_PROXY by Jenkins? | 48 | 2015-01-02 22:08:43 | <p>Building Docker images works in a desktop without a problem. Installing Node.js NPM dependencies work as usual. However, when using a continuous integration server such as Jenkins that is hosted behind a corporate proxy, the build Docker Images fail.</p>
<h2>Node.js NPM Dependencies</h2>
<p>While building Node.js ... | 113,047 | 433,814 | 2023-01-12 12:47:14 | 31,987,595 | 65 | 2015-08-13 11:58:42 | 6,309 | 2015-08-13 11:58:42 | https://stackoverflow.com/q/27749193 | https://stackoverflow.com/a/31987595 | <p>Note: Docker 1.9 <em>might</em> help solve this:</p>
<ul>
<li>"<a href="https://github.com/docker/docker/issues/14634">Issue 14634</a>": <strong>Builder - Build-time argument passing</strong> (e.g., <code>HTTP_PROXY</code>)</li>
<li>"<a href="https://github.com/docker/docker/pull/15182">PR 15182</a>": <strong>Suppo... | <p>Note: Docker 1.9 <em>might</em> help solve this:</p> <ul> <li>"<a href="https://github.com/docker/docker/issues/14634">Issue 14634</a>": <strong>Builder - Build-time argument passing</strong> (e.g., <code>HTTP_PROXY</code>)</li> <li>"<a href="https://github.com/docker/docker/pull/15182">PR 15182</a>": <strong>Suppo... | 119, 41127, 61387, 90304, 108477 | docker, dockerfile, git, maven, npm | <h1>How to build Docker Images with Dockerfile behind HTTP_PROXY by Jenkins?</h1>
<p>Building Docker images works in a desktop without a problem. Installing Node.js NPM dependencies work as usual. However, when using a continuous integration server such as Jenkins that is hosted behind a corporate proxy, the build Dock... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,804 | git | # How to build Docker Images with Dockerfile behind HTTP_PROXY by Jenkins?
Building Docker images works in a desktop without a problem. Installing Node.js NPM dependencies work as usual. However, when using a continuous integration server such as Jenkins that is hosted behind a corporate proxy, the build Docker Images... | Note: Docker 1.9 *might* help solve this:
- "[Issue 14634](https://github.com/docker/docker/issues/14634)": **Builder - Build-time argument passing** (e.g., `HTTP_PROXY`)
- "[PR 15182](https://github.com/docker/docker/pull/15182)": **Support for passing build-time variables in build context**
Usage (proposed):
```
d... |
49325617 | How can I ignore a whole git repository in Visual Studio Code? | 47 | 2018-03-16 16:35:43 | <p>It’s not about using .gitignore to ignore certain files, it’s about completely excluding that particular repository from file watcher of VS Code.</p>
<p>It complains that there’s more than 5000 files are opened and then just hanged my laptop. This repository has insane amount of files, and it’s located in my home fo... | 20,893 | 310,662 | 2023-09-15 14:48:05 | 52,344,801 | 65 | 2018-09-15 12:44:00 | 3,940,740 | 2020-03-12 22:44:43 | https://stackoverflow.com/q/49325617 | https://stackoverflow.com/a/52344801 | <p>Had the same problem, try adding option: </p>
<p><code>"git.autoRepositoryDetection": false</code></p>
<p>and close repo from your parent (home) folder. It shouldn't appear again.</p>
<p>Update:</p>
<p>There's now an option to watch only repositories for opened files:
<code>"git.autoRepositoryDetection": "openEd... | <p>Had the same problem, try adding option: </p> <p><code>"git.autoRepositoryDetection": false</code></p> <p>and close repo from your parent (home) folder. It shouldn't appear again.</p> <p>Update:</p> <p>There's now an option to watch only repositories for opened files: <code>"git.autoRepositoryDetection": "openEd... | 119, 111608 | git, visual-studio-code | <h1>How can I ignore a whole git repository in Visual Studio Code?</h1>
<p>It’s not about using .gitignore to ignore certain files, it’s about completely excluding that particular repository from file watcher of VS Code.</p>
<p>It complains that there’s more than 5000 files are opened and then just hanged my laptop. Th... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,805 | git | # How can I ignore a whole git repository in Visual Studio Code?
It’s not about using .gitignore to ignore certain files, it’s about completely excluding that particular repository from file watcher of VS Code.
It complains that there’s more than 5000 files are opened and then just hanged my laptop. This repository h... | Had the same problem, try adding option:
`"git.autoRepositoryDetection": false`
and close repo from your parent (home) folder. It shouldn't appear again.
Update:
There's now an option to watch only repositories for opened files:
`"git.autoRepositoryDetection": "openEditors"`
This way, if you open any file in a spe... |
2756747 | Mirror a git repository by pulling? | 46 | 2010-05-03 07:43:49 | <p>I am wondering if there is an easy way, ie like a simple cron job, to regularly <em>pull</em> from a remote git repository to a local read only mirror for backup purposes?</p>
<p>Ideally it would pull all branches and tags, but the master/trunk/head would be sufficient.</p>
<p>I just need a way to make sure that i... | 24,632 | 150,172 | 2015-03-16 09:14:32 | 2,756,894 | 65 | 2010-05-03 08:28:43 | 152,400 | 2015-03-16 09:14:32 | https://stackoverflow.com/q/2756747 | https://stackoverflow.com/a/2756894 | <p>First create a mirror with </p>
<pre><code>git clone --mirror git@somewhere.com:repo.git
</code></pre>
<p>then setup a cron job like this:</p>
<pre><code>*/1 * * * * gitbackup cd /backup/repo.git && git fetch -q --tags
</code></pre>
<p>This will backup the changesets every minute. Maybe you want to do th... | <p>First create a mirror with </p> <pre><code>git clone --mirror git@somewhere.com:repo.git </code></pre> <p>then setup a cron job like this:</p> <pre><code>*/1 * * * * gitbackup cd /backup/repo.git && git fetch -q --tags </code></pre> <p>This will backup the changesets every minute. Maybe you want to do th... | 119, 7620 | git, mirror | <h1>Mirror a git repository by pulling?</h1>
<p>I am wondering if there is an easy way, ie like a simple cron job, to regularly <em>pull</em> from a remote git repository to a local read only mirror for backup purposes?</p>
<p>Ideally it would pull all branches and tags, but the master/trunk/head would be sufficient.<... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,807 | git | # Mirror a git repository by pulling?
I am wondering if there is an easy way, ie like a simple cron job, to regularly *pull* from a remote git repository to a local read only mirror for backup purposes?
Ideally it would pull all branches and tags, but the master/trunk/head would be sufficient.
I just need a way to m... | First create a mirror with
```
git clone --mirror git@somewhere.com:repo.git
```
then setup a cron job like this:
```
*/1 * * * * gitbackup cd /backup/repo.git && git fetch -q --tags
```
This will backup the changesets every minute. Maybe you want to do this less frequently. |
5734722 | Git: Compare All Local Commits to Remote Repo Version | 44 | 2011-04-20 18:10:50 | <p>I'm somewhat new to Git and what I'm trying to do seems like it should be possible. Basically I've been working off of clone of a repo and have made quite a few local commits. Is there a way to see the diff of the 'sum' of all my changes and the original repo version? I would assume this would be possible because Gi... | 62,661 | 91,866 | 2025-05-14 10:35:25 | 5,735,193 | 65 | 2011-04-20 18:53:19 | 526,535 | 2011-09-23 15:14:29 | https://stackoverflow.com/q/5734722 | https://stackoverflow.com/a/5735193 | <p>There are three ways ( two others from other answers given here )</p>
<pre><code>1) git diff origin/master master
2) git diff origin/master..master
3) git diff origin/master...master
</code></pre>
<p>First one and second one are same and show changes between the tips of the master and remote master.</p>
<p>Third ... | <p>There are three ways ( two others from other answers given here )</p> <pre><code>1) git diff origin/master master 2) git diff origin/master..master 3) git diff origin/master...master </code></pre> <p>First one and second one are same and show changes between the tips of the master and remote master.</p> <p>Third ... | 119, 606, 2936, 6951, 30785 | compare, diff, git, gitk, status | <h1>Git: Compare All Local Commits to Remote Repo Version</h1>
<p>I'm somewhat new to Git and what I'm trying to do seems like it should be possible. Basically I've been working off of clone of a repo and have made quite a few local commits. Is there a way to see the diff of the 'sum' of all my changes and the original... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,809 | git | # Git: Compare All Local Commits to Remote Repo Version
I'm somewhat new to Git and what I'm trying to do seems like it should be possible. Basically I've been working off of clone of a repo and have made quite a few local commits. Is there a way to see the diff of the 'sum' of all my changes and the original repo ver... | There are three ways ( two others from other answers given here )
```
1) git diff origin/master master
2) git diff origin/master..master
3) git diff origin/master...master
```
First one and second one are same and show changes between the tips of the master and remote master.
Third one shows changes that occurred on... |
42479034 | How to verify integrity of a .git folder? | 41 | 2017-02-27 06:20:00 | <p>I store my git repos in GlusterFS. Due to a split-brain condition, one of the git repos are in split-brain. </p>
<p>Now, is there a command that I can run on the storage boxes to see if any of the data bricks are valid git repos? </p>
<p>Meaning all the object files and other data for a git repos are intact?</p>
| 23,364 | 244,009 | 2024-06-19 13:52:47 | 42,480,222 | 65 | 2017-02-27 07:43:14 | 1,755,598 | 2024-06-19 13:52:47 | https://stackoverflow.com/q/42479034 | https://stackoverflow.com/a/42480222 | <p>To verify the objects are intact you can use this command:</p>
<pre><code>git fsck
</code></pre>
<blockquote>
<p><strong><code>git-fsck</code></strong><br />
Verifies the connectivity and validity of the objects in the database</p>
</blockquote>
<p><strong>fsck</strong> - <strong>F</strong>ile <strong>S</strong>yste... | <p>To verify the objects are intact you can use this command:</p> <pre><code>git fsck </code></pre> <blockquote> <p><strong><code>git-fsck</code></strong><br /> Verifies the connectivity and validity of the objects in the database</p> </blockquote> <p><strong>fsck</strong> - <strong>F</strong>ile <strong>S</strong>yste... | 119 | git | <h1>How to verify integrity of a .git folder?</h1>
<p>I store my git repos in GlusterFS. Due to a split-brain condition, one of the git repos are in split-brain. </p>
<p>Now, is there a command that I can run on the storage boxes to see if any of the data bricks are valid git repos? </p>
<p>Meaning all the object fil... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,811 | git | # How to verify integrity of a .git folder?
I store my git repos in GlusterFS. Due to a split-brain condition, one of the git repos are in split-brain.
Now, is there a command that I can run on the storage boxes to see if any of the data bricks are valid git repos?
Meaning all the object files and other data for a g... | To verify the objects are intact you can use this command:
```
git fsck
```
> **`git-fsck`**
> Verifies the connectivity and validity of the objects in the database
**fsck** - **F**ile **S**ystem **C**hec**K**.
The name is taken from the Unix `fsck` command
<https://git-scm.com/docs/git-fsck>
---
If you want ... |
30575041 | Can't do a checkout with multiple remotes | 40 | 2015-06-01 13:37:14 | <p>I have two remotes set up in my local git repo. One is the repo of an open-source project I'm contributing to, and the other is my fork of that repo.</p>
<p>It seems that I'm only able to check out stuff that I pull down from the <code>origin</code> remote. My normal method of grabbing a branch from a remote consis... | 41,607 | 1,467,997 | 2020-10-09 15:47:26 | 30,578,803 | 65 | 2015-06-01 16:42:47 | 4,021,077 | 2015-06-01 16:42:47 | https://stackoverflow.com/q/30575041 | https://stackoverflow.com/a/30578803 | <p>When you have only a single remote (let's call it <code>origin</code>) then when you type</p>
<p><code>git checkout foo</code></p>
<p>when <code>foo</code> doesn't exist but <code>origin/foo</code> does exist git will behave as though you typed the following </p>
<p><code>git checkout -b foo origin/foo</code></p>... | <p>When you have only a single remote (let's call it <code>origin</code>) then when you type</p> <p><code>git checkout foo</code></p> <p>when <code>foo</code> doesn't exist but <code>origin/foo</code> does exist git will behave as though you typed the following </p> <p><code>git checkout -b foo origin/foo</code></p>... | 119 | git | <h1>Can't do a checkout with multiple remotes</h1>
<p>I have two remotes set up in my local git repo. One is the repo of an open-source project I'm contributing to, and the other is my fork of that repo.</p>
<p>It seems that I'm only able to check out stuff that I pull down from the <code>origin</code> remote. My norm... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,813 | git | # Can't do a checkout with multiple remotes
I have two remotes set up in my local git repo. One is the repo of an open-source project I'm contributing to, and the other is my fork of that repo.
It seems that I'm only able to check out stuff that I pull down from the `origin` remote. My normal method of grabbing a bra... | When you have only a single remote (let's call it `origin`) then when you type
`git checkout foo`
when `foo` doesn't exist but `origin/foo` does exist git will behave as though you typed the following
`git checkout -b foo origin/foo`
If you have multiple remotes, and `foo` does not exist locally but exists in 2 or ... |
18292578 | What does Git (master|REBASE 1/1) mean? How do I get rid of it? | 40 | 2013-08-17 19:31:37 | <p>I'm kind of a <a href="/questions/tagged/git" class="post-tag" title="show questions tagged 'git'" rel="tag">git</a> beginner and I was attempting to roll back to a previous commit. But I accidentally just rolled back the commit (I was using the Windows GUI). Anyway, after some weird pushing, merging, and ot... | 61,602 | 1,542,306 | 2020-11-18 07:36:53 | 18,292,656 | 65 | 2013-08-17 19:41:33 | 746,447 | 2020-04-07 14:33:14 | https://stackoverflow.com/q/18292578 | https://stackoverflow.com/a/18292656 | <p>You are stuck in the middle of a rebase. </p>
<p>If you have merged/solved conflicts for all the paths:<br>
use <code>git add .</code> to commit resolved items.<br>
use <code>git rebase --continue</code> to complete the process. </p>
<p>Or use <code>git rebase --abort</code> to exit the rebase process without an... | <p>You are stuck in the middle of a rebase. </p> <p>If you have merged/solved conflicts for all the paths:<br> use <code>git add .</code> to commit resolved items.<br> use <code>git rebase --continue</code> to complete the process. </p> <p>Or use <code>git rebase --abort</code> to exit the rebase process without an... | 119, 456, 8974, 76220 | git, git-branch, rebase, version-control | <h1>What does Git (master|REBASE 1/1) mean? How do I get rid of it?</h1>
<p>I'm kind of a <a href="/questions/tagged/git" class="post-tag" title="show questions tagged 'git'" rel="tag">git</a> beginner and I was attempting to roll back to a previous commit. But I accidentally just rolled back the commit (I was ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,814 | git | # What does Git (master|REBASE 1/1) mean? How do I get rid of it?
I'm kind of a [git](/questions/tagged/git "show questions tagged 'git'") beginner and I was attempting to roll back to a previous commit. But I accidentally just rolled back the commit (I was using the Windows GUI). Anyway, after some weird pushing, mer... | You are stuck in the middle of a rebase.
If you have merged/solved conflicts for all the paths:
use `git add .` to commit resolved items.
use `git rebase --continue` to complete the process.
Or use `git rebase --abort` to exit the rebase process without any risk. |
17673771 | Remove earlier commit but keep recent changes | 40 | 2013-07-16 10:10:17 | <p>I have some commits in my repository like:</p>
<pre><code>A - Added Feature A
B - Removed Feature B
C - Redesigned Feature C
D - Added Feature D
E - Added Feature D
</code></pre>
<p>Where E is the most recent commit I made. Now I want to get rid of the changes I made with feature C but I want to keep the changes add... | 37,365 | 2,194,736 | 2025-03-13 19:46:25 | 17,675,205 | 65 | 2013-07-16 11:22:41 | 521,832 | 2013-07-16 11:22:41 | https://stackoverflow.com/q/17673771 | https://stackoverflow.com/a/17675205 | <p><a href="http://git-scm.com/book/en/Git-Tools-Rewriting-History" rel="noreferrer">Interactive rebase</a> is your friend!</p>
<p>As others have said:</p>
<pre><code>$ git rebase -i HEAD~5
</code></pre>
<p>...where <code>-i</code> is the interactive flag, and <code>HEAD~5</code> means include the last 5 commits in ... | <p><a href="http://git-scm.com/book/en/Git-Tools-Rewriting-History" rel="noreferrer">Interactive rebase</a> is your friend!</p> <p>As others have said:</p> <pre><code>$ git rebase -i HEAD~5 </code></pre> <p>...where <code>-i</code> is the interactive flag, and <code>HEAD~5</code> means include the last 5 commits in ... | 119 | git | <h1>Remove earlier commit but keep recent changes</h1>
<p>I have some commits in my repository like:</p>
<pre><code>A - Added Feature A
B - Removed Feature B
C - Redesigned Feature C
D - Added Feature D
E - Added Feature D
</code></pre>
<p>Where E is the most recent commit I made. Now I want to get rid of the changes I... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,815 | git | # Remove earlier commit but keep recent changes
I have some commits in my repository like:
```
A - Added Feature A
B - Removed Feature B
C - Redesigned Feature C
D - Added Feature D
E - Added Feature D
```
Where E is the most recent commit I made. Now I want to get rid of the changes I made with feature C but I want... | [Interactive rebase](http://git-scm.com/book/en/Git-Tools-Rewriting-History) is your friend!
As others have said:
```
$ git rebase -i HEAD~5
```
...where `-i` is the interactive flag, and `HEAD~5` means include the last 5 commits in the interactive rebase.
When you get editor up as a result of issuing the above, ta... |
11852558 | gitignore - only allow certain extensions and files | 36 | 2012-08-07 19:14:45 | <p>I'm using the following code to ignore all files except for certain filenames and extension</p>
<pre><code>*
!.gitattributes
!.gitignore
!readme.md
!.gitkeep
!*.php
</code></pre>
<p>For some reason, its only allowing me to commit the .gitignore and readme.md, even though I have php files in subfolders etc. Is there ... | 25,488 | 1,293,874 | 2022-08-24 16:10:46 | 11,853,075 | 65 | 2012-08-07 19:52:47 | 520,162 | 2012-08-07 19:52:47 | https://stackoverflow.com/q/11852558 | https://stackoverflow.com/a/11853075 | <p>The solution is to tell Git <strong>not to ignore sub directories</strong>:</p>
<pre><code>*
!.gitattributes
!.gitignore
!readme.md
!.gitkeep
!*.php
!*/
</code></pre>
<p>Otherwise, only the <code>*.php</code> files in the first directory level will be accepted and all sub directories will be ignored.</p>
| <p>The solution is to tell Git <strong>not to ignore sub directories</strong>:</p> <pre><code>* !.gitattributes !.gitignore !readme.md !.gitkeep !*.php !*/ </code></pre> <p>Otherwise, only the <code>*.php</code> files in the first directory level will be accepted and all sub directories will be ignored.</p> | 119, 25056 | git, gitignore | <h1>gitignore - only allow certain extensions and files</h1>
<p>I'm using the following code to ignore all files except for certain filenames and extension</p>
<pre><code>*
!.gitattributes
!.gitignore
!readme.md
!.gitkeep
!*.php
</code></pre>
<p>For some reason, its only allowing me to commit the .gitignore and readme.... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,819 | git | # gitignore - only allow certain extensions and files
I'm using the following code to ignore all files except for certain filenames and extension
```
*
!.gitattributes
!.gitignore
!readme.md
!.gitkeep
!*.php
```
For some reason, its only allowing me to commit the .gitignore and readme.md, even though I have php file... | The solution is to tell Git **not to ignore sub directories**:
```
*
!.gitattributes
!.gitignore
!readme.md
!.gitkeep
!*.php
!*/
```
Otherwise, only the `*.php` files in the first directory level will be accepted and all sub directories will be ignored. |
11023753 | Function to count number of digits in string | 31 | 2012-06-13 21:44:09 | <p>I was looking for a quick PHP function that, given a string, would count the number of numerical characters (i.e. digits) in that string. I couldn't find one, is there a function to do this?</p>
| 37,104 | 196,307 | 2018-09-25 08:58:36 | 11,023,784 | 65 | 2012-06-13 21:46:20 | 238,180 | 2012-06-13 21:46:20 | https://stackoverflow.com/q/11023753 | https://stackoverflow.com/a/11023784 | <p>This can easily be accomplished with a regular expression.</p>
<pre><code>function countDigits( $str )
{
return preg_match_all( "/[0-9]/", $str );
}
</code></pre>
<p>The function will return the amount of times the pattern was found, which in this case is any digit.</p>
| <p>This can easily be accomplished with a regular expression.</p> <pre><code>function countDigits( $str ) { return preg_match_all( "/[0-9]/", $str ); } </code></pre> <p>The function will return the amount of times the pattern was found, which in this case is any digit.</p> | 5, 9548, 9914 | counting, digits, php | <h1>Function to count number of digits in string</h1>
<p>I was looking for a quick PHP function that, given a string, would count the number of numerical characters (i.e. digits) in that string. I couldn't find one, is there a function to do this?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,821 | git | # Function to count number of digits in string
I was looking for a quick PHP function that, given a string, would count the number of numerical characters (i.e. digits) in that string. I couldn't find one, is there a function to do this? | This can easily be accomplished with a regular expression.
```
function countDigits( $str )
{
return preg_match_all( "/[0-9]/", $str );
}
```
The function will return the amount of times the pattern was found, which in this case is any digit. |
11029350 | Delete broken branch in git | 28 | 2012-06-14 08:28:43 | <p>I have created branch with "git checkout -b mybranch". It seems that something went wrong, and now I can't delete it using "git branch -D mybranch". It says: error: branch 'mybranch' not found.</p>
| 15,824 | 954,883 | 2017-01-02 13:23:15 | 11,050,880 | 65 | 2012-06-15 12:44:34 | 243,245 | 2012-06-15 12:44:34 | https://stackoverflow.com/q/11029350 | https://stackoverflow.com/a/11050880 | <p>If <code>git branch -D</code> really isn't working, then your only option is to side-step it and edit the git check-out's state yourself. You should go to the root-directory of your check-out (where the <code>.git</code> directory is) and</p>
<ol>
<li>edit <code>.git/packed-refs</code>; if you see a line with your ... | <p>If <code>git branch -D</code> really isn't working, then your only option is to side-step it and edit the git check-out's state yourself. You should go to the root-directory of your check-out (where the <code>.git</code> directory is) and</p> <ol> <li>edit <code>.git/packed-refs</code>; if you see a line with your ... | 119 | git | <h1>Delete broken branch in git</h1>
<p>I have created branch with "git checkout -b mybranch". It seems that something went wrong, and now I can't delete it using "git branch -D mybranch". It says: error: branch 'mybranch' not found.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,822 | git | # Delete broken branch in git
I have created branch with "git checkout -b mybranch". It seems that something went wrong, and now I can't delete it using "git branch -D mybranch". It says: error: branch 'mybranch' not found. | If `git branch -D` really isn't working, then your only option is to side-step it and edit the git check-out's state yourself. You should go to the root-directory of your check-out (where the `.git` directory is) and
1. edit `.git/packed-refs`; if you see a line with your branch name then delete it
2. look in `.git/re... |
56788144 | How to use Git LFS with Azure Repos and Pipelines | 27 | 2019-06-27 09:36:11 | <p>I have a project using Git LFS in Azure Repos with several binary image files being checked in using Git LFS. When my Azure Pipelines build performs a <code>git pull</code>, the image files are not pulled from Git LFS and I am left with several zero byte image files.</p>
<p>I'm using a custom self-hosted Azure Pipe... | 24,750 | 1,212,017 | 2025-05-07 00:44:23 | 56,838,104 | 65 | 2019-07-01 15:10:10 | 6,067,741 | 2019-07-01 15:10:10 | https://stackoverflow.com/q/56788144 | https://stackoverflow.com/a/56838104 | <p>You have to use https for lfs to work with Azure Devops and you have to do LFS checkout when doing the builds:</p>
<pre><code>steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
lfs: true
</code></pre>
<p>if you are using a UI wizard there is a checkbox to checkout... | <p>You have to use https for lfs to work with Azure Devops and you have to do LFS checkout when doing the builds:</p> <pre><code>steps: - checkout: self # self represents the repo where the initial Pipelines YAML file was found lfs: true </code></pre> <p>if you are using a UI wizard there is a checkbox to checkout... | 119, 115244, 119596, 134848 | azure-pipelines, azure-repos, git, git-lfs | <h1>How to use Git LFS with Azure Repos and Pipelines</h1>
<p>I have a project using Git LFS in Azure Repos with several binary image files being checked in using Git LFS. When my Azure Pipelines build performs a <code>git pull</code>, the image files are not pulled from Git LFS and I am left with several zero byte ima... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,823 | git | # How to use Git LFS with Azure Repos and Pipelines
I have a project using Git LFS in Azure Repos with several binary image files being checked in using Git LFS. When my Azure Pipelines build performs a `git pull`, the image files are not pulled from Git LFS and I am left with several zero byte image files.
I'm using... | You have to use https for lfs to work with Azure Devops and you have to do LFS checkout when doing the builds:
```
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
lfs: true
```
if you are using a UI wizard there is a checkbox to checkout lfs
<https://learn.micros... |
883452 | Git interoperability with a Mercurial Repository | 206 | 2009-05-19 15:26:51 | <p>I use GIT on a Mac. Enough said. I have the tools, I have the experience. And I want to continue to use it. No wars here...</p>
<p>The problem is always with interoperability. Most people use SVN, which is great for me. Git SVN works out of the box, and is a no frills solution. People can continue happily use SVN a... | 49,615 | 41,652 | 2023-03-14 07:31:35 | 11,178,693 | 64 | 2012-06-24 15:31:43 | 272,427 | 2021-12-01 19:09:49 | https://stackoverflow.com/q/883452 | https://stackoverflow.com/a/11178693 | <p>Update from June 2012. Currently there seem to be the following methods for Git/Hg interoperability when the developer wants to work from the git side:</p>
<ol>
<li><p>Install Mercurial and the <a href="https://hg-git.github.io/" rel="nofollow noreferrer"><strong>hg-git extension</strong></a>. You can do the latter ... | <p>Update from June 2012. Currently there seem to be the following methods for Git/Hg interoperability when the developer wants to work from the git side:</p> <ol> <li><p>Install Mercurial and the <a href="https://hg-git.github.io/" rel="nofollow noreferrer"><strong>hg-git extension</strong></a>. You can do the latter ... | 119, 456, 802, 1592, 3346 | dvcs, git, interop, mercurial, version-control | <h1>Git interoperability with a Mercurial Repository</h1>
<p>I use GIT on a Mac. Enough said. I have the tools, I have the experience. And I want to continue to use it. No wars here...</p>
<p>The problem is always with interoperability. Most people use SVN, which is great for me. Git SVN works out of the box, and is a... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,826 | git | # Git interoperability with a Mercurial Repository
I use GIT on a Mac. Enough said. I have the tools, I have the experience. And I want to continue to use it. No wars here...
The problem is always with interoperability. Most people use SVN, which is great for me. Git SVN works out of the box, and is a no frills solut... | Update from June 2012. Currently there seem to be the following methods for Git/Hg interoperability when the developer wants to work from the git side:
1. Install Mercurial and the [**hg-git extension**](https://hg-git.github.io/). You can do the latter using your package manager, or with `easy_install hg-git`. Then m... |
20526355 | Is git stash branch-specific or for the whole repository? | 164 | 2013-12-11 17:48:40 | <p>I was surprised that git unstashed the stash from <code><otherbranch></code> (latest stashed) because I thought stashes were branch-specific.</p>
<p>Is <code>git stash</code> branch-specific or for the whole repository? If it is for the whole repository, can I pass options to it to make it branch-specific?</p... | 61,792 | 1,312,080 | 2025-10-07 07:39:17 | 20,526,695 | 64 | 2013-12-11 18:06:19 | 1,256,452 | 2013-12-11 18:06:19 | https://stackoverflow.com/q/20526355 | https://stackoverflow.com/a/20526695 | <p>To see the current stash stack:</p>
<pre><code>git stash list
</code></pre>
<p>To pick a specific stash from the stack, refer to it by the <code>stash@{<em>number</em>}</code> shown by the above.</p>
<p>If you want the behavior to be per-branch, you can just make a commit (or multiple commits) on the branch. You... | <p>To see the current stash stack:</p> <pre><code>git stash list </code></pre> <p>To pick a specific stash from the stack, refer to it by the <code>stash@{<em>number</em>}</code> shown by the above.</p> <p>If you want the behavior to be per-branch, you can just make a commit (or multiple commits) on the branch. You... | 119, 13091 | git, git-stash | <h1>Is git stash branch-specific or for the whole repository?</h1>
<p>I was surprised that git unstashed the stash from <code><otherbranch></code> (latest stashed) because I thought stashes were branch-specific.</p>
<p>Is <code>git stash</code> branch-specific or for the whole repository? If it is for the whole ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,827 | git | # Is git stash branch-specific or for the whole repository?
I was surprised that git unstashed the stash from `<otherbranch>` (latest stashed) because I thought stashes were branch-specific.
Is `git stash` branch-specific or for the whole repository? If it is for the whole repository, can I pass options to it to make... | To see the current stash stack:
```
git stash list
```
To pick a specific stash from the stack, refer to it by the `stash@{number}` shown by the above.
If you want the behavior to be per-branch, you can just make a commit (or multiple commits) on the branch. You can always "unmake" the commit(s) later (e.g., with `g... |
7949956 | Why does git diff on Windows warn that the "terminal is not fully functional"? | 116 | 2011-10-31 04:14:07 | <p>I'm using <strong>msysgit 1.7.7.1</strong> on Windows. I get an error when using <code>git diff</code>. What is causing this? Is there no diff tool included in msysgit? What should I do?</p>
<blockquote>
<p>WARNING: terminal is not fully functional</p>
</blockquote>
| 33,334 | 468,539 | 2015-11-25 18:09:37 | 7,950,092 | 64 | 2011-10-31 04:49:06 | 526,535 | 2014-05-16 14:11:37 | https://stackoverflow.com/q/7949956 | https://stackoverflow.com/a/7950092 | <p>For Git Bash, this can be fixed by adding the following line to ~/.bashrc:</p>
<pre><code>export TERM=cygwin
</code></pre>
<p>-or-</p>
<pre><code>export TERM=msys
</code></pre>
<p>The first seems to be the original by git for windows, the second a popular known form to "heal" as well.</p>
<p>The problem can be ... | <p>For Git Bash, this can be fixed by adding the following line to ~/.bashrc:</p> <pre><code>export TERM=cygwin </code></pre> <p>-or-</p> <pre><code>export TERM=msys </code></pre> <p>The first seems to be the original by git for windows, the second a popular known form to "heal" as well.</p> <p>The problem can be ... | 64, 119, 606, 21628 | diff, git, msysgit, windows | <h1>Why does git diff on Windows warn that the "terminal is not fully functional"?</h1>
<p>I'm using <strong>msysgit 1.7.7.1</strong> on Windows. I get an error when using <code>git diff</code>. What is causing this? Is there no diff tool included in msysgit? What should I do?</p>
<blockquote>
<p>WARNING: terminal i... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,828 | git | # Why does git diff on Windows warn that the "terminal is not fully functional"?
I'm using **msysgit 1.7.7.1** on Windows. I get an error when using `git diff`. What is causing this? Is there no diff tool included in msysgit? What should I do?
> WARNING: terminal is not fully functional | For Git Bash, this can be fixed by adding the following line to ~/.bashrc:
```
export TERM=cygwin
```
-or-
```
export TERM=msys
```
The first seems to be the original by git for windows, the second a popular known form to "heal" as well.
The problem can be caused if some other program (like for example *Strawberry... |
2961240 | Get back the changes after accidental checkout? | 91 | 2010-06-02 20:11:24 | <p>The following was the status of my repo.</p>
<pre><code>[~/rails_apps/jekyll_apps/nepalonrails (design)⚡] ➔ gst
# On branch design
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
... | 101,725 | 60,072 | 2023-06-01 11:12:36 | 2,961,348 | 64 | 2010-06-02 20:28:03 | 6,309 | 2018-12-06 20:26:50 | https://stackoverflow.com/q/2961240 | https://stackoverflow.com/a/2961348 | <p>I don't think you can recover those private data ("private" as in "not added in the index, nor committed", so unknown to git), unless you have other backup process in place for your current working directory.</p>
<p>Even if this is not proposed in the <strong><a href="https://git.wiki.kernel.org/index.php/Aliases" ... | <p>I don't think you can recover those private data ("private" as in "not added in the index, nor committed", so unknown to git), unless you have other backup process in place for your current working directory.</p> <p>Even if this is not proposed in the <strong><a href="https://git.wiki.kernel.org/index.php/Aliases" ... | 119, 37230 | git, git-checkout | <h1>Get back the changes after accidental checkout?</h1>
<p>The following was the status of my repo.</p>
<pre><code>[~/rails_apps/jekyll_apps/nepalonrails (design)⚡] ➔ gst
# On branch design
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,830 | git | # Get back the changes after accidental checkout?
The following was the status of my repo.
```
[~/rails_apps/jekyll_apps/nepalonrails (design)⚡] ➔ gst
# On branch design
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes... | I don't think you can recover those private data ("private" as in "not added in the index, nor committed", so unknown to git), unless you have other backup process in place for your current working directory.
Even if this is not proposed in the **[Git Aliases page](https://git.wiki.kernel.org/index.php/Aliases)**, I w... |
53227343 | Triggering Azure DevOps builds based on changes to sub folders | 76 | 2018-11-09 14:12:46 | <p>I have a Visual Studio solution with multiple projects, each project is an individual microservice. It is very convenient to the development team to have all the services in the same solution, and git repo, as services can call each other.</p>
<pre><code>Master.sln - SubFolderA - MicroserviceA.sln
- SubF... | 58,165 | 4,869,170 | 2022-12-07 04:42:10 | 53,229,588 | 64 | 2018-11-09 16:24:13 | 7,073,340 | 2018-11-10 05:10:20 | https://stackoverflow.com/q/53227343 | https://stackoverflow.com/a/53229588 | <p>You can do like below</p>
<ol>
<li>Create variables based on your microservices with the values "False"</li>
</ol>
<p>E.g,<code>MicroserviceAUpdated</code>= "False",<code>MicroserviceBUpdated</code>= "False" etc.,</p>
<ol start="2">
<li>Add a Powershell script task at the begin of your build definition.
The power... | <p>You can do like below</p> <ol> <li>Create variables based on your microservices with the values "False"</li> </ol> <p>E.g,<code>MicroserviceAUpdated</code>= "False",<code>MicroserviceBUpdated</code>= "False" etc.,</p> <ol start="2"> <li>Add a Powershell script task at the begin of your build definition. The power... | 119, 116537, 119596 | azure-devops, azure-pipelines, git | <h1>Triggering Azure DevOps builds based on changes to sub folders</h1>
<p>I have a Visual Studio solution with multiple projects, each project is an individual microservice. It is very convenient to the development team to have all the services in the same solution, and git repo, as services can call each other.</p>
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,831 | git | # Triggering Azure DevOps builds based on changes to sub folders
I have a Visual Studio solution with multiple projects, each project is an individual microservice. It is very convenient to the development team to have all the services in the same solution, and git repo, as services can call each other.
```
Master.sl... | You can do like below
1. Create variables based on your microservices with the values "False"
E.g,`MicroserviceAUpdated`= "False",`MicroserviceBUpdated`= "False" etc.,
2. Add a Powershell script task at the begin of your build definition.
The powershell script will do the following:
Get the changeset/commit in t... |
2141611 | A pretty and feature rich Git GUI for Linux | 71 | 2010-01-26 18:23:10 | <p>I was checking out for a <em>rich GUI</em> for Git on Linux. As of late, I have started using it a lot and find that even though command-line is very useful, I would still want a GUI at my disposal since I am not still very much aware with the advanced features.</p>
<p>I came across <a href="https://stackoverflow.co... | 58,261 | 113,606 | 2021-08-18 15:20:05 | 5,192,701 | 64 | 2011-03-04 10:45:36 | 599,884 | 2021-08-18 15:03:57 | https://stackoverflow.com/q/2141611 | https://stackoverflow.com/a/5192701 | <p>I find myself using mainly <code>gitg</code> in combination with the command line for more complicated tasks.</p>
<p>Source repository: <a href="http://git.gnome.org/browse/gitg" rel="nofollow noreferrer">http://git.gnome.org/browse/gitg</a>.</p>
<p>Recently, a new version 0.3.2 has been released, which is a rewrite... | <p>I find myself using mainly <code>gitg</code> in combination with the command line for more complicated tasks.</p> <p>Source repository: <a href="http://git.gnome.org/browse/gitg" rel="nofollow noreferrer">http://git.gnome.org/browse/gitg</a>.</p> <p>Recently, a new version 0.3.2 has been released, which is a rewrite... | 119, 865, 3346, 30785 | dvcs, git, gitk, user-interface | <h1>A pretty and feature rich Git GUI for Linux</h1>
<p>I was checking out for a <em>rich GUI</em> for Git on Linux. As of late, I have started using it a lot and find that even though command-line is very useful, I would still want a GUI at my disposal since I am not still very much aware with the advanced features.</... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,832 | git | # A pretty and feature rich Git GUI for Linux
I was checking out for a *rich GUI* for Git on Linux. As of late, I have started using it a lot and find that even though command-line is very useful, I would still want a GUI at my disposal since I am not still very much aware with the advanced features.
I came across [t... | I find myself using mainly `gitg` in combination with the command line for more complicated tasks.
Source repository: <http://git.gnome.org/browse/gitg>.
Recently, a new version 0.3.2 has been released, which is a rewrite using [Vala](https://en.wikipedia.org/wiki/Vala_(programming_language)). It's not yet feature-co... |
13292918 | How do I intentionally detach HEAD in git? | 67 | 2012-11-08 16:10:05 | <p>If I do <code>git checkout HEAD^</code>, I get this:</p>
<pre><code>$ git checkout HEAD^
Note: checking out 'HEAD^'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing ... | 35,546 | 280,043 | 2023-12-30 15:10:49 | 19,495,843 | 64 | 2013-10-21 13:26:43 | 6,309 | 2020-10-28 07:44:38 | https://stackoverflow.com/q/13292918 | https://stackoverflow.com/a/19495843 | <p>Since git 1.7.5 (April 2011), you can use the <code>git checkout --detach</code> command.<br />
(<a href="https://stackoverflow.com/a/57066202/6309">Since Git 2.23 (Q3 2019)</a>, you would use <code>git switch --detach</code>)</p>
<p>See <a href="https://github.com/git/git/commit/32669671c7746888aa1e3832907deb7fc840... | <p>Since git 1.7.5 (April 2011), you can use the <code>git checkout --detach</code> command.<br /> (<a href="https://stackoverflow.com/a/57066202/6309">Since Git 2.23 (Q3 2019)</a>, you would use <code>git switch --detach</code>)</p> <p>See <a href="https://github.com/git/git/commit/32669671c7746888aa1e3832907deb7fc840... | 119, 37230 | git, git-checkout | <h1>How do I intentionally detach HEAD in git?</h1>
<p>If I do <code>git checkout HEAD^</code>, I get this:</p>
<pre><code>$ git checkout HEAD^
Note: checking out 'HEAD^'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,833 | git | # How do I intentionally detach HEAD in git?
If I do `git checkout HEAD^`, I get this:
```
$ git checkout HEAD^
Note: checking out 'HEAD^'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any br... | Since git 1.7.5 (April 2011), you can use the `git checkout --detach` command.
([Since Git 2.23 (Q3 2019)](https://stackoverflow.com/a/57066202/6309), you would use `git switch --detach`)
See [commit 326696](https://github.com/git/git/commit/32669671c7746888aa1e3832907deb7fc8405061)
## `checkout`: introduce `--deta... |
792611 | 'receive-pack': service not enabled for './.git' | 57 | 2009-04-27 08:12:32 | <p>(Solved already, I'm writing this for the next guy)</p>
<p>I was running git daemon on one computer and tried synchronizing with another.</p>
<p>On computer A, I ran:</p>
<pre><code>git daemon --reuseaddr --base-path=. --export-all --verbose
</code></pre>
<p>On computer B, I ran:</p>
<pre><code>git clone git://... | 42,812 | 7,581 | 2014-05-31 10:44:23 | 792,621 | 64 | 2009-04-27 08:15:28 | 7,581 | 2009-07-09 06:42:30 | https://stackoverflow.com/q/792611 | https://stackoverflow.com/a/792621 | <p>Simply run</p>
<pre><code>git daemon --reuseaddr --base-path=. --export-all --verbose --enable=receive-pack
</code></pre>
<p>(on computer A, instead of the original <code>git daemon</code> command), and the push works.</p>
<p>Note that you have to then run</p>
<pre><code>git reset --hard
</code></pre>
<p>on computer... | <p>Simply run</p> <pre><code>git daemon --reuseaddr --base-path=. --export-all --verbose --enable=receive-pack </code></pre> <p>(on computer A, instead of the original <code>git daemon</code> command), and the push works.</p> <p>Note that you have to then run</p> <pre><code>git reset --hard </code></pre> <p>on computer... | 119 | git | <h1>'receive-pack': service not enabled for './.git'</h1>
<p>(Solved already, I'm writing this for the next guy)</p>
<p>I was running git daemon on one computer and tried synchronizing with another.</p>
<p>On computer A, I ran:</p>
<pre><code>git daemon --reuseaddr --base-path=. --export-all --verbose
</code></pre>
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,836 | git | # 'receive-pack': service not enabled for './.git'
(Solved already, I'm writing this for the next guy)
I was running git daemon on one computer and tried synchronizing with another.
On computer A, I ran:
```
git daemon --reuseaddr --base-path=. --export-all --verbose
```
On computer B, I ran:
```
git clone git://... | Simply run
```
git daemon --reuseaddr --base-path=. --export-all --verbose --enable=receive-pack
```
(on computer A, instead of the original `git daemon` command), and the push works.
Note that you have to then run
```
git reset --hard
```
on computer A to make it "see" the changes from computer B.
### Post Scrip... |
56724650 | git log --full-diff, what does it do? | 54 | 2019-06-23 14:06:10 | <p>The <a href="https://git-scm.com/docs/git-log" rel="noreferrer">git-log documentation</a> explains the parameter <code>--full-diff</code>.</p>
<p>In detail:</p>
<blockquote>
<p>Without this flag, git log -p ... shows commits that touch the specified paths, and diffs about the same specified paths. With this, the ful... | 52,315 | 6,270,170 | 2019-06-23 19:50:32 | 56,724,818 | 64 | 2019-06-23 14:25:03 | 258,894 | 2019-06-23 14:25:03 | https://stackoverflow.com/q/56724650 | https://stackoverflow.com/a/56724818 | <p>Sure. Let's say you have a commit C that makes changes to file A and file B.</p>
<p>Regular <code>git log -p -- A</code> will show all commits that touch file A, and for those commits, it'll show the diffs to A.
With <code>--full-diff</code>, it'll show the same commits, but for each commit it'll show the diff of ... | <p>Sure. Let's say you have a commit C that makes changes to file A and file B.</p> <p>Regular <code>git log -p -- A</code> will show all commits that touch file A, and for those commits, it'll show the diffs to A. With <code>--full-diff</code>, it'll show the same commits, but for each commit it'll show the diff of ... | 119 | git | <h1>git log --full-diff, what does it do?</h1>
<p>The <a href="https://git-scm.com/docs/git-log" rel="noreferrer">git-log documentation</a> explains the parameter <code>--full-diff</code>.</p>
<p>In detail:</p>
<blockquote>
<p>Without this flag, git log -p ... shows commits that touch the specified paths, and diffs abo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,837 | git | # git log --full-diff, what does it do?
The [git-log documentation](https://git-scm.com/docs/git-log) explains the parameter `--full-diff`.
In detail:
> Without this flag, git log -p ... shows commits that touch the specified paths, and diffs about the same specified paths. With this, the full diff is shown for comm... | Sure. Let's say you have a commit C that makes changes to file A and file B.
Regular `git log -p -- A` will show all commits that touch file A, and for those commits, it'll show the diffs to A.
With `--full-diff`, it'll show the same commits, but for each commit it'll show the diff of *all* files changed in that commi... |
46863981 | How to sign git commits from within an IDE like IntelliJ? | 54 | 2017-10-21 13:54:15 | <blockquote>
<p><strong>Question</strong> How do I sign git commits using an IDE like IntelliJ on Windows?</p>
</blockquote>
<p>If you're interested, read what I tried here:</p>
<p>I followed mainly <a href="https://help.github.com/articles/signing-commits-with-gpg/" rel="noreferrer" title="GitHub's guide">Gith... | 37,920 | 4,126,843 | 2024-05-29 18:53:10 | 46,884,134 | 64 | 2017-10-23 07:38:08 | 4,126,843 | 2024-05-29 18:53:10 | https://stackoverflow.com/q/46863981 | https://stackoverflow.com/a/46884134 | <h2>Since git 2.19.1, gpg2 is supported!</h2>
<h3>gpg-agent can handle automatic signing now, remembering your passphrase</h3>
<p>This should make it easier to use gpg to sign commits automatically.
To be exact, git version 2.19.1 has at least gpg 2.2.9.
These instructions were tested on Windows 7, Windows 8.1, Window... | <h2>Since git 2.19.1, gpg2 is supported!</h2> <h3>gpg-agent can handle automatic signing now, remembering your passphrase</h3> <p>This should make it easier to use gpg to sign commits automatically. To be exact, git version 2.19.1 has at least gpg 2.2.9. These instructions were tested on Windows 7, Windows 8.1, Window... | 119, 6735, 8945 | git, gnupg, intellij-idea | <h1>How to sign git commits from within an IDE like IntelliJ?</h1>
<blockquote>
<p><strong>Question</strong> How do I sign git commits using an IDE like IntelliJ on Windows?</p>
</blockquote>
<p>If you're interested, read what I tried here:</p>
<p>I followed mainly <a href="https://help.github.com/articles/signing-... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,838 | git | # How to sign git commits from within an IDE like IntelliJ?
> **Question** How do I sign git commits using an IDE like IntelliJ on Windows?
If you're interested, read what I tried here:
I followed mainly [Github's guide](https://help.github.com/articles/signing-commits-with-gpg/ "GitHub's guide"). I made sure to not... | ## Since git 2.19.1, gpg2 is supported!
### gpg-agent can handle automatic signing now, remembering your passphrase
This should make it easier to use gpg to sign commits automatically.
To be exact, git version 2.19.1 has at least gpg 2.2.9.
These instructions were tested on Windows 7, Windows 8.1, Windows 10, Arch Li... |
18124699 | Difference between a git commit and the working directory? | 54 | 2013-08-08 11:20:34 | <p>The git-diff manual pages says that git diff is used to </p>
<blockquote>
<p>Show changes between the working tree and the index or a tree, changes
between the index and a tree, changes between two trees, or changes
between two files on disk.</p>
</blockquote>
<p>But what about if you want to show the differ... | 38,561 | 1,070,480 | 2019-06-04 11:19:25 | 18,124,981 | 64 | 2013-08-08 11:35:32 | 216,074 | 2013-12-12 18:50:13 | https://stackoverflow.com/q/18124699 | https://stackoverflow.com/a/18124981 | <p>Yes, but it depends a bit on your definition on what the “current project state” is. The manual for git diff goes on.</p>
<p>If you are interested in comparing with the <em>staged</em> changes:</p>
<blockquote>
<pre><code>git diff [--options] --cached [<commit>] [--] [<path>...]
</code></pre>
<p>T... | <p>Yes, but it depends a bit on your definition on what the “current project state” is. The manual for git diff goes on.</p> <p>If you are interested in comparing with the <em>staged</em> changes:</p> <blockquote> <pre><code>git diff [--options] --cached [<commit>] [--] [<path>...] </code></pre> <p>T... | 9033 | git-diff | <h1>Difference between a git commit and the working directory?</h1>
<p>The git-diff manual pages says that git diff is used to </p>
<blockquote>
<p>Show changes between the working tree and the index or a tree, changes
between the index and a tree, changes between two trees, or changes
between two files on disk.... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,839 | git | # Difference between a git commit and the working directory?
The git-diff manual pages says that git diff is used to
> Show changes between the working tree and the index or a tree, changes
> between the index and a tree, changes between two trees, or changes
> between two files on disk.
But what about if you want t... | Yes, but it depends a bit on your definition on what the “current project state” is. The manual for git diff goes on.
If you are interested in comparing with the *staged* changes:
> ```
> git diff [--options] --cached [<commit>] [--] [<path>...]
> ```
>
> This form is to view the changes you staged for the next commi... |
8428587 | Git: created new branch from a wrong branch | 53 | 2011-12-08 09:10:27 | <p>I usually create new branch from develop</p>
<pre><code>git checkout -b new-feature develop
</code></pre>
<p>then after the last commit I merge back to develop</p>
<pre><code>git checkout develop
git merge new-feature
</code></pre>
<p>but this time I created <code>new-feature2</code> brach from <code>new-feature... | 20,881 | 517,529 | 2022-01-26 23:07:40 | 8,430,897 | 64 | 2011-12-08 12:19:40 | 102,200 | 2022-01-26 23:07:40 | https://stackoverflow.com/q/8428587 | https://stackoverflow.com/a/8430897 | <blockquote>
<p>Note: Be sure to have a clean workspace before you begin. Read all messages git shows you. If in doubt, read more about the topic before starting.</p>
</blockquote>
<p>You could rebase your feature over to the main base:</p>
<pre><code>git checkout new-feature2
git rebase --onto develop new-feature ne... | <blockquote> <p>Note: Be sure to have a clean workspace before you begin. Read all messages git shows you. If in doubt, read more about the topic before starting.</p> </blockquote> <p>You could rebase your feature over to the main base:</p> <pre><code>git checkout new-feature2 git rebase --onto develop new-feature ne... | 119, 1879, 76220 | branch, git, git-branch | <h1>Git: created new branch from a wrong branch</h1>
<p>I usually create new branch from develop</p>
<pre><code>git checkout -b new-feature develop
</code></pre>
<p>then after the last commit I merge back to develop</p>
<pre><code>git checkout develop
git merge new-feature
</code></pre>
<p>but this time I created <... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,841 | git | # Git: created new branch from a wrong branch
I usually create new branch from develop
```
git checkout -b new-feature develop
```
then after the last commit I merge back to develop
```
git checkout develop
git merge new-feature
```
but this time I created `new-feature2` brach from `new-feature` and now I cannot m... | > Note: Be sure to have a clean workspace before you begin. Read all messages git shows you. If in doubt, read more about the topic before starting.
You could rebase your feature over to the main base:
```
git checkout new-feature2
git rebase --onto develop new-feature new-feature2
# rebase the stuff from new-featu... |
6940595 | How can I delete a remote branch in a local Git repository? | 53 | 2011-08-04 11:27:35 | <p>All the remote branches are visible as remotes in my local Git repository after a Git fetch.</p>
<p>How can I selectively remove the remote branches in my local repository (not in the remote repository)?</p>
| 17,005 | 579,689 | 2024-11-01 16:34:14 | 6,940,809 | 64 | 2011-08-04 11:41:24 | 524,289 | 2024-11-01 16:26:58 | https://stackoverflow.com/q/6940595 | https://stackoverflow.com/a/6940809 | <p>Use:</p>
<p><code>git branch -r -d remote/branch</code></p>
<p>You also need to reconfigure <em>fetch</em> to avoid fetching this branch again later.</p>
| <p>Use:</p> <p><code>git branch -r -d remote/branch</code></p> <p>You also need to reconfigure <em>fetch</em> to avoid fetching this branch again later.</p> | 119 | git | <h1>How can I delete a remote branch in a local Git repository?</h1>
<p>All the remote branches are visible as remotes in my local Git repository after a Git fetch.</p>
<p>How can I selectively remove the remote branches in my local repository (not in the remote repository)?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,842 | git | # How can I delete a remote branch in a local Git repository?
All the remote branches are visible as remotes in my local Git repository after a Git fetch.
How can I selectively remove the remote branches in my local repository (not in the remote repository)? | Use:
`git branch -r -d remote/branch`
You also need to reconfigure *fetch* to avoid fetching this branch again later. |
2874873 | Migrating from TFS to Git | 53 | 2010-05-20 14:50:52 | <p>Is it possible to migrate from TFS 2008 to Git, and still preserve all the history, etc?
I've seen some references that talk about doing it through SVN, but that seems rather complicated, and complicates my mission to introduce Git at my job.</p>
| 20,176 | 247,107 | 2020-09-28 11:44:44 | 5,248,125 | 64 | 2011-03-09 15:36:27 | 1,220 | 2015-03-12 09:16:25 | https://stackoverflow.com/q/2874873 | https://stackoverflow.com/a/5248125 | <p>There is a direct way its called <a href="https://github.com/git-tfs/git-tfs" rel="noreferrer">git-tfs</a> and it's up on github.</p>
<p>You just do a </p>
<pre><code> git tfs clone <tfs server> <tfs project>
</code></pre>
<p>I recommend getting the source and adding it to your path separately so th... | <p>There is a direct way its called <a href="https://github.com/git-tfs/git-tfs" rel="noreferrer">git-tfs</a> and it's up on github.</p> <p>You just do a </p> <pre><code> git tfs clone <tfs server> <tfs project> </code></pre> <p>I recommend getting the source and adding it to your path separately so th... | 119, 733 | git, tfs | <h1>Migrating from TFS to Git</h1>
<p>Is it possible to migrate from TFS 2008 to Git, and still preserve all the history, etc?
I've seen some references that talk about doing it through SVN, but that seems rather complicated, and complicates my mission to introduce Git at my job.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,843 | git | # Migrating from TFS to Git
Is it possible to migrate from TFS 2008 to Git, and still preserve all the history, etc?
I've seen some references that talk about doing it through SVN, but that seems rather complicated, and complicates my mission to introduce Git at my job. | There is a direct way its called [git-tfs](https://github.com/git-tfs/git-tfs) and it's up on github.
You just do a
```
git tfs clone <tfs server> <tfs project>
```
I recommend getting the source and adding it to your path separately so that you can debug it for any strangeness, but the code is pretty easy to step... |
33189437 | Explain gitignore pattern matching | 52 | 2015-10-17 17:23:13 | <p>I have the following directory tree:</p>
<pre><code>> #pwd is the repo
> tree -a
.
├── .git
│ |.....
├── .gitignore
├── README.md
├── f1.html
├── f2.html ... and some more html
├── images
│ └── river.jpg
>
</code></pre>
<p>I also have the following in my <code>.gitignore</code>:</p>
<pre><code>>... | 91,591 | 4,476,026 | 2024-04-09 17:55:39 | 33,190,653 | 64 | 2015-10-17 19:23:58 | 1,699,979 | 2016-11-02 11:00:11 | https://stackoverflow.com/q/33189437 | https://stackoverflow.com/a/33190653 | <p>Firstly the tricky part in your question is the first line in the <code>.gitignore</code> file:</p>
<pre><code>* // Says exclude each and every file in the repository,
// unless I specify with ! pattern explicitly to consider it
</code></pre>
<p>First we will consider the first version of your <code>.gitignore... | <p>Firstly the tricky part in your question is the first line in the <code>.gitignore</code> file:</p> <pre><code>* // Says exclude each and every file in the repository, // unless I specify with ! pattern explicitly to consider it </code></pre> <p>First we will consider the first version of your <code>.gitignore... | 18, 119, 25056 | git, gitignore, regex | <h1>Explain gitignore pattern matching</h1>
<p>I have the following directory tree:</p>
<pre><code>> #pwd is the repo
> tree -a
.
├── .git
│ |.....
├── .gitignore
├── README.md
├── f1.html
├── f2.html ... and some more html
├── images
│ └── river.jpg
>
</code></pre>
<p>I also have the following in my ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,844 | git | # Explain gitignore pattern matching
I have the following directory tree:
```
> #pwd is the repo
> tree -a
.
├── .git
│ |.....
├── .gitignore
├── README.md
├── f1.html
├── f2.html ... and some more html
├── images
│ └── river.jpg
>
```
I also have the following in my `.gitignore`:
```
> cat .gitignore
*
!*.h... | Firstly the tricky part in your question is the first line in the `.gitignore` file:
```
* // Says exclude each and every file in the repository,
// unless I specify with ! pattern explicitly to consider it
```
First we will consider the first version of your `.gitignore`.
1. `*` exclude every file in the reposi... |
15011311 | What's the difference between "git add -u" and "git add -A"? | 52 | 2013-02-21 20:11:10 | <p>Okay, so I was searching <strong>"How to Remove Manually Deleted files from Git"</strong> without actually doing <code>git rm file.txt</code> for each file when I came across "<a href="https://stackoverflow.com/questions/492558/removing-multiple-files-from-a-git-repo-that-have-already-been-deleted-from-disk">Removin... | 24,818 | 1,533,054 | 2015-06-17 09:56:01 | 15,011,313 | 64 | 2013-02-21 20:11:10 | 1,533,054 | 2013-02-21 20:11:10 | https://stackoverflow.com/q/15011311 | https://stackoverflow.com/a/15011313 | <h3>Brief Answer:</h3>
<p><code>git add -A</code> <strong>is equal to</strong> <code>git add .</code> <strong>+</strong> <code>git add -u</code></p>
<hr />
<h3>Explanation:</h3>
<p>When you do a "<code>git add .</code>", it <strong>adds all files</strong> (existing, modified and new) to the staging area but i... | <h3>Brief Answer:</h3> <p><code>git add -A</code> <strong>is equal to</strong> <code>git add .</code> <strong>+</strong> <code>git add -u</code></p> <hr /> <h3>Explanation:</h3> <p>When you do a "<code>git add .</code>", it <strong>adds all files</strong> (existing, modified and new) to the staging area but i... | 119, 34792 | git, git-add | <h1>What's the difference between "git add -u" and "git add -A"?</h1>
<p>Okay, so I was searching <strong>"How to Remove Manually Deleted files from Git"</strong> without actually doing <code>git rm file.txt</code> for each file when I came across "<a href="https://stackoverflow.com/questions/492558/removing-multiple-f... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,845 | git | # What's the difference between "git add -u" and "git add -A"?
Okay, so I was searching **"How to Remove Manually Deleted files from Git"** without actually doing `git rm file.txt` for each file when I came across "[Removing multiple files from a Git repo that have already been deleted from disk](https://stackoverflow... | ### Brief Answer:
`git add -A` **is equal to** `git add .` **+** `git add -u`
---
### Explanation:
When you do a "`git add .`", it **adds all files** (existing, modified and new) to the staging area but it does not remove files that have been deleted from the disk.
"`git add -u`" only adds currently tracked files ... |
47084443 | How to remove git from menu context in Documents? | 51 | 2017-11-02 20:52:34 | <p>I have a little question: How can I remove the "git bash here" and "git gui here" from my menu context in my Documents directory?</p>
<p>I have tried:</p>
<ol>
<li>Reinstalling the Git-2.15.0-64-bit with unchecked options.</li>
<li>Removing the keys from:</li>
</ol>
<pre><code>[-HKEY_CLASSES_ROOT... | 49,117 | 4,958,644 | 2025-02-03 00:29:05 | 49,257,399 | 64 | 2018-03-13 13:26:40 | 4,906,348 | 2020-01-28 23:48:12 | https://stackoverflow.com/q/47084443 | https://stackoverflow.com/a/49257399 | <p>I Think I've found other reference about it. I've delete mine on </p>
<pre><code>HKEY_CLASSES_ROOT\LibraryFolder\background\shell
</code></pre>
<p>Based on <a href="https://stackoverflow.com/a/32490883/4906348">https://stackoverflow.com/a/32490883/4906348</a>, Quite simple, I never think about it. You should see l... | <p>I Think I've found other reference about it. I've delete mine on </p> <pre><code>HKEY_CLASSES_ROOT\LibraryFolder\background\shell </code></pre> <p>Based on <a href="https://stackoverflow.com/a/32490883/4906348">https://stackoverflow.com/a/32490883/4906348</a>, Quite simple, I never think about it. You should see l... | 263, 638, 10273, 123373 | explorer, git-for-windows, registry, right-click | <h1>How to remove git from menu context in Documents?</h1>
<p>I have a little question: How can I remove the "git bash here" and "git gui here" from my menu context in my Documents directory?</p>
<p>I have tried:</p>
<ol>
<li>Reinstalling the Git-2.15.0-64-bit with unchecked options.</li>
<li>Removi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,846 | git | # How to remove git from menu context in Documents?
I have a little question: How can I remove the "git bash here" and "git gui here" from my menu context in my Documents directory?
I have tried:
1. Reinstalling the Git-2.15.0-64-bit with unchecked options.
2. Removing the keys from:
```
[-HKEY_CLASSES_ROOT\Directo... | I Think I've found other reference about it. I've delete mine on
```
HKEY_CLASSES_ROOT\LibraryFolder\background\shell
```
Based on <https://stackoverflow.com/a/32490883/4906348>, Quite simple, I never think about it. You should see like this.
[ and two files in the root directory. This worked fine.</p>
<p>I then deleted one of the two directories that I have locally (but no... | 57,523 | 699,632 | 2018-06-13 09:59:22 | 9,305,350 | 64 | 2012-02-16 04:02:11 | 526,535 | 2012-02-16 04:02:11 | https://stackoverflow.com/q/9305326 | https://stackoverflow.com/a/9305350 | <p><code>git pull</code> just merges the fetched commits in your working directory and will not restore your deleted directory ( but might warn you about conflicts.)</p>
<p>If you have deleted the folders in your working directory, you have to do:</p>
<pre><code>git checkout -- test
</code></pre>
<p>to get it back.<... | <p><code>git pull</code> just merges the fetched commits in your working directory and will not restore your deleted directory ( but might warn you about conflicts.)</p> <p>If you have deleted the folders in your working directory, you have to do:</p> <pre><code>git checkout -- test </code></pre> <p>to get it back.<... | 119 | git | <h1>Why doesn't git pull bring back directories that I've deleted?</h1>
<p>I've just started learning how to use <code>git</code> today, progressing well.</p>
<p>As an experiment, I used <code>push</code> to upload two directories (containing two files each) and two files in the root directory. This worked fine.</p>
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,850 | git | # Why doesn't git pull bring back directories that I've deleted?
I've just started learning how to use `git` today, progressing well.
As an experiment, I used `push` to upload two directories (containing two files each) and two files in the root directory. This worked fine.
I then deleted one of the two directories ... | `git pull` just merges the fetched commits in your working directory and will not restore your deleted directory ( but might warn you about conflicts.)
If you have deleted the folders in your working directory, you have to do:
```
git checkout -- test
```
to get it back.
Or you can do `git reset --hard` to complete... |
25140383 | Adding plugins from specific revision Github project to the Cordova project | 45 | 2014-08-05 13:46:02 | <p>I have setup the android project using cordova command-line-interface with the help of node.js. I have added the required plugin from Github to our project by the following command:</p>
<p>C:Users/Admin/>cordova plugin add <a href="https://github.com/phonegap-build/PushPlugin.git">https://github.com/phonegap-build/... | 29,410 | 2,098,379 | 2016-08-25 10:28:50 | 25,175,301 | 64 | 2014-08-07 06:06:39 | 2,098,379 | 2016-08-25 10:28:50 | https://stackoverflow.com/q/25140383 | https://stackoverflow.com/a/25175301 | <p>I got the answer finally, I could get the plugin code upto particular commit:</p>
<p>The following command is what I used to get the latest plugin code:</p>
<pre><code>D:sampleproject/>
cordova plugin add https://github.com/phonegap-build/PushPlugin#2345fd8fe48572eae3df631cf8fb262ef2804779
</code></pre>
| <p>I got the answer finally, I could get the plugin code upto particular commit:</p> <p>The following command is what I used to get the latest plugin code:</p> <pre><code>D:sampleproject/> cordova plugin add https://github.com/phonegap-build/PushPlugin#2345fd8fe48572eae3df631cf8fb262ef2804779 </code></pre> | 119, 1386, 78331 | android, cordova, git | <h1>Adding plugins from specific revision Github project to the Cordova project</h1>
<p>I have setup the android project using cordova command-line-interface with the help of node.js. I have added the required plugin from Github to our project by the following command:</p>
<p>C:Users/Admin/>cordova plugin add <a href=... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,851 | git | # Adding plugins from specific revision Github project to the Cordova project
I have setup the android project using cordova command-line-interface with the help of node.js. I have added the required plugin from Github to our project by the following command:
C:Users/Admin/>cordova plugin add <https://github.com/phon... | I got the answer finally, I could get the plugin code upto particular commit:
The following command is what I used to get the latest plugin code:
```
D:sampleproject/>
cordova plugin add https://github.com/phonegap-build/PushPlugin#2345fd8fe48572eae3df631cf8fb262ef2804779
``` |
6391128 | In Git, how do I diff to the first commit of my branch? | 45 | 2011-06-17 19:58:17 | <p>I've made several commits to a local branch, but I'm not sure what the best way to diff what I currently have to my branch's starting state. I know I can do something like <code>git diff HEAD HEAD~6</code> if there's been 6 commits to my branch, but I was hoping for something that was independent of the number of c... | 12,951 | 29,502 | 2011-06-17 21:44:44 | 6,392,134 | 64 | 2011-06-17 21:38:52 | 712,605 | 2011-06-17 21:44:44 | https://stackoverflow.com/q/6391128 | https://stackoverflow.com/a/6392134 | <p>You'll want to use the triple dot syntax described in <code>git help diff</code>:</p>
<pre><code>git diff otherbranch...
</code></pre>
<p>This is the same as:</p>
<pre><code>git diff otherbranch...HEAD
</code></pre>
<p>which is the same as:</p>
<pre><code>git diff $(git merge-base otherbranch HEAD) HEAD
</code>... | <p>You'll want to use the triple dot syntax described in <code>git help diff</code>:</p> <pre><code>git diff otherbranch... </code></pre> <p>This is the same as:</p> <pre><code>git diff otherbranch...HEAD </code></pre> <p>which is the same as:</p> <pre><code>git diff $(git merge-base otherbranch HEAD) HEAD </code>... | 119, 9033 | git, git-diff | <h1>In Git, how do I diff to the first commit of my branch?</h1>
<p>I've made several commits to a local branch, but I'm not sure what the best way to diff what I currently have to my branch's starting state. I know I can do something like <code>git diff HEAD HEAD~6</code> if there's been 6 commits to my branch, but I... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,852 | git | # In Git, how do I diff to the first commit of my branch?
I've made several commits to a local branch, but I'm not sure what the best way to diff what I currently have to my branch's starting state. I know I can do something like `git diff HEAD HEAD~6` if there's been 6 commits to my branch, but I was hoping for somet... | You'll want to use the triple dot syntax described in `git help diff`:
```
git diff otherbranch...
```
This is the same as:
```
git diff otherbranch...HEAD
```
which is the same as:
```
git diff $(git merge-base otherbranch HEAD) HEAD
```
The `merge-base` command prints the "best" (most recent) common ancestor, s... |
17067566 | Adding a remote git repo through intelliJ | 44 | 2013-06-12 14:02:47 | <p>I want to know how to add a remote git repo via intelliJ, not through the git bash. Now, from what I've seen in this <a href="http://wiki.jetbrains.net/intellij/Using_Git_Locally#Uploading_the_Master_Branch_to_a_Remote_Repository">tutorial</a>, it can be done, but whenever I try to push, the dialogue never comes up.... | 44,446 | 1,624,921 | 2016-10-18 16:06:17 | 17,068,183 | 64 | 2013-06-12 14:32:06 | 104,891 | 2016-10-18 16:06:17 | https://stackoverflow.com/q/17067566 | https://stackoverflow.com/a/17068183 | <p><strong>UPDATE</strong>: this feature is available since 2016.3 version.</p>
<p><code>VCS</code> | <code>Git</code> | <code>Remotes</code> | <code>Add</code> (<kbd>Alt</kbd>+<kbd>Insert</kbd>).</p>
<p><a href="https://i.sstatic.net/U5pHV.png"><img src="https://i.sstatic.net/U5pHV.png" alt="git remotes"></a></p>
<... | <p><strong>UPDATE</strong>: this feature is available since 2016.3 version.</p> <p><code>VCS</code> | <code>Git</code> | <code>Remotes</code> | <code>Add</code> (<kbd>Alt</kbd>+<kbd>Insert</kbd>).</p> <p><a href="https://i.sstatic.net/U5pHV.png"><img src="https://i.sstatic.net/U5pHV.png" alt="git remotes"></a></p> <... | 119, 8945, 51298 | git, intellij-idea, pycharm | <h1>Adding a remote git repo through intelliJ</h1>
<p>I want to know how to add a remote git repo via intelliJ, not through the git bash. Now, from what I've seen in this <a href="http://wiki.jetbrains.net/intellij/Using_Git_Locally#Uploading_the_Master_Branch_to_a_Remote_Repository">tutorial</a>, it can be done, but w... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,853 | git | # Adding a remote git repo through intelliJ
I want to know how to add a remote git repo via intelliJ, not through the git bash. Now, from what I've seen in this [tutorial](http://wiki.jetbrains.net/intellij/Using_Git_Locally#Uploading_the_Master_Branch_to_a_Remote_Repository), it can be done, but whenever I try to pus... | **UPDATE**: this feature is available since 2016.3 version.
`VCS` | `Git` | `Remotes` | `Add` (`Alt`+`Insert`).
[](https://i.sstatic.net/U5pHV.png)
---
Original answer:
You can choose from the existing remotes, but you can't add new remotes from the UI, there is a fea... |
6703238 | Getting a list of commits along with the commit message and hash in Git | 40 | 2011-07-15 05:56:58 | <p>I have a project in Git. What I want is a list of only the commit messages and the hashes between two commits and store it in a text file. Is there any command that does this ? </p>
<p>Thanks.</p>
| 19,616 | 234,606 | 2011-07-15 06:11:12 | 6,703,259 | 64 | 2011-07-15 06:00:19 | 229,602 | 2011-07-15 06:11:12 | https://stackoverflow.com/q/6703238 | https://stackoverflow.com/a/6703259 | <pre><code>git log --pretty=oneline commit1...commit2 > file
</code></pre>
| <pre><code>git log --pretty=oneline commit1...commit2 > file </code></pre> | 119 | git | <h1>Getting a list of commits along with the commit message and hash in Git</h1>
<p>I have a project in Git. What I want is a list of only the commit messages and the hashes between two commits and store it in a text file. Is there any command that does this ? </p>
<p>Thanks.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,855 | git | # Getting a list of commits along with the commit message and hash in Git
I have a project in Git. What I want is a list of only the commit messages and the hashes between two commits and store it in a text file. Is there any command that does this ?
Thanks. | ```
git log --pretty=oneline commit1...commit2 > file
``` |
14476236 | Is there anyway to undo git push -f? | 24 | 2013-01-23 09:26:30 | <p>If I use <code>push -f</code> to overlap the last commit, namely A, on remote repository, and others have pulled A before I pushed. </p>
<p>Anyway to undo this in case not to cause trouble for others?</p>
<p>Is it useful to <code>push -f</code> an original one to "<strong>pretend</strong>" that nothing has been t... | 11,197 | 516,268 | 2022-06-28 09:51:02 | 14,476,557 | 64 | 2013-01-23 09:42:45 | 283,078 | 2022-06-28 09:51:02 | https://stackoverflow.com/q/14476236 | https://stackoverflow.com/a/14476557 | <p>There are a few ways to find out the original HEAD before the push:</p>
<h2>Terminal scrollback</h2>
<p>If you're lucky enough to have the terminal open still, there will be some output when the push was made that looks like this:</p>
<pre><code>...
To user@host:repo.git
+ abcdef0...1234567 HEAD -> branchname (f... | <p>There are a few ways to find out the original HEAD before the push:</p> <h2>Terminal scrollback</h2> <p>If you're lucky enough to have the terminal open still, there will be some output when the push was made that looks like this:</p> <pre><code>... To user@host:repo.git + abcdef0...1234567 HEAD -> branchname (f... | 119 | git | <h1>Is there anyway to undo git push -f?</h1>
<p>If I use <code>push -f</code> to overlap the last commit, namely A, on remote repository, and others have pulled A before I pushed. </p>
<p>Anyway to undo this in case not to cause trouble for others?</p>
<p>Is it useful to <code>push -f</code> an original one to "<st... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,858 | git | # Is there anyway to undo git push -f?
If I use `push -f` to overlap the last commit, namely A, on remote repository, and others have pulled A before I pushed.
Anyway to undo this in case not to cause trouble for others?
Is it useful to `push -f` an original one to "**pretend**" that nothing has been touched?
Or
H... | There are a few ways to find out the original HEAD before the push:
## Terminal scrollback
If you're lucky enough to have the terminal open still, there will be some output when the push was made that looks like this:
```
...
To user@host:repo.git
+ abcdef0...1234567 HEAD -> branchname (forced update)
```
Here, `a... |
24071375 | How Do I Remove references to an old Heroku app in local git folder? | 21 | 2014-06-05 22:41:49 | <p>I deleted a heroku app reinitialized the local repository but when I try to add the new remote repository it won't let me add the new remote because the remote already exists but with the old name. I tried doing a rename but that didn't work either because of course the old app no longer exists. When I run "git rem... | 26,136 | 1,442,919 | 2017-04-25 21:56:41 | 24,071,430 | 64 | 2014-06-05 22:46:59 | 281,108 | 2014-06-05 22:46:59 | https://stackoverflow.com/q/24071375 | https://stackoverflow.com/a/24071430 | <p>You can use <code>git remote set-url</code> to change the url:</p>
<pre><code>git remote set-url heroku <new-url>
</code></pre>
<p>Alternatively, you can use <code>git remote rm</code> to remove a remote by name:</p>
<pre><code>git remote rm heroku
</code></pre>
| <p>You can use <code>git remote set-url</code> to change the url:</p> <pre><code>git remote set-url heroku <new-url> </code></pre> <p>Alternatively, you can use <code>git remote rm</code> to remove a remote by name:</p> <pre><code>git remote rm heroku </code></pre> | 119, 8279 | git, heroku | <h1>How Do I Remove references to an old Heroku app in local git folder?</h1>
<p>I deleted a heroku app reinitialized the local repository but when I try to add the new remote repository it won't let me add the new remote because the remote already exists but with the old name. I tried doing a rename but that didn't wo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,859 | git | # How Do I Remove references to an old Heroku app in local git folder?
I deleted a heroku app reinitialized the local repository but when I try to add the new remote repository it won't let me add the new remote because the remote already exists but with the old name. I tried doing a rename but that didn't work either... | You can use `git remote set-url` to change the url:
```
git remote set-url heroku <new-url>
```
Alternatively, you can use `git remote rm` to remove a remote by name:
```
git remote rm heroku
``` |
22272339 | Rake assets:precompile gets killed when there is a console session open in production | 20 | 2014-03-08 17:04:32 | <p>On my production server, which is hosted on digital ocean, if that helps, Ubuntu 12.04, I have RoR 4 and rake 10.1.1.</p>
<p>When I deploy, I run <code>rake assets:precompile</code>, and I've noticed a strange issue where if I have a <code>rails console</code> session open when I do this, I get the following output... | 5,373 | 1,387,670 | 2018-06-13 12:52:19 | 22,272,491 | 64 | 2014-03-08 17:19:15 | 923,832 | 2015-07-21 06:22:51 | https://stackoverflow.com/q/22272339 | https://stackoverflow.com/a/22272491 | <p>Your precompile process is probably being killed because you are running out of RAM. You can confirm this by running <code>top</code> in another ssh session. To fix this, create a swap file that will be used when RAM is full. </p>
<p><strong>Create SWAP Space on Ubuntu</strong>
You will probably end up needing some... | <p>Your precompile process is probably being killed because you are running out of RAM. You can confirm this by running <code>top</code> in another ssh session. To fix this, create a swap file that will be used when RAM is full. </p> <p><strong>Create SWAP Space on Ubuntu</strong> You will probably end up needing some... | 12, 4984, 97102 | digital-ocean, ruby, ruby-on-rails | <h1>Rake assets:precompile gets killed when there is a console session open in production</h1>
<p>On my production server, which is hosted on digital ocean, if that helps, Ubuntu 12.04, I have RoR 4 and rake 10.1.1.</p>
<p>When I deploy, I run <code>rake assets:precompile</code>, and I've noticed a strange issue where... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,861 | git | # Rake assets:precompile gets killed when there is a console session open in production
On my production server, which is hosted on digital ocean, if that helps, Ubuntu 12.04, I have RoR 4 and rake 10.1.1.
When I deploy, I run `rake assets:precompile`, and I've noticed a strange issue where if I have a `rails console... | Your precompile process is probably being killed because you are running out of RAM. You can confirm this by running `top` in another ssh session. To fix this, create a swap file that will be used when RAM is full.
**Create SWAP Space on Ubuntu**
You will probably end up needing some swap space if you plan on using Ra... |
3005392 | How can I tell if one commit is a descendant of another commit? | 221 | 2010-06-09 11:35:14 | <p>With Git, how can I tell if one commit in my branch is a descendant of another commit?</p>
| 65,681 | 307,745 | 2025-10-22 18:52:33 | 3,006,203 | 63 | 2010-06-09 13:25:46 | 46,058 | 2019-09-02 16:49:35 | https://stackoverflow.com/q/3005392 | https://stackoverflow.com/a/3006203 | <p>If you want to check this programmatically (e.g. in script), you can check if <code>git merge-base A B</code> is equal to <code>git rev-parse --verify A</code> (then A is reachable from B), or if it is <code>git rev-parse --verify B</code> (then B is reachable from A). <code>git rev-parse</code> is here needed to c... | <p>If you want to check this programmatically (e.g. in script), you can check if <code>git merge-base A B</code> is equal to <code>git rev-parse --verify A</code> (then A is reachable from B), or if it is <code>git rev-parse --verify B</code> (then B is reachable from A). <code>git rev-parse</code> is here needed to c... | 119 | git | <h1>How can I tell if one commit is a descendant of another commit?</h1>
<p>With Git, how can I tell if one commit in my branch is a descendant of another commit?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,865 | git | # How can I tell if one commit is a descendant of another commit?
With Git, how can I tell if one commit in my branch is a descendant of another commit? | If you want to check this programmatically (e.g. in script), you can check if `git merge-base A B` is equal to `git rev-parse --verify A` (then A is reachable from B), or if it is `git rev-parse --verify B` (then B is reachable from A). `git rev-parse` is here needed to convert from commit name to commit SHA-1 / commit... |
1456923 | Why am I getting the message, "fatal: This operation must be run in a work tree?" | 137 | 2009-09-21 21:16:40 | <p>Just installed git on Windows. I set the GIT_DIR variable to be c:\git\ and verified that this environment variable is maintained by cygwin (i.e. echo $GIT_DIR is what it should be). I went to the folder that I wanted to create the git repository for, let's say c:\www, and then ran:</p>
<pre><code>git init
git add... | 302,871 | 2,484 | 2024-04-18 08:47:25 | 1,456,998 | 63 | 2009-09-21 21:32:41 | 119,963 | 2009-09-21 21:32:41 | https://stackoverflow.com/q/1456923 | https://stackoverflow.com/a/1456998 | <p>The direct reason for the error is that yes, it's impossible to use <code>git-add</code> with a bare repository. A bare repository, by definition, has no work tree. <code>git-add</code> takes files from the work tree and adds them to the index, in preparation for committing.</p>
<p>You may need to put a bit of thou... | <p>The direct reason for the error is that yes, it's impossible to use <code>git-add</code> with a bare repository. A bare repository, by definition, has no work tree. <code>git-add</code> takes files from the work tree and adds them to the index, in preparation for committing.</p> <p>You may need to put a bit of thou... | 119, 64465 | git, git-bare | <h1>Why am I getting the message, "fatal: This operation must be run in a work tree?"</h1>
<p>Just installed git on Windows. I set the GIT_DIR variable to be c:\git\ and verified that this environment variable is maintained by cygwin (i.e. echo $GIT_DIR is what it should be). I went to the folder that I wanted to crea... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,866 | git | # Why am I getting the message, "fatal: This operation must be run in a work tree?"
Just installed git on Windows. I set the GIT_DIR variable to be c:\git\ and verified that this environment variable is maintained by cygwin (i.e. echo $GIT_DIR is what it should be). I went to the folder that I wanted to create the git... | The direct reason for the error is that yes, it's impossible to use `git-add` with a bare repository. A bare repository, by definition, has no work tree. `git-add` takes files from the work tree and adds them to the index, in preparation for committing.
You may need to put a bit of thought into your setup here, though... |
14369155 | How to change past commit to include a missed file after other commits have been made? | 109 | 2013-01-16 22:34:19 | <p>I have committed a change and forgot to add a file to the change set. After other commits, I realized the file is now missing from a <code>HEAD^4</code> commit.</p>
<p>Because this is beyond the immediately previous commit, I cannot use <a href="https://stackoverflow.com/a/14096741/1028230">the <code>--amend</code> ... | 45,749 | 14,540 | 2024-07-03 19:43:25 | 14,369,264 | 63 | 2013-01-16 22:43:06 | 13,767 | 2021-03-15 08:34:30 | https://stackoverflow.com/q/14369155 | https://stackoverflow.com/a/14369264 | <p>Use <a href="http://git-scm.com/book/en/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages" rel="noreferrer"><code>git rebase --interactive HEAD~4</code></a> and set <code>edit</code> option for the commit you'd like to amend.</p>
<p>Remember that you <strong>should not</strong> modify commits pushed to t... | <p>Use <a href="http://git-scm.com/book/en/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages" rel="noreferrer"><code>git rebase --interactive HEAD~4</code></a> and set <code>edit</code> option for the commit you'd like to amend.</p> <p>Remember that you <strong>should not</strong> modify commits pushed to t... | 119, 53850 | git, git-commit | <h1>How to change past commit to include a missed file after other commits have been made?</h1>
<p>I have committed a change and forgot to add a file to the change set. After other commits, I realized the file is now missing from a <code>HEAD^4</code> commit.</p>
<p>Because this is beyond the immediately previous commi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,867 | git | # How to change past commit to include a missed file after other commits have been made?
I have committed a change and forgot to add a file to the change set. After other commits, I realized the file is now missing from a `HEAD^4` commit.
Because this is beyond the immediately previous commit, I cannot use [the `--am... | Use [`git rebase --interactive HEAD~4`](http://git-scm.com/book/en/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) and set `edit` option for the commit you'd like to amend.
Remember that you **should not** modify commits pushed to the remote repository this way. It's better to add a new commit with miss... |
69387175 | Git for Windows: SSL certificate problem: certificate has expired | 102 | 2021-09-30 06:27:13 | <p>I am aware that <a href="https://en.wikipedia.org/wiki/Let%27s_Encrypt" rel="noreferrer">Let's Encrypt</a> made changes that may impact older clients because a root certificate would expire. See <em><a href="https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/" rel="noreferrer">DST Root CA X3 Expir... | 55,530 | 98,491 | 2022-06-24 01:09:39 | 69,396,425 | 63 | 2021-09-30 17:19:02 | 1,123,355 | 2021-10-17 13:50:38 | https://stackoverflow.com/q/69387175 | https://stackoverflow.com/a/69396425 | <p>On my <a href="https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_16.04_LTS_.28Xenial_Xerus.29" rel="noreferrer">Ubuntu 16.04.6</a> LTS (Xenial Xerus) machine, the solution was to remove the <code>DST Root CA X3</code> certificate by running the following two commands:</p>
<pre><code>sudo rm /usr/share/ca-c... | <p>On my <a href="https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_16.04_LTS_.28Xenial_Xerus.29" rel="noreferrer">Ubuntu 16.04.6</a> LTS (Xenial Xerus) machine, the solution was to remove the <code>DST Root CA X3</code> certificate by running the following two commands:</p> <pre><code>sudo rm /usr/share/ca-c... | 119, 1999, 5954, 116354 | certificate, git, lets-encrypt, openssl | <h1>Git for Windows: SSL certificate problem: certificate has expired</h1>
<p>I am aware that <a href="https://en.wikipedia.org/wiki/Let%27s_Encrypt" rel="noreferrer">Let's Encrypt</a> made changes that may impact older clients because a root certificate would expire. See <em><a href="https://letsencrypt.org/docs/dst-r... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,868 | git | # Git for Windows: SSL certificate problem: certificate has expired
I am aware that [Let's Encrypt](https://en.wikipedia.org/wiki/Let%27s_Encrypt) made changes that may impact older clients because a root certificate would expire. See *[DST Root CA X3 Expiration (September 2021)](https://letsencrypt.org/docs/dst-root-... | On my [Ubuntu 16.04.6](https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_16.04_LTS_.28Xenial_Xerus.29) LTS (Xenial Xerus) machine, the solution was to remove the `DST Root CA X3` certificate by running the following two commands:
```
sudo rm /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt
sudo update-c... |
1396617 | Committing Machine Specific Configuration Files | 90 | 2009-09-08 22:13:45 | <p>A common scenario when I develop is that the codebase will have several config files which require machine specific settings. These files will be checked into Git and other developers will always accidentally check them back in and break someone else's configuration.</p>
<p>A simple solution to this would be to jus... | 13,995 | 80,617 | 2019-02-12 08:29:38 | 1,397,180 | 63 | 2009-09-09 01:40:37 | 90,002 | 2010-06-08 06:06:10 | https://stackoverflow.com/q/1396617 | https://stackoverflow.com/a/1397180 | <p>Have your program read a pair of configuration files for its settings. First, it should read a <code>config.defaults</code> file that would be included in the repository. Then, it should read a <code>config.local</code> file that should be listed in <code>.gitignore</code></p>
<p>With this arrangement, new settings... | <p>Have your program read a pair of configuration files for its settings. First, it should read a <code>config.defaults</code> file that would be included in the repository. Then, it should read a <code>config.local</code> file that should be listed in <code>.gitignore</code></p> <p>With this arrangement, new settings... | 119, 456, 725 | configuration, git, version-control | <h1>Committing Machine Specific Configuration Files</h1>
<p>A common scenario when I develop is that the codebase will have several config files which require machine specific settings. These files will be checked into Git and other developers will always accidentally check them back in and break someone else's configu... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,870 | git | # Committing Machine Specific Configuration Files
A common scenario when I develop is that the codebase will have several config files which require machine specific settings. These files will be checked into Git and other developers will always accidentally check them back in and break someone else's configuration.
... | Have your program read a pair of configuration files for its settings. First, it should read a `config.defaults` file that would be included in the repository. Then, it should read a `config.local` file that should be listed in `.gitignore`
With this arrangement, new settings appear in the defaults file and take effec... |
6884022 | Collapsing a Group of Commits into One on Git | 88 | 2011-07-30 15:11:57 | <p>I have the habit of making a huge number of small commits, and I'm fine with it. But I would like to, from time to time, take a bunch of those linear commits and collapse them together as just one commit with the ability to write a new commit message.</p>
<p>I've looked into the documentation but seemed a little to... | 60,811 | 536,387 | 2018-04-12 17:28:59 | 6,884,057 | 63 | 2011-07-30 15:17:10 | 12,349 | 2015-06-22 13:31:42 | https://stackoverflow.com/q/6884022 | https://stackoverflow.com/a/6884057 | <p>Suppose you want to rewrite the history of the tree going back until (but not including) commit <code>a739b0d</code>.</p>
<pre><code>export EDITOR=vim # or your favorite editor
git rebase a739b0d --interactive
</code></pre>
<p>Be sure to read up on <a href="https://git-scm.com/book/en/v2/Git-Tools-Rewriting-Histor... | <p>Suppose you want to rewrite the history of the tree going back until (but not including) commit <code>a739b0d</code>.</p> <pre><code>export EDITOR=vim # or your favorite editor git rebase a739b0d --interactive </code></pre> <p>Be sure to read up on <a href="https://git-scm.com/book/en/v2/Git-Tools-Rewriting-Histor... | 119 | git | <h1>Collapsing a Group of Commits into One on Git</h1>
<p>I have the habit of making a huge number of small commits, and I'm fine with it. But I would like to, from time to time, take a bunch of those linear commits and collapse them together as just one commit with the ability to write a new commit message.</p>
<p>I'... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,871 | git | # Collapsing a Group of Commits into One on Git
I have the habit of making a huge number of small commits, and I'm fine with it. But I would like to, from time to time, take a bunch of those linear commits and collapse them together as just one commit with the ability to write a new commit message.
I've looked into t... | Suppose you want to rewrite the history of the tree going back until (but not including) commit `a739b0d`.
```
export EDITOR=vim # or your favorite editor
git rebase a739b0d --interactive
```
Be sure to read up on [interactive rebasing](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Comm... |
17581026 | Where does a Git branch start and what is its length? | 69 | 2013-07-10 21:15:55 | <p>Every now and then I'm asked, on what commit a certain branch on git starts or if a certain commit has been created on a specific branch. The end point of a branch is pretty clear: that's where the branch label sits. But - where did it start? The trivial answer would be: on that commit where we <em>created</em> that... | 16,125 | 105,224 | 2020-06-10 22:28:35 | 17,581,159 | 63 | 2013-07-10 21:24:17 | null | 2015-10-15 03:59:45 | https://stackoverflow.com/q/17581026 | https://stackoverflow.com/a/17581159 | <p>In Git, you could say that every branch starts at the root commit, and that would be quite literally true. But I guess that's not very helpful for you. What you could do instead is to define "the start of a branch" in relation to other branches. One way you can do this is to use</p>
<pre><code>git show-branch br... | <p>In Git, you could say that every branch starts at the root commit, and that would be quite literally true. But I guess that's not very helpful for you. What you could do instead is to define "the start of a branch" in relation to other branches. One way you can do this is to use</p> <pre><code>git show-branch br... | 119, 456, 76220 | git, git-branch, version-control | <h1>Where does a Git branch start and what is its length?</h1>
<p>Every now and then I'm asked, on what commit a certain branch on git starts or if a certain commit has been created on a specific branch. The end point of a branch is pretty clear: that's where the branch label sits. But - where did it start? The trivial... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,872 | git | # Where does a Git branch start and what is its length?
Every now and then I'm asked, on what commit a certain branch on git starts or if a certain commit has been created on a specific branch. The end point of a branch is pretty clear: that's where the branch label sits. But - where did it start? The trivial answer w... | In Git, you could say that every branch starts at the root commit, and that would be quite literally true. But I guess that's not very helpful for you. What you could do instead is to define "the start of a branch" in relation to other branches. One way you can do this is to use
```
git show-branch branch1 branch2 ...... |
12685134 | .gitignore: How do I ignore nested directories? | 62 | 2012-10-02 05:49:22 | <p>I have the following directory structure:</p>
<pre><code>test/a
test/b/c
test/a/b/Ouput
test/c/d/e/Output
test/f/Output
</code></pre>
<p>I want to ignore all the "Output" directories under "test". I tried <code>test/**/Output</code>, but it didn't work. What am I doing wrong?</p>
| 48,873 | 145,844 | 2016-08-19 14:51:38 | 12,685,426 | 63 | 2012-10-02 06:24:16 | 57,719 | 2014-08-13 18:32:55 | https://stackoverflow.com/q/12685134 | https://stackoverflow.com/a/12685426 | <p>You said you want the <code>Output/</code> pattern to match only under the <code>test/</code> directory, so in the <code>test/</code> directory, create a <code>.gitignore</code> file with the contents:</p>
<pre><code>Output/
</code></pre>
<p>If you put this pattern in your top-level <code>.gitignore</code> file, t... | <p>You said you want the <code>Output/</code> pattern to match only under the <code>test/</code> directory, so in the <code>test/</code> directory, create a <code>.gitignore</code> file with the contents:</p> <pre><code>Output/ </code></pre> <p>If you put this pattern in your top-level <code>.gitignore</code> file, t... | 119, 25056 | git, gitignore | <h1>.gitignore: How do I ignore nested directories?</h1>
<p>I have the following directory structure:</p>
<pre><code>test/a
test/b/c
test/a/b/Ouput
test/c/d/e/Output
test/f/Output
</code></pre>
<p>I want to ignore all the "Output" directories under "test". I tried <code>test/**/Output</code>, but it didn't work. Wh... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,874 | git | # .gitignore: How do I ignore nested directories?
I have the following directory structure:
```
test/a
test/b/c
test/a/b/Ouput
test/c/d/e/Output
test/f/Output
```
I want to ignore all the "Output" directories under "test". I tried `test/**/Output`, but it didn't work. What am I doing wrong? | You said you want the `Output/` pattern to match only under the `test/` directory, so in the `test/` directory, create a `.gitignore` file with the contents:
```
Output/
```
If you put this pattern in your top-level `.gitignore` file, then it will match in **all** directories under the top directory. |
2233590 | Is there a way to make git remember the password for WebDAV remotes? | 59 | 2010-02-10 00:35:55 | <p>I'm working with Git pushing changes to a repository shared over HTTP / WebDAV, and Git prompts for a password for every operation that accesses the HTTP remote. Is there any way to make Git cache the password / have the remote server not prompt me?</p>
<p>The remote webserver should be an Apache and could possibly... | 37,774 | 41,655 | 2015-11-18 09:09:32 | 2,240,590 | 63 | 2010-02-10 21:46:11 | 41,655 | 2015-11-18 09:09:32 | https://stackoverflow.com/q/2233590 | https://stackoverflow.com/a/2240590 | <p>The way is to use ~/.netrc as outlined in step 3 of <a href="http://schacon.github.com/git/howto/setup-git-server-over-http.txt" rel="noreferrer">this Git documentation</a>:</p>
<blockquote>
<p>Then, add the following to your $HOME/.netrc (you can do without, but will be
asked to input your password a <em>lot</... | <p>The way is to use ~/.netrc as outlined in step 3 of <a href="http://schacon.github.com/git/howto/setup-git-server-over-http.txt" rel="noreferrer">this Git documentation</a>:</p> <blockquote> <p>Then, add the following to your $HOME/.netrc (you can do without, but will be asked to input your password a <em>lot</... | 119, 220 | git, passwords | <h1>Is there a way to make git remember the password for WebDAV remotes?</h1>
<p>I'm working with Git pushing changes to a repository shared over HTTP / WebDAV, and Git prompts for a password for every operation that accesses the HTTP remote. Is there any way to make Git cache the password / have the remote server not ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,875 | git | # Is there a way to make git remember the password for WebDAV remotes?
I'm working with Git pushing changes to a repository shared over HTTP / WebDAV, and Git prompts for a password for every operation that accesses the HTTP remote. Is there any way to make Git cache the password / have the remote server not prompt me... | The way is to use ~/.netrc as outlined in step 3 of [this Git documentation](http://schacon.github.com/git/howto/setup-git-server-over-http.txt):
> Then, add the following to your $HOME/.netrc (you can do without, but will be
> asked to input your password a *lot* of times):
>
> ```
> machine <servername>
> login <use... |
17910096 | What does the "at" @ sign/symbol/character mean in Git? | 55 | 2013-07-28 15:58:58 | <p>The at-sign <code>@</code> is often used in git to <a href="https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html">specify revisions</a> in different
ways. For example,</p>
<ol>
<li><p><code><ref>@{<date>}</code> specifies the reference at its state on <code><date></code>.</p>
<p>Exa... | 16,010 | null | 2024-03-03 15:13:10 | 17,910,097 | 63 | 2013-07-28 15:58:58 | null | 2021-11-14 07:08:17 | https://stackoverflow.com/q/17910096 | https://stackoverflow.com/a/17910097 | <p><a href="https://github.com/git/git/blob/v1.8.5/Documentation/RelNotes/1.8.5.txt#L100-101" rel="noreferrer">As of Git version 1.8.5</a>, the at-sign <code>@</code>, without a leading branch/reference name and ordinal <code>{n}</code> suffix like <code>HEAD@{1}</code> and <code>master@{1}</code>, is just a synonym/al... | <p><a href="https://github.com/git/git/blob/v1.8.5/Documentation/RelNotes/1.8.5.txt#L100-101" rel="noreferrer">As of Git version 1.8.5</a>, the at-sign <code>@</code>, without a leading branch/reference name and ordinal <code>{n}</code> suffix like <code>HEAD@{1}</code> and <code>master@{1}</code>, is just a synonym/al... | 119 | git | <h1>What does the "at" @ sign/symbol/character mean in Git?</h1>
<p>The at-sign <code>@</code> is often used in git to <a href="https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html">specify revisions</a> in different
ways. For example,</p>
<ol>
<li><p><code><ref>@{<date>}</code> specifies the... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,877 | git | # What does the "at" @ sign/symbol/character mean in Git?
The at-sign `@` is often used in git to [specify revisions](https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html) in different
ways. For example,
1. `<ref>@{<date>}` specifies the reference at its state on `<date>`.
Example: `git diff master@... | [As of Git version 1.8.5](https://github.com/git/git/blob/v1.8.5/Documentation/RelNotes/1.8.5.txt#L100-101), the at-sign `@`, without a leading branch/reference name and ordinal `{n}` suffix like `HEAD@{1}` and `master@{1}`, is just a synonym/alias/shortcut for the special Git reference `HEAD`:
> Instead of typing fou... |
42386491 | Git apply skips patches | 54 | 2017-02-22 08:41:19 | <p>I'm trying to apply a patch that includes binary files with <code>git apply</code> but only the files are added. I tried running <code>git apply failing.patch -v</code> and it prints something like:</p>
<blockquote>
<p>Skipped patch 'file.txt'.<br>
Checking patch file.bin...<br>
Applied patch file.bin cleanly... | 35,008 | 865,175 | 2023-11-30 03:13:55 | 42,386,570 | 63 | 2017-02-22 08:45:48 | 865,175 | 2018-04-25 08:00:19 | https://stackoverflow.com/q/42386491 | https://stackoverflow.com/a/42386570 | <p>I found out the problem by running <code>patch -p1 < failing.patch</code> which printed:</p>
<blockquote>
<p>can't find file to patch at input line 5</p>
</blockquote>
<p>and reminded me that I was not in the root directory.</p>
<p>I can't understand why <a href="https://www.google.ro/search?q=git%20apply%20... | <p>I found out the problem by running <code>patch -p1 < failing.patch</code> which printed:</p> <blockquote> <p>can't find file to patch at input line 5</p> </blockquote> <p>and reminded me that I was not in the root directory.</p> <p>I can't understand why <a href="https://www.google.ro/search?q=git%20apply%20... | 119, 2132 | git, patch | <h1>Git apply skips patches</h1>
<p>I'm trying to apply a patch that includes binary files with <code>git apply</code> but only the files are added. I tried running <code>git apply failing.patch -v</code> and it prints something like:</p>
<blockquote>
<p>Skipped patch 'file.txt'.<br>
Checking patch file.bin...<br>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,878 | git | # Git apply skips patches
I'm trying to apply a patch that includes binary files with `git apply` but only the files are added. I tried running `git apply failing.patch -v` and it prints something like:
> Skipped patch 'file.txt'.
> Checking patch file.bin...
> Applied patch file.bin cleanly.
How can I find out ... | I found out the problem by running `patch -p1 < failing.patch` which printed:
> can't find file to patch at input line 5
and reminded me that I was not in the root directory.
I can't understand why [no one had asked this before](https://www.google.ro/search?q=git%20apply%20%22skipped%20patch%22) and why is the verbo... |
31686452 | How to view stash date/timestamp next to stash id? | 49 | 2015-07-28 20:29:31 | <p>Using <code>git stash list</code> shows me the list of stashes with their IDs. Using <code>git stash list --date=local</code> or <code>git stash list --date=relative</code> gives me their times, but I have no idea what their corresponding ID is.</p>
<p>I want to acquire a stash at a certain time. </p>
| 15,413 | 1,502,780 | 2017-08-20 18:39:57 | 31,687,960 | 63 | 2015-07-28 22:07:02 | 1,256,452 | 2017-08-20 18:39:57 | https://stackoverflow.com/q/31686452 | https://stackoverflow.com/a/31687960 | <p><code>git stash list</code> simply runs <code>git log</code> with a particular set of options:</p>
<pre><code>list_stash () {
have_stash || return 0
git log --format="%gd: %gs" -g --first-parent -m "$@" $ref_stash --
}
</code></pre>
<p>The <code>$@</code> part inserts whatever additional options yo... | <p><code>git stash list</code> simply runs <code>git log</code> with a particular set of options:</p> <pre><code>list_stash () { have_stash || return 0 git log --format="%gd: %gs" -g --first-parent -m "$@" $ref_stash -- } </code></pre> <p>The <code>$@</code> part inserts whatever additional options yo... | 119, 13091 | git, git-stash | <h1>How to view stash date/timestamp next to stash id?</h1>
<p>Using <code>git stash list</code> shows me the list of stashes with their IDs. Using <code>git stash list --date=local</code> or <code>git stash list --date=relative</code> gives me their times, but I have no idea what their corresponding ID is.</p>
<p>I w... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,880 | git | # How to view stash date/timestamp next to stash id?
Using `git stash list` shows me the list of stashes with their IDs. Using `git stash list --date=local` or `git stash list --date=relative` gives me their times, but I have no idea what their corresponding ID is.
I want to acquire a stash at a certain time. | `git stash list` simply runs `git log` with a particular set of options:
```
list_stash () {
have_stash || return 0
git log --format="%gd: %gs" -g --first-parent -m "$@" $ref_stash --
}
```
The `$@` part inserts whatever additional options you've specified (none by default, but `--date=relative` in th... |
38239521 | What is the parent of a Git commit? How can there be more than one parent to a Git commit? | 48 | 2016-07-07 07:12:42 | <p>I was looking at <a href="https://stackoverflow.com/a/2222920/2419531">this question</a> when I got really confused. My understanding was that the previous commit is the parent of a commit.</p>
| 53,904 | 991,559 | 2021-06-15 07:17:37 | 38,239,664 | 63 | 2016-07-07 07:20:56 | 871,050 | 2016-07-07 07:31:23 | https://stackoverflow.com/q/38239521 | https://stackoverflow.com/a/38239664 | <p>The parent commit is the commit this current commit is based on. Usually:</p>
<ul>
<li>When you <code>git commit</code> normally, the current commit becomes the parent commit of the new commit that's introduced by the command.</li>
<li>When you <code>git merge</code> two commits (or branches, whatever) without fast... | <p>The parent commit is the commit this current commit is based on. Usually:</p> <ul> <li>When you <code>git commit</code> normally, the current commit becomes the parent commit of the new commit that's introduced by the command.</li> <li>When you <code>git merge</code> two commits (or branches, whatever) without fast... | 119 | git | <h1>What is the parent of a Git commit? How can there be more than one parent to a Git commit?</h1>
<p>I was looking at <a href="https://stackoverflow.com/a/2222920/2419531">this question</a> when I got really confused. My understanding was that the previous commit is the parent of a commit.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,881 | git | # What is the parent of a Git commit? How can there be more than one parent to a Git commit?
I was looking at [this question](https://stackoverflow.com/a/2222920/2419531) when I got really confused. My understanding was that the previous commit is the parent of a commit. | The parent commit is the commit this current commit is based on. Usually:
- When you `git commit` normally, the current commit becomes the parent commit of the new commit that's introduced by the command.
- When you `git merge` two commits (or branches, whatever) without fast-forwarding, a new commit will be created w... |
53321680 | What does "Filtering content" mean when doing a git clone? | 47 | 2018-11-15 14:30:23 | <p>I cloned a git repo and noticed a status line <code>Filtering content</code> which was very slow. This doesn't usually appear. What is it?</p>
<pre><code>remote: Enumerating objects: 30, done.
remote: Counting objects: 100% (30/30), done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 16592 (delta 6... | 29,999 | 24,874 | 2018-11-15 15:01:34 | 53,322,266 | 63 | 2018-11-15 15:01:34 | 7,050,130 | 2018-11-15 15:01:34 | https://stackoverflow.com/q/53321680 | https://stackoverflow.com/a/53322266 | <p>In <code>git</code> you can define "filters" that affect the process of moving files from the index to the work tree ("smudge" filters) and from the work tree to the index ("clean" filters). Typically you'll find a .gitattribute file that associates the filters with files at specific paths.</p>
<p>It used to be th... | <p>In <code>git</code> you can define "filters" that affect the process of moving files from the index to the work tree ("smudge" filters) and from the work tree to the index ("clean" filters). Typically you'll find a .gitattribute file that associates the filters with files at specific paths.</p> <p>It used to be th... | 119, 34099, 115244 | git, git-clone, git-lfs | <h1>What does "Filtering content" mean when doing a git clone?</h1>
<p>I cloned a git repo and noticed a status line <code>Filtering content</code> which was very slow. This doesn't usually appear. What is it?</p>
<pre><code>remote: Enumerating objects: 30, done.
remote: Counting objects: 100% (30/30), done.
remote: C... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,882 | git | # What does "Filtering content" mean when doing a git clone?
I cloned a git repo and noticed a status line `Filtering content` which was very slow. This doesn't usually appear. What is it?
```
remote: Enumerating objects: 30, done.
remote: Counting objects: 100% (30/30), done.
remote: Compressing objects: 100% (26/26... | In `git` you can define "filters" that affect the process of moving files from the index to the work tree ("smudge" filters) and from the work tree to the index ("clean" filters). Typically you'll find a .gitattribute file that associates the filters with files at specific paths.
It used to be that this was always han... |
6434995 | How to re-merge a file in the git? | 47 | 2011-06-22 04:44:49 | <p>I have 10 files which have conflicts when merging branches. I've resolved all conflicts of the 10 files(took long time). Unfortunately before the commit, I find out that one file has been merged wrong and need start again for this file. :(</p>
<p>in the Git, How to mark the file which has been merged unmerged, in o... | 10,387 | 400,275 | 2018-12-27 22:26:55 | 6,435,230 | 63 | 2011-06-22 05:18:25 | 13,986 | 2018-12-27 22:26:55 | https://stackoverflow.com/q/6434995 | https://stackoverflow.com/a/6435230 | <pre><code>git checkout -m <filename>
</code></pre>
<p>This will remove it from the index, and revert back to a "conflicted" file that has all of the markers required to then do a merge.</p>
<p>From the git help checkout man page:</p>
<pre><code>-m, --merge
When switching branches, if you have local modifi... | <pre><code>git checkout -m <filename> </code></pre> <p>This will remove it from the index, and revert back to a "conflicted" file that has all of the markers required to then do a merge.</p> <p>From the git help checkout man page:</p> <pre><code>-m, --merge When switching branches, if you have local modifi... | 119, 28897 | git, git-merge | <h1>How to re-merge a file in the git?</h1>
<p>I have 10 files which have conflicts when merging branches. I've resolved all conflicts of the 10 files(took long time). Unfortunately before the commit, I find out that one file has been merged wrong and need start again for this file. :(</p>
<p>in the Git, How to mark t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,883 | git | # How to re-merge a file in the git?
I have 10 files which have conflicts when merging branches. I've resolved all conflicts of the 10 files(took long time). Unfortunately before the commit, I find out that one file has been merged wrong and need start again for this file. :(
in the Git, How to mark the file which ha... | ```
git checkout -m <filename>
```
This will remove it from the index, and revert back to a "conflicted" file that has all of the markers required to then do a merge.
From the git help checkout man page:
```
-m, --merge
When switching branches, if you have local modifications to
one or more files that are di... |
24782558 | Cherry-pick with ignore whitespace / line-endings | 42 | 2014-07-16 13:48:44 | <p>is there a way to tell <code>git cherry-pick</code> to use the <code>renormalize</code> merge strategy? I'm not sure the <code>-X</code> option is working.</p>
<p>I have a bunch of commits that seem to assume one type of line ending, and I'm trying to apply them to a branch that assumes another. Not having a good... | 13,535 | 366,221 | 2018-11-05 07:34:39 | 27,041,294 | 63 | 2014-11-20 13:53:46 | 366,221 | 2014-11-20 13:53:46 | https://stackoverflow.com/q/24782558 | https://stackoverflow.com/a/27041294 | <p>So, for completeness, the answer is that the <code>ignore-all-space</code> merge strategy does the job:</p>
<pre><code>git cherry-pick -X ignore-all-space <commit-id>
</code></pre>
<p>And that will let you painlessly cherry-pick commits made when the file had, eg, windows line endings onto a version that has... | <p>So, for completeness, the answer is that the <code>ignore-all-space</code> merge strategy does the job:</p> <pre><code>git cherry-pick -X ignore-all-space <commit-id> </code></pre> <p>And that will let you painlessly cherry-pick commits made when the file had, eg, windows line endings onto a version that has... | 58, 119, 8329 | git, line-endings, linux | <h1>Cherry-pick with ignore whitespace / line-endings</h1>
<p>is there a way to tell <code>git cherry-pick</code> to use the <code>renormalize</code> merge strategy? I'm not sure the <code>-X</code> option is working.</p>
<p>I have a bunch of commits that seem to assume one type of line ending, and I'm trying to appl... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,884 | git | # Cherry-pick with ignore whitespace / line-endings
is there a way to tell `git cherry-pick` to use the `renormalize` merge strategy? I'm not sure the `-X` option is working.
I have a bunch of commits that seem to assume one type of line ending, and I'm trying to apply them to a branch that assumes another. Not havin... | So, for completeness, the answer is that the `ignore-all-space` merge strategy does the job:
```
git cherry-pick -X ignore-all-space <commit-id>
```
And that will let you painlessly cherry-pick commits made when the file had, eg, windows line endings onto a version that has unix file endings. |
24412980 | How to run git rebase and ignore whitespace? | 42 | 2014-06-25 15:36:19 | <p>I have branch where I have one commit that only modifies whitespace (trailing whitespace and leading whitespace).</p>
<p>I ran <code>git rebase master</code> and <code>git rebase --ignore-whitespace master</code> and in both cases I have a merge conflict with the commit that only changed whitespace.</p>
| 17,992 | 387,194 | 2020-09-05 07:33:17 | 24,413,076 | 63 | 2014-06-25 15:41:05 | 69,755 | 2018-03-29 01:37:03 | https://stackoverflow.com/q/24412980 | https://stackoverflow.com/a/24413076 | <p>I can't guarantee that this will help, but you could try<br>
<code>git rebase -Xignore-space-change master</code><br>
or<br>
<code>git rebase -Xignore-all-space master</code>.<br>
<code>-X</code> passes options into the merge algorithm, and the default merge algorithm has these options to affect how it handles whit... | <p>I can't guarantee that this will help, but you could try<br> <code>git rebase -Xignore-space-change master</code><br> or<br> <code>git rebase -Xignore-all-space master</code>.<br> <code>-X</code> passes options into the merge algorithm, and the default merge algorithm has these options to affect how it handles whit... | 119, 28897 | git, git-merge | <h1>How to run git rebase and ignore whitespace?</h1>
<p>I have branch where I have one commit that only modifies whitespace (trailing whitespace and leading whitespace).</p>
<p>I ran <code>git rebase master</code> and <code>git rebase --ignore-whitespace master</code> and in both cases I have a merge conflict with th... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,885 | git | # How to run git rebase and ignore whitespace?
I have branch where I have one commit that only modifies whitespace (trailing whitespace and leading whitespace).
I ran `git rebase master` and `git rebase --ignore-whitespace master` and in both cases I have a merge conflict with the commit that only changed whitespace. | I can't guarantee that this will help, but you could try
`git rebase -Xignore-space-change master`
or
`git rebase -Xignore-all-space master`.
`-X` passes options into the merge algorithm, and the default merge algorithm has these options to affect how it handles whitespace. |
37531605 | How to Test if Git Repository is Shallow? | 41 | 2016-05-30 18:16:49 | <p>When I make a local clone from a repository, the clone fails if the origin repository is shallow.</p>
<pre><code>git clone -l -- . target-dir
</code></pre>
<p>As that is not always the case I'd like to find out prior clone but don't know how to do that.</p>
<p>What I tried so far is very little, basically creatin... | 13,076 | 367,456 | 2022-02-08 09:56:46 | 37,533,086 | 63 | 2016-05-30 20:14:00 | 1,256,452 | 2022-02-08 09:56:46 | https://stackoverflow.com/q/37531605 | https://stackoverflow.com/a/37533086 | <p>If your Git is <a href="https://github.com/git/git/blob/v2.15.0/Documentation/RelNotes/2.15.0.txt#L87-L89" rel="noreferrer">2.15</a> or later, run:</p>
<pre><code>git rev-parse --is-shallow-repository
</code></pre>
<p>which will print <code>false</code> (not shallow) or <code>true</code> (shallow):</p>
<pre><code>if... | <p>If your Git is <a href="https://github.com/git/git/blob/v2.15.0/Documentation/RelNotes/2.15.0.txt#L87-L89" rel="noreferrer">2.15</a> or later, run:</p> <pre><code>git rev-parse --is-shallow-repository </code></pre> <p>which will print <code>false</code> (not shallow) or <code>true</code> (shallow):</p> <pre><code>if... | 119 | git | <h1>How to Test if Git Repository is Shallow?</h1>
<p>When I make a local clone from a repository, the clone fails if the origin repository is shallow.</p>
<pre><code>git clone -l -- . target-dir
</code></pre>
<p>As that is not always the case I'd like to find out prior clone but don't know how to do that.</p>
<p>Wh... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,886 | git | # How to Test if Git Repository is Shallow?
When I make a local clone from a repository, the clone fails if the origin repository is shallow.
```
git clone -l -- . target-dir
```
As that is not always the case I'd like to find out prior clone but don't know how to do that.
What I tried so far is very little, basica... | If your Git is [2.15](https://github.com/git/git/blob/v2.15.0/Documentation/RelNotes/2.15.0.txt#L87-L89) or later, run:
```
git rev-parse --is-shallow-repository
```
which will print `false` (not shallow) or `true` (shallow):
```
if $(git rev-parse --is-shallow-repository); then
... repository is shallow ...
fi
... |
21607305 | How to make 'git log' decorate by default | 41 | 2014-02-06 15:39:16 | <p>I frequently type <code>git log</code> when what I actually want is <code>git log --decorate</code>. How do I make it decorate by default?</p>
<p>I have seen lots of answers of the form "make an alias <em>lg</em> and then type <code>git lg</code> instead of git log". But, I can't find anywhere how to chang... | 13,055 | 494,643 | 2022-11-10 11:38:06 | 21,607,489 | 63 | 2014-02-06 15:47:05 | 1,847,304 | 2021-04-10 19:46:43 | https://stackoverflow.com/q/21607305 | https://stackoverflow.com/a/21607489 | <p><code>git config log.decorate auto</code></p>
<p>For a global setting, add the <code> --global</code> parameter.</p>
<p>So it would be:</p>
<pre><code>git config --global log.decorate auto
</code></pre>
<p>The aliases are made with <code>git config alias.lg "log --decorate"</code></p>
| <p><code>git config log.decorate auto</code></p> <p>For a global setting, add the <code> --global</code> parameter.</p> <p>So it would be:</p> <pre><code>git config --global log.decorate auto </code></pre> <p>The aliases are made with <code>git config alias.lg "log --decorate"</code></p> | 119, 47913 | git, git-log | <h1>How to make 'git log' decorate by default</h1>
<p>I frequently type <code>git log</code> when what I actually want is <code>git log --decorate</code>. How do I make it decorate by default?</p>
<p>I have seen lots of answers of the form "make an alias <em>lg</em> and then type <code>git lg</code> instead of git... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,887 | git | # How to make 'git log' decorate by default
I frequently type `git log` when what I actually want is `git log --decorate`. How do I make it decorate by default?
I have seen lots of answers of the form "make an alias *lg* and then type `git lg` instead of git log". But, I can't find anywhere how to change the default ... | `git config log.decorate auto`
For a global setting, add the `--global` parameter.
So it would be:
```
git config --global log.decorate auto
```
The aliases are made with `git config alias.lg "log --decorate"` |
6718672 | Git lost commits | 41 | 2011-07-16 16:20:09 | <p>I was trying to fix a problem in git and accidentally used git reset --hard to some previous commit. So now I cannot get back to the old head.</p>
<p>However I did clone the repository before I did this, and so I pushed the missing commits back to the original. This seemed to work yesterday, but today I see that th... | 18,075 | 847,930 | 2014-01-27 18:26:29 | 6,718,722 | 63 | 2011-07-16 16:29:14 | 275,354 | 2011-07-16 17:15:37 | https://stackoverflow.com/q/6718672 | https://stackoverflow.com/a/6718722 | <p>To get your HEAD back in the right place:</p>
<ol>
<li><a href="http://www.kernel.org/pub/software/scm/git/docs/git-reflog.html" rel="noreferrer"><code>git reflog</code></a> to get a list of where HEAD has <em>been</em> lately.</li>
<li><a href="http://www.kernel.org/pub/software/scm/git/docs/git-show.html" rel="no... | <p>To get your HEAD back in the right place:</p> <ol> <li><a href="http://www.kernel.org/pub/software/scm/git/docs/git-reflog.html" rel="noreferrer"><code>git reflog</code></a> to get a list of where HEAD has <em>been</em> lately.</li> <li><a href="http://www.kernel.org/pub/software/scm/git/docs/git-show.html" rel="no... | 119 | git | <h1>Git lost commits</h1>
<p>I was trying to fix a problem in git and accidentally used git reset --hard to some previous commit. So now I cannot get back to the old head.</p>
<p>However I did clone the repository before I did this, and so I pushed the missing commits back to the original. This seemed to work yesterda... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,888 | git | # Git lost commits
I was trying to fix a problem in git and accidentally used git reset --hard to some previous commit. So now I cannot get back to the old head.
However I did clone the repository before I did this, and so I pushed the missing commits back to the original. This seemed to work yesterday, but today I s... | To get your HEAD back in the right place:
1. [`git reflog`](http://www.kernel.org/pub/software/scm/git/docs/git-reflog.html) to get a list of where HEAD has *been* lately.
2. [`git show sha1`](http://www.kernel.org/pub/software/scm/git/docs/git-show.html) to find the spot you want your HEAD to be.
3. Once you find the... |
30277149 | How to use interactive rebase on the first (root) commit of a branch? | 40 | 2015-05-16 14:57:33 | <p>If I'm in the following situation,</p>
<pre><code>$ git log --oneline
* abcdef commit #b
* 123456 commit #a
</code></pre>
<p>I know I can always run</p>
<pre><code>$ git reset HEAD~
$ git commit --amend
</code></pre>
<p>However, I tried to run</p>
<pre><code>$ git rebase -i HEAD~2
</code></pre>
<p>but I got</... | 22,017 | 2,670,370 | 2020-01-10 22:03:52 | 30,277,327 | 63 | 2015-05-16 15:15:15 | 2,541,573 | 2016-06-09 15:40:51 | https://stackoverflow.com/q/30277149 | https://stackoverflow.com/a/30277327 | <p>You want to rebase to the root commit of your <code>master</code> branch. More specifically, to squash the two commits, you need to run</p>
<pre><code>git rebase -i --root
</code></pre>
<p>and then substitute <code>squash</code> for <code>pick</code> on the second line in the buffer of the editor that pops up:</p>... | <p>You want to rebase to the root commit of your <code>master</code> branch. More specifically, to squash the two commits, you need to run</p> <pre><code>git rebase -i --root </code></pre> <p>and then substitute <code>squash</code> for <code>pick</code> on the second line in the buffer of the editor that pops up:</p>... | 119, 8974, 42532 | git, rebase, squash | <h1>How to use interactive rebase on the first (root) commit of a branch?</h1>
<p>If I'm in the following situation,</p>
<pre><code>$ git log --oneline
* abcdef commit #b
* 123456 commit #a
</code></pre>
<p>I know I can always run</p>
<pre><code>$ git reset HEAD~
$ git commit --amend
</code></pre>
<p>However, I tr... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,889 | git | # How to use interactive rebase on the first (root) commit of a branch?
If I'm in the following situation,
```
$ git log --oneline
* abcdef commit #b
* 123456 commit #a
```
I know I can always run
```
$ git reset HEAD~
$ git commit --amend
```
However, I tried to run
```
$ git rebase -i HEAD~2
```
but I got
``... | You want to rebase to the root commit of your `master` branch. More specifically, to squash the two commits, you need to run
```
git rebase -i --root
```
and then substitute `squash` for `pick` on the second line in the buffer of the editor that pops up:
```
pick 123456 a ... |
24107485 | How to checkout remote branch with git clone --depth 1? | 37 | 2014-06-08 15:06:37 | <p>I downloaded last revision of a big repository, where I need to get a latest revision of one branch so that I can test it.</p>
<p>How do I do that?</p>
<p>When I did <code>git clone --depth 1 url</code> I got last revision of master and the branch doesn't seem to exist?</p>
<pre><code>petanb@petrbena:~/Documents/... | 33,131 | 1,514,983 | 2016-09-21 22:00:30 | 24,107,526 | 63 | 2014-06-08 15:11:20 | 86,432 | 2014-06-08 15:19:54 | https://stackoverflow.com/q/24107485 | https://stackoverflow.com/a/24107526 | <p><code>git clone --depth 1</code> <a href="https://www.kernel.org/pub/software/scm/git/docs/git-clone.html" rel="noreferrer">implicitly carries</a> a <code>--single-branch</code> option, which defaults to the primary branch, which is <code>origin/master</code> by default.</p>
<p>If you want to clone a different bran... | <p><code>git clone --depth 1</code> <a href="https://www.kernel.org/pub/software/scm/git/docs/git-clone.html" rel="noreferrer">implicitly carries</a> a <code>--single-branch</code> option, which defaults to the primary branch, which is <code>origin/master</code> by default.</p> <p>If you want to clone a different bran... | 119 | git | <h1>How to checkout remote branch with git clone --depth 1?</h1>
<p>I downloaded last revision of a big repository, where I need to get a latest revision of one branch so that I can test it.</p>
<p>How do I do that?</p>
<p>When I did <code>git clone --depth 1 url</code> I got last revision of master and the branch do... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,890 | git | # How to checkout remote branch with git clone --depth 1?
I downloaded last revision of a big repository, where I need to get a latest revision of one branch so that I can test it.
How do I do that?
When I did `git clone --depth 1 url` I got last revision of master and the branch doesn't seem to exist?
```
petanb@p... | `git clone --depth 1` [implicitly carries](https://www.kernel.org/pub/software/scm/git/docs/git-clone.html) a `--single-branch` option, which defaults to the primary branch, which is `origin/master` by default.
If you want to clone a different branch, tell git which one you want to clone.
`git clone --depth 1 --branc... |
22890897 | Getting Git GUI to Ignore Space Changes in its diff View | 37 | 2014-04-06 06:50:43 | <p>Git comes with two default UI tools (on Windows at least): Git GUI and Gitk. </p>
<p>When browsing a commit, Gitk has a checkbox called "Ignore space changes" that makes the diff show only non-space related changes. </p>
<p>However, Git GUI always shows the <em>full</em> diff, and there is no equivalent checkbox... | 8,491 | 135,862 | 2017-05-10 11:29:10 | 22,890,947 | 63 | 2014-04-06 06:56:57 | 135,862 | 2017-05-10 11:26:44 | https://stackoverflow.com/q/22890897 | https://stackoverflow.com/a/22890947 | <p>Answering myself... </p>
<p>In the Git GUI main menu go to <em>Edit</em> -> <em>Options</em>. In <em>Additional Diff Parameters</em> put <code>-w</code> (or <code>--ignore-all-space</code>). </p>
<p>In fact, <a href="https://www.kernel.org/pub/software/scm/git/docs/git-diff.html" rel="noreferrer">any other <code>... | <p>Answering myself... </p> <p>In the Git GUI main menu go to <em>Edit</em> -> <em>Options</em>. In <em>Additional Diff Parameters</em> put <code>-w</code> (or <code>--ignore-all-space</code>). </p> <p>In fact, <a href="https://www.kernel.org/pub/software/scm/git/docs/git-diff.html" rel="noreferrer">any other <code>... | 119, 606, 9033, 30785, 33729 | diff, git, git-diff, git-gui, gitk | <h1>Getting Git GUI to Ignore Space Changes in its diff View</h1>
<p>Git comes with two default UI tools (on Windows at least): Git GUI and Gitk. </p>
<p>When browsing a commit, Gitk has a checkbox called "Ignore space changes" that makes the diff show only non-space related changes. </p>
<p>However, Git GUI always... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,891 | git | # Getting Git GUI to Ignore Space Changes in its diff View
Git comes with two default UI tools (on Windows at least): Git GUI and Gitk.
When browsing a commit, Gitk has a checkbox called "Ignore space changes" that makes the diff show only non-space related changes.
However, Git GUI always shows the *full* diff, and... | Answering myself...
In the Git GUI main menu go to *Edit* -> *Options*. In *Additional Diff Parameters* put `-w` (or `--ignore-all-space`).
In fact, [any other `git-diff` parameter](https://www.kernel.org/pub/software/scm/git/docs/git-diff.html) can go there too. |
21769813 | Git branch not returning any results | 36 | 2014-02-14 02:37:53 | <p>I'm trying to see what branch I'm on, but its not working...</p>
<pre><code>$ git checkout -b test
Switched to a new branch 'test'
$ git branch
$ git branch -a
$
</code></pre>
| 31,753 | 1,074,400 | 2023-09-18 17:16:22 | 21,769,914 | 63 | 2014-02-14 02:47:38 | 668,963 | 2014-02-14 02:47:38 | https://stackoverflow.com/q/21769813 | https://stackoverflow.com/a/21769914 | <p>That's because you have not yet committed anything, when you do <code>git checkout -b test</code>, git modifies content of the <code>.git/HEAD</code> file from <code>ref: refs/heads/master</code> to <code>ref: refs/heads/test</code>, which actually points to nothing. Only after you make a commit will git create the ... | <p>That's because you have not yet committed anything, when you do <code>git checkout -b test</code>, git modifies content of the <code>.git/HEAD</code> file from <code>ref: refs/heads/master</code> to <code>ref: refs/heads/test</code>, which actually points to nothing. Only after you make a commit will git create the ... | 119, 76220 | git, git-branch | <h1>Git branch not returning any results</h1>
<p>I'm trying to see what branch I'm on, but its not working...</p>
<pre><code>$ git checkout -b test
Switched to a new branch 'test'
$ git branch
$ git branch -a
$
</code></pre>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,892 | git | # Git branch not returning any results
I'm trying to see what branch I'm on, but its not working...
```
$ git checkout -b test
Switched to a new branch 'test'
$ git branch
$ git branch -a
$
``` | That's because you have not yet committed anything, when you do `git checkout -b test`, git modifies content of the `.git/HEAD` file from `ref: refs/heads/master` to `ref: refs/heads/test`, which actually points to nothing. Only after you make a commit will git create the `test` refs for you and you will find a `.git/r... |
18592752 | How to ignore files starting with numbers in Git? | 36 | 2013-09-03 12:48:59 | <p>In a certain folder, I have image files named <code>foo.jpg</code>, <code>bar.png</code>, etc. I want to keep them in version control, except those named like <code>1_baz.png</code>, <code>2_zaz.jpg</code>, etc (since they are actually generated).</p>
<p>What's the entry should I add to <code>.gitignore</code>? Reg... | 17,138 | 75,265 | 2013-09-03 13:54:49 | 18,592,835 | 63 | 2013-09-03 12:52:55 | 118,606 | 2013-09-03 13:54:49 | https://stackoverflow.com/q/18592752 | https://stackoverflow.com/a/18592835 | <p>Git does not use regexp but <a href="http://en.wikipedia.org/wiki/Glob_%28programming%29">glob pattern</a> to match ignored files. Add the following line in your root <code>.gitignore</code>:</p>
<pre><code>[0-9]*
</code></pre>
<p>If you only want to ignore those files in the <code>/static/img/</code> subdirectory... | <p>Git does not use regexp but <a href="http://en.wikipedia.org/wiki/Glob_%28programming%29">glob pattern</a> to match ignored files. Add the following line in your root <code>.gitignore</code>:</p> <pre><code>[0-9]* </code></pre> <p>If you only want to ignore those files in the <code>/static/img/</code> subdirectory... | 119, 25056 | git, gitignore | <h1>How to ignore files starting with numbers in Git?</h1>
<p>In a certain folder, I have image files named <code>foo.jpg</code>, <code>bar.png</code>, etc. I want to keep them in version control, except those named like <code>1_baz.png</code>, <code>2_zaz.jpg</code>, etc (since they are actually generated).</p>
<p>Wh... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,893 | git | # How to ignore files starting with numbers in Git?
In a certain folder, I have image files named `foo.jpg`, `bar.png`, etc. I want to keep them in version control, except those named like `1_baz.png`, `2_zaz.jpg`, etc (since they are actually generated).
What's the entry should I add to `.gitignore`? Regex such as `... | Git does not use regexp but [glob pattern](http://en.wikipedia.org/wiki/Glob_%28programming%29) to match ignored files. Add the following line in your root `.gitignore`:
```
[0-9]*
```
If you only want to ignore those files in the `/static/img/` subdirectory you should either add the previous line to `.gitignore` fil... |
33652953 | How to create a sub branch? | 32 | 2015-11-11 14:43:20 | <p>My git repository has two branches, <code>master</code> and <code>bug</code>. I want to create a branch <code>bug/rep</code>. So I run :</p>
<pre><code>git branch bug/rep
</code></pre>
<p>This gives the error:</p>
<blockquote>
<p>error: unable to resolve reference refs/heads/bug/rep: Not a directory
fatal: Ca... | 81,426 | 4,952,106 | 2025-11-20 03:06:44 | 33,653,154 | 63 | 2015-11-11 14:53:32 | 288,545 | 2018-06-07 13:23:11 | https://stackoverflow.com/q/33652953 | https://stackoverflow.com/a/33653154 | <p>In git, branches correspond to actual files in a hierarchy in the <code>.git</code> subdirectory. If you create a branch named <code>bug/sub</code>, git will first create a folder <code>.git/refs/heads/bug</code> (if it doesn't already exist) and within that folder it will create a file named <code>sub</code> which ... | <p>In git, branches correspond to actual files in a hierarchy in the <code>.git</code> subdirectory. If you create a branch named <code>bug/sub</code>, git will first create a folder <code>.git/refs/heads/bug</code> (if it doesn't already exist) and within that folder it will create a file named <code>sub</code> which ... | 119, 1879 | branch, git | <h1>How to create a sub branch?</h1>
<p>My git repository has two branches, <code>master</code> and <code>bug</code>. I want to create a branch <code>bug/rep</code>. So I run :</p>
<pre><code>git branch bug/rep
</code></pre>
<p>This gives the error:</p>
<blockquote>
<p>error: unable to resolve reference refs/heads... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,894 | git | # How to create a sub branch?
My git repository has two branches, `master` and `bug`. I want to create a branch `bug/rep`. So I run :
```
git branch bug/rep
```
This gives the error:
> error: unable to resolve reference refs/heads/bug/rep: Not a directory
> fatal: Cannot lock the ref 'refs/heads/bug/rep'.
How can ... | In git, branches correspond to actual files in a hierarchy in the `.git` subdirectory. If you create a branch named `bug/sub`, git will first create a folder `.git/refs/heads/bug` (if it doesn't already exist) and within that folder it will create a file named `sub` which is the branch. Branch names are presumed to res... |
4178726 | How do I untrack CVS folders after using git-cvsimport? | 28 | 2010-11-14 17:39:44 | <blockquote>
<p><strong>Possible Duplicates:</strong><br>
<a href="https://stackoverflow.com/questions/1158857/working-with-git-info-exclude-too-late">working with .git/info/exclude too late</a><br>
<a href="https://stackoverflow.com/questions/1139762/gitignore-file-not-ignoring">.gitignore file not ignoring</a><... | 14,804 | 256,854 | 2012-12-22 13:37:32 | 4,178,749 | 63 | 2010-11-14 17:43:41 | 229,044 | 2011-07-21 15:52:52 | https://stackoverflow.com/q/4178726 | https://stackoverflow.com/a/4178749 | <p><code>.gitignore</code> only causes git to ignore untracked files. "CVS" is already tracked so you must first remove it from the repository with:</p>
<pre><code>git rm -r --cached CVS
</code></pre>
<p>The <code>--cached</code> option causes git to leave the working copy of the file intact rather than removing it. ... | <p><code>.gitignore</code> only causes git to ignore untracked files. "CVS" is already tracked so you must first remove it from the repository with:</p> <pre><code>git rm -r --cached CVS </code></pre> <p>The <code>--cached</code> option causes git to leave the working copy of the file intact rather than removing it. ... | 119 | git | <h1>How do I untrack CVS folders after using git-cvsimport?</h1>
<blockquote>
<p><strong>Possible Duplicates:</strong><br>
<a href="https://stackoverflow.com/questions/1158857/working-with-git-info-exclude-too-late">working with .git/info/exclude too late</a><br>
<a href="https://stackoverflow.com/questions/11397... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,897 | git | # How do I untrack CVS folders after using git-cvsimport?
> **Possible Duplicates:**
> [working with .git/info/exclude too late](https://stackoverflow.com/questions/1158857/working-with-git-info-exclude-too-late)
> [.gitignore file not ignoring](https://stackoverflow.com/questions/1139762/gitignore-file-not-ignori... | `.gitignore` only causes git to ignore untracked files. "CVS" is already tracked so you must first remove it from the repository with:
```
git rm -r --cached CVS
```
The `--cached` option causes git to leave the working copy of the file intact rather than removing it. Once done, the entry in `.gitignore` will prevent... |
10913892 | Number of commits on branch in git | 27 | 2012-06-06 12:06:29 | <p>I'm writing a small script and want to know how many commits I made on a current branch since it was created.</p>
<p>In this example I'd have 2 commits made on <code>child</code>:</p>
<pre><code>git checkout master
git checkout -b child
...
git commit -a
...
git commit -a
</code></pre>
<p>So what I want is</p>
<pre>... | 16,853 | 532,782 | 2021-04-13 09:44:35 | 20,541,873 | 63 | 2013-12-12 11:09:31 | 392,626 | 2018-08-17 14:28:02 | https://stackoverflow.com/q/10913892 | https://stackoverflow.com/a/20541873 | <p>Git can provide you with the number of commits without further shell scripting.</p>
<pre><code>git rev-list master.. --count
</code></pre>
<p><a href="https://git-scm.com/docs/git-rev-list" rel="noreferrer">rev-list</a> (listed in <code>git help -a</code>) is used to work with revisions.</p>
<p>As <code>master..<... | <p>Git can provide you with the number of commits without further shell scripting.</p> <pre><code>git rev-list master.. --count </code></pre> <p><a href="https://git-scm.com/docs/git-rev-list" rel="noreferrer">rev-list</a> (listed in <code>git help -a</code>) is used to work with revisions.</p> <p>As <code>master..<... | 119, 456 | git, version-control | <h1>Number of commits on branch in git</h1>
<p>I'm writing a small script and want to know how many commits I made on a current branch since it was created.</p>
<p>In this example I'd have 2 commits made on <code>child</code>:</p>
<pre><code>git checkout master
git checkout -b child
...
git commit -a
...
git commit -a
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,898 | git | # Number of commits on branch in git
I'm writing a small script and want to know how many commits I made on a current branch since it was created.
In this example I'd have 2 commits made on `child`:
```
git checkout master
git checkout -b child
...
git commit -a
...
git commit -a
```
So what I want is
```
commit_n... | Git can provide you with the number of commits without further shell scripting.
```
git rev-list master.. --count
```
[rev-list](https://git-scm.com/docs/git-rev-list) (listed in `git help -a`) is used to work with revisions.
As `master..` will list the commits from the base of master and the current branch up to th... |
15054699 | How to change git url for app on Heroku | 27 | 2013-02-24 17:57:46 | <p>When I run "git remote -v" from Terminal I get the following:</p>
<pre><code>heroku git@heroku.com:obscure-taiga-9581.git (fetch)
heroku git@heroku.com:obscure-taiga-9581.git (push)
origin http://coastguard-quiz.herokuapp.com/ (fetch)
origin http://coastguard-quiz.herokuapp.com/ (push)
</code></pre>
<p>I want ... | 20,151 | 2,079,128 | 2013-02-24 22:03:24 | 15,057,179 | 63 | 2013-02-24 22:03:06 | 1,239,571 | 2013-02-24 22:03:06 | https://stackoverflow.com/q/15054699 | https://stackoverflow.com/a/15057179 | <p>I assume what you want to do is push to coastguard-quiz repo which is on heroku, so that when you <code>git push heroku</code> it updates the caostguard-quiz.herokuapp.com.</p>
<pre><code>git remote rm heroku
git remote add heroku git@heroku.com:coastguard-quiz.git
</code></pre>
| <p>I assume what you want to do is push to coastguard-quiz repo which is on heroku, so that when you <code>git push heroku</code> it updates the caostguard-quiz.herokuapp.com.</p> <pre><code>git remote rm heroku git remote add heroku git@heroku.com:coastguard-quiz.git </code></pre> | 119, 8279 | git, heroku | <h1>How to change git url for app on Heroku</h1>
<p>When I run "git remote -v" from Terminal I get the following:</p>
<pre><code>heroku git@heroku.com:obscure-taiga-9581.git (fetch)
heroku git@heroku.com:obscure-taiga-9581.git (push)
origin http://coastguard-quiz.herokuapp.com/ (fetch)
origin http://coastguard-qui... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,899 | git | # How to change git url for app on Heroku
When I run "git remote -v" from Terminal I get the following:
```
heroku git@heroku.com:obscure-taiga-9581.git (fetch)
heroku git@heroku.com:obscure-taiga-9581.git (push)
origin http://coastguard-quiz.herokuapp.com/ (fetch)
origin http://coastguard-quiz.herokuapp.com/ (pu... | I assume what you want to do is push to coastguard-quiz repo which is on heroku, so that when you `git push heroku` it updates the caostguard-quiz.herokuapp.com.
```
git remote rm heroku
git remote add heroku git@heroku.com:coastguard-quiz.git
``` |
14744993 | git - strange branch merge error that I am not sure how to solve | 16 | 2013-02-07 06:27:55 | <p>When I git status, I get this error message:</p>
<pre><code># On branch master
# Your branch and 'origin/master' have diverged,
# and have 1 and 2 different commits each, respectively.
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .gitignore
nothing added to com... | 37,465 | 478,573 | 2013-02-07 06:37:53 | 14,745,043 | 63 | 2013-02-07 06:32:15 | 155,187 | 2013-02-07 06:32:15 | https://stackoverflow.com/q/14744993 | https://stackoverflow.com/a/14745043 | <pre><code>rm .DS_Store
git add -A
git commit -m "Added .gitignore file"
</code></pre>
<p>You'll also want to expressly add <code>.DS_Store</code> to your <code>.gitignore</code> so that when <code>.DS_Store</code>is inevitably created in the future, it won't get in the way of your commits.</p>
| <pre><code>rm .DS_Store git add -A git commit -m "Added .gitignore file" </code></pre> <p>You'll also want to expressly add <code>.DS_Store</code> to your <code>.gitignore</code> so that when <code>.DS_Store</code>is inevitably created in the future, it won't get in the way of your commits.</p> | 119, 28897 | git, git-merge | <h1>git - strange branch merge error that I am not sure how to solve</h1>
<p>When I git status, I get this error message:</p>
<pre><code># On branch master
# Your branch and 'origin/master' have diverged,
# and have 1 and 2 different commits each, respectively.
#
# Untracked files:
# (use "git add <file>..." t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,900 | git | # git - strange branch merge error that I am not sure how to solve
When I git status, I get this error message:
```
# On branch master
# Your branch and 'origin/master' have diverged,
# and have 1 and 2 different commits each, respectively.
#
# Untracked files:
# (use "git add <file>..." to include in what will be ... | ```
rm .DS_Store
git add -A
git commit -m "Added .gitignore file"
```
You'll also want to expressly add `.DS_Store` to your `.gitignore` so that when `.DS_Store`is inevitably created in the future, it won't get in the way of your commits. |
13805750 | git fails to detect renaming | 125 | 2012-12-10 17:14:00 | <p>One branch (<code>refactoringBranch</code>) had a complete directory restructure. Files were moved chaotically, but the content was preserved.</p>
<p>I tried to merge:
<code>git merge --no-ff -Xrename-threshold=15 -Xpatience -Xignore-space-change refactoringBranch</code></p>
<p><code>git status</code> shows about ha... | 91,711 | 1,065,291 | 2024-11-02 01:19:30 | 13,808,715 | 62 | 2012-12-10 20:30:56 | 52,251 | 2012-12-10 20:30:56 | https://stackoverflow.com/q/13805750 | https://stackoverflow.com/a/13808715 | <p>Rename detection:</p>
<p>My best guess is that rename detection is failing due to the very large number of candidates. The git source code is a little hard to follow in places, but it does appear that there are some hard-coded limits used in particular search steps of the rename detection algorithm (see <a href="ht... | <p>Rename detection:</p> <p>My best guess is that rename detection is failing due to the very large number of candidates. The git source code is a little hard to follow in places, but it does appear that there are some hard-coded limits used in particular search steps of the rename detection algorithm (see <a href="ht... | 119 | git | <h1>git fails to detect renaming</h1>
<p>One branch (<code>refactoringBranch</code>) had a complete directory restructure. Files were moved chaotically, but the content was preserved.</p>
<p>I tried to merge:
<code>git merge --no-ff -Xrename-threshold=15 -Xpatience -Xignore-space-change refactoringBranch</code></p>
<p>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,902 | git | # git fails to detect renaming
One branch (`refactoringBranch`) had a complete directory restructure. Files were moved chaotically, but the content was preserved.
I tried to merge:
`git merge --no-ff -Xrename-threshold=15 -Xpatience -Xignore-space-change refactoringBranch`
`git status` shows about half of files rena... | Rename detection:
My best guess is that rename detection is failing due to the very large number of candidates. The git source code is a little hard to follow in places, but it does appear that there are some hard-coded limits used in particular search steps of the rename detection algorithm (see [`diffcore-rename.c`]... |
36626793 | Disable Git LFS for a remote | 60 | 2016-04-14 14:53:09 | <p>I'm trying to push to a second remote that doesn't support Git LFS. Is there a way to disable Git LFS for a specific remote using <code>git config</code>?</p>
| 20,011 | 500,999 | 2018-08-05 15:37:00 | 49,692,403 | 62 | 2018-04-06 12:01:43 | 969,483 | 2018-04-06 12:01:43 | https://stackoverflow.com/q/36626793 | https://stackoverflow.com/a/49692403 | <p>The workaround given by amiuhle works fine for me:</p>
<pre><code>git push --no-verify
</code></pre>
<p>It prevents the pre-push hook of git lfs from trying to upload the files. So link-files are committed, but the actual binaries are missing.</p>
| <p>The workaround given by amiuhle works fine for me:</p> <pre><code>git push --no-verify </code></pre> <p>It prevents the pre-push hook of git lfs from trying to upload the files. So link-files are committed, but the actual binaries are missing.</p> | 119, 115244 | git, git-lfs | <h1>Disable Git LFS for a remote</h1>
<p>I'm trying to push to a second remote that doesn't support Git LFS. Is there a way to disable Git LFS for a specific remote using <code>git config</code>?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,905 | git | # Disable Git LFS for a remote
I'm trying to push to a second remote that doesn't support Git LFS. Is there a way to disable Git LFS for a specific remote using `git config`? | The workaround given by amiuhle works fine for me:
```
git push --no-verify
```
It prevents the pre-push hook of git lfs from trying to upload the files. So link-files are committed, but the actual binaries are missing. |
18000138 | Duplicated file with different case in git origin (bitbucket) | 59 | 2013-08-01 16:57:19 | <p>I am trying to rename files from foobar.php to FooBar.php which is quite a challenge in Git. So far I have found out that I had to set up the git config value of <code>ignorecase</code> to <code>false</code> (why it was set to true on Mac OS X, anyway?). I have managed to rename those files successfully in my local ... | 37,989 | 419,672 | 2025-02-27 18:07:29 | 18,000,286 | 62 | 2013-08-01 17:04:58 | 761,202 | 2018-10-06 06:18:21 | https://stackoverflow.com/q/18000138 | https://stackoverflow.com/a/18000286 | <h2>Case-insensitive, case-preserving</h2>
<p>The problem you likely have is that the default file system on a mac is case-insensitive but case preserving; it is not possible in that circumstance for <code>file.php</code> and <code>File.php</code> to exist at the same time - they are considered the same file.</p>
<p>Th... | <h2>Case-insensitive, case-preserving</h2> <p>The problem you likely have is that the default file system on a mac is case-insensitive but case preserving; it is not possible in that circumstance for <code>file.php</code> and <code>File.php</code> to exist at the same time - they are considered the same file.</p> <p>Th... | 119 | git | <h1>Duplicated file with different case in git origin (bitbucket)</h1>
<p>I am trying to rename files from foobar.php to FooBar.php which is quite a challenge in Git. So far I have found out that I had to set up the git config value of <code>ignorecase</code> to <code>false</code> (why it was set to true on Mac OS X, a... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,906 | git | # Duplicated file with different case in git origin (bitbucket)
I am trying to rename files from foobar.php to FooBar.php which is quite a challenge in Git. So far I have found out that I had to set up the git config value of `ignorecase` to `false` (why it was set to true on Mac OS X, anyway?). I have managed to rena... | ## Case-insensitive, case-preserving
The problem you likely have is that the default file system on a mac is case-insensitive but case preserving; it is not possible in that circumstance for `file.php` and `File.php` to exist at the same time - they are considered the same file.
This is easy to demonstrate:
```
$ cd... |
573585 | What's the git equivalent of "svn update -r"? | 56 | 2009-02-21 19:13:43 | <p>I'm a recent git convert. It's great to be able to use git-svn to keep my branches locally without disturbing the svn server. There was a bug that existed in the latest version of the code. I wanted to establish a time when it worked so that I could use git bisect. I couldn't find the right command to move back in t... | 35,629 | 61,728 | 2020-11-18 14:44:06 | 573,595 | 62 | 2009-02-21 19:20:11 | 43,582 | 2009-02-21 19:20:11 | https://stackoverflow.com/q/573585 | https://stackoverflow.com/a/573595 | <pre><code>git checkout HEAD~1
</code></pre>
<p>This will move your current HEAD to one revision earlier.</p>
<pre><code>git checkout <sha>
</code></pre>
<p>This will move your current HEAD to the given revision. Use <code>git log</code> or <code>gitk</code> to find the revision you’re looking for.</p>
| <pre><code>git checkout HEAD~1 </code></pre> <p>This will move your current HEAD to one revision earlier.</p> <pre><code>git checkout <sha> </code></pre> <p>This will move your current HEAD to the given revision. Use <code>git log</code> or <code>gitk</code> to find the revision you’re looking for.</p> | 63, 119, 6452, 31130, 37230 | git, git-checkout, git-svn, svn, svn-update | <h1>What's the git equivalent of "svn update -r"?</h1>
<p>I'm a recent git convert. It's great to be able to use git-svn to keep my branches locally without disturbing the svn server. There was a bug that existed in the latest version of the code. I wanted to establish a time when it worked so that I could use git bise... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,907 | git | # What's the git equivalent of "svn update -r"?
I'm a recent git convert. It's great to be able to use git-svn to keep my branches locally without disturbing the svn server. There was a bug that existed in the latest version of the code. I wanted to establish a time when it worked so that I could use git bisect. I cou... | ```
git checkout HEAD~1
```
This will move your current HEAD to one revision earlier.
```
git checkout <sha>
```
This will move your current HEAD to the given revision. Use `git log` or `gitk` to find the revision you’re looking for. |
36133271 | How can I rename my branch from TortoiseGit? | 53 | 2016-03-21 14:09:47 | <p>I know the way to <a href="https://stackoverflow.com/questions/6591213/how-do-i-rename-the-local-branch">rename branch from command line</a>, but - since I'm using <a href="https://tortoisegit.org/" rel="noreferrer">TortoiseGit</a> - I'm curious if there are any options to do such thing.</p>
<p>Thanks for the answ... | 32,710 | 5,036,556 | 2024-10-21 09:41:42 | 36,134,207 | 62 | 2016-03-21 14:47:34 | 4,171,786 | 2024-10-21 09:41:42 | https://stackoverflow.com/q/36133271 | https://stackoverflow.com/a/36134207 | <p>In a File Manager, Open your Project root directory (where your <code>.git</code> folder is found).</p>
<p>Right click and go to:</p>
<pre><code>TortoiseGit > Switch/Checkout
</code></pre>
<p>Ensure the <code>Switch To</code> Option to <code>Branch</code>. Then click the little button to the side of the drop down... | <p>In a File Manager, Open your Project root directory (where your <code>.git</code> folder is found).</p> <p>Right click and go to:</p> <pre><code>TortoiseGit > Switch/Checkout </code></pre> <p>Ensure the <code>Switch To</code> Option to <code>Branch</code>. Then click the little button to the side of the drop down... | 119, 4510, 31409, 76220 | git, git-branch, rename, tortoisegit | <h1>How can I rename my branch from TortoiseGit?</h1>
<p>I know the way to <a href="https://stackoverflow.com/questions/6591213/how-do-i-rename-the-local-branch">rename branch from command line</a>, but - since I'm using <a href="https://tortoisegit.org/" rel="noreferrer">TortoiseGit</a> - I'm curious if there are any... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,908 | git | # How can I rename my branch from TortoiseGit?
I know the way to [rename branch from command line](https://stackoverflow.com/questions/6591213/how-do-i-rename-the-local-branch), but - since I'm using [TortoiseGit](https://tortoisegit.org/) - I'm curious if there are any options to do such thing.
Thanks for the answer... | In a File Manager, Open your Project root directory (where your `.git` folder is found).
Right click and go to:
```
TortoiseGit > Switch/Checkout
```
Ensure the `Switch To` Option to `Branch`. Then click the little button to the side of the drop down menu that is denoted by `...`
[ | 51 | 2009-01-30 16:54:32 | <p>I've got <a href="https://github.com/msysgit/" rel="nofollow noreferrer">MSysGit</a> (Git on Windows) working just fine on my home machine, but at work, where we are behind a Microsoft <a href="https://en.wikipedia.org/wiki/Microsoft_Forefront_Threat_Management_Gateway#Microsoft_Proxy_Server" rel="nofollow noreferre... | 119,734 | 1,944 | 2024-08-18 02:30:00 | 496,504 | 62 | 2009-01-30 17:57:26 | 6,309 | 2024-08-18 02:30:00 | https://stackoverflow.com/q/496277 | https://stackoverflow.com/a/496504 | <p>I had the exact same error; but the <a href="http://git-scm.com/docs/git-config" rel="nofollow noreferrer"><code>~/.gitconfig</code> global config file</a> was the key.</p>
<p>If you have a proxy with authentication you need to put in it:</p>
<pre><code>git config --global http.proxy http://login:password@our-proxy-... | <p>I had the exact same error; but the <a href="http://git-scm.com/docs/git-config" rel="nofollow noreferrer"><code>~/.gitconfig</code> global config file</a> was the key.</p> <p>If you have a proxy with authentication you need to put in it:</p> <pre><code>git config --global http.proxy http://login:password@our-proxy-... | 64, 119, 760, 21628 | git, msysgit, proxy, windows | <h1>Git error: fatal: unable to connect a socket (Invalid argument)</h1>
<p>I've got <a href="https://github.com/msysgit/" rel="nofollow noreferrer">MSysGit</a> (Git on Windows) working just fine on my home machine, but at work, where we are behind a Microsoft <a href="https://en.wikipedia.org/wiki/Microsoft_Forefront_... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,910 | git | # Git error: fatal: unable to connect a socket (Invalid argument)
I've got [MSysGit](https://github.com/msysgit/) (Git on Windows) working just fine on my home machine, but at work, where we are behind a Microsoft [ISA proxy](https://en.wikipedia.org/wiki/Microsoft_Forefront_Threat_Management_Gateway#Microsoft_Proxy_S... | I had the exact same error; but the [`~/.gitconfig` global config file](http://git-scm.com/docs/git-config) was the key.
If you have a proxy with authentication you need to put in it:
```
git config --global http.proxy http://login:password@our-proxy-server:8088
```
And it just works (with '`git clone http:`')
Exam... |
8877828 | How to checkout a remote branch in Git? | 48 | 2012-01-16 09:19:21 | <p>Someone pushed a "new feature" branch to the shared repo:</p>
<pre><code>git push -u new_feature_branch
</code></pre>
<p>Now, I would like to create a copy of this branch on my local machine in order to test the new feature.</p>
<p>What would be the easiest way to do this? (Do I need to <code>fetch</code> / <code... | 188,109 | 247,243 | 2022-01-13 14:05:16 | 8,882,837 | 62 | 2012-01-16 16:14:11 | 424,780 | 2012-01-16 19:42:07 | https://stackoverflow.com/q/8877828 | https://stackoverflow.com/a/8882837 | <p>I generally find it unnecessary to use <code>git fetch</code>. <code>git pull</code> is sufficient. <code>git pull</code> will synchronize your repository with the remote. The <strong>new_feature_branch</strong> will then be available.</p>
<p><code>git checkout new_feature_branch</code> will notice the branch in or... | <p>I generally find it unnecessary to use <code>git fetch</code>. <code>git pull</code> is sufficient. <code>git pull</code> will synchronize your repository with the remote. The <strong>new_feature_branch</strong> will then be available.</p> <p><code>git checkout new_feature_branch</code> will notice the branch in or... | 119, 37230, 76220 | git, git-branch, git-checkout | <h1>How to checkout a remote branch in Git?</h1>
<p>Someone pushed a "new feature" branch to the shared repo:</p>
<pre><code>git push -u new_feature_branch
</code></pre>
<p>Now, I would like to create a copy of this branch on my local machine in order to test the new feature.</p>
<p>What would be the easiest way to ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,911 | git | # How to checkout a remote branch in Git?
Someone pushed a "new feature" branch to the shared repo:
```
git push -u new_feature_branch
```
Now, I would like to create a copy of this branch on my local machine in order to test the new feature.
What would be the easiest way to do this? (Do I need to `fetch` / `pull` ... | I generally find it unnecessary to use `git fetch`. `git pull` is sufficient. `git pull` will synchronize your repository with the remote. The **new_feature_branch** will then be available.
`git checkout new_feature_branch` will notice the branch in origin and create a new local tracking branch for you and switch to t... |
28092485 | How to Prevent Garbage Collection in GIT? | 46 | 2015-01-22 15:26:15 | <p>Git mysteriously runs Garbage collection "from time to time" and deletes and orphaned commits you have.</p>
<p><a href="https://www.kernel.org/pub/software/scm/git/docs/git-gc.html" rel="nofollow noreferrer">https://www.kernel.org/pub/software/scm/git/docs/git-gc.html</a></p>
<p>I'd rather not have my file... | 16,360 | 2,299,820 | 2025-12-08 02:05:11 | 28,092,576 | 62 | 2015-01-22 15:29:54 | 34,397 | 2015-01-22 15:29:54 | https://stackoverflow.com/q/28092485 | https://stackoverflow.com/a/28092576 | <p>From the <a href="https://www.kernel.org/pub/software/scm/git/docs/git-gc.html" rel="noreferrer">very same page you just linked to</a>:</p>
<blockquote>
<p>Some git commands may automatically run git gc; see the --auto flag below for details. If you know what you’re doing and all you want is to disable this behavior... | <p>From the <a href="https://www.kernel.org/pub/software/scm/git/docs/git-gc.html" rel="noreferrer">very same page you just linked to</a>:</p> <blockquote> <p>Some git commands may automatically run git gc; see the --auto flag below for details. If you know what you’re doing and all you want is to disable this behavior... | 119, 1850 | garbage-collection, git | <h1>How to Prevent Garbage Collection in GIT?</h1>
<p>Git mysteriously runs Garbage collection "from time to time" and deletes and orphaned commits you have.</p>
<p><a href="https://www.kernel.org/pub/software/scm/git/docs/git-gc.html" rel="nofollow noreferrer">https://www.kernel.org/pub/software/scm/git/docs... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,912 | git | # How to Prevent Garbage Collection in GIT?
Git mysteriously runs Garbage collection "from time to time" and deletes and orphaned commits you have.
<https://www.kernel.org/pub/software/scm/git/docs/git-gc.html>
I'd rather not have my files deleted by Git. How can I disable automatic garbage collection altogether? | From the [very same page you just linked to](https://www.kernel.org/pub/software/scm/git/docs/git-gc.html):
> Some git commands may automatically run git gc; see the --auto flag below for details. If you know what you’re doing and all you want is to disable this behavior permanently without further considerations, jus... |
7102053 | git pull without remotely compressing objects | 43 | 2011-08-18 03:30:06 | <p>I have a repository full of zip files, re-compressing theses files will be a waste of time.</p>
<p>I've tried to set <em>core.compression = 0</em> on the remote and the local copy without success</p>
<pre><code>git config core.compression 0
git config core.loosecompression 0
</code></pre>
<p><em>git pull</em> sti... | 50,802 | 111,785 | 2023-07-01 13:10:46 | 7,153,033 | 62 | 2011-08-22 20:11:37 | 111,785 | 2021-03-21 14:15:15 | https://stackoverflow.com/q/7102053 | https://stackoverflow.com/a/7153033 | <p>The time problem I had was caused by delta compression.</p>
<p>The solution for me was</p>
<pre><code>echo '*.zip -delta' > .gitattributes
git gc
</code></pre>
<p>I will quote this excellent response
from <a href="https://public-inbox.org/git/20100514051049.GF6075@coredump.intra.peff.net/" rel="noreferrer">Re: se... | <p>The time problem I had was caused by delta compression.</p> <p>The solution for me was</p> <pre><code>echo '*.zip -delta' > .gitattributes git gc </code></pre> <p>I will quote this excellent response from <a href="https://public-inbox.org/git/20100514051049.GF6075@coredump.intra.peff.net/" rel="noreferrer">Re: se... | 119 | git | <h1>git pull without remotely compressing objects</h1>
<p>I have a repository full of zip files, re-compressing theses files will be a waste of time.</p>
<p>I've tried to set <em>core.compression = 0</em> on the remote and the local copy without success</p>
<pre><code>git config core.compression 0
git config core.loo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,914 | git | # git pull without remotely compressing objects
I have a repository full of zip files, re-compressing theses files will be a waste of time.
I've tried to set *core.compression = 0* on the remote and the local copy without success
```
git config core.compression 0
git config core.loosecompression 0
```
*git pull* st... | The time problem I had was caused by delta compression.
The solution for me was
```
echo '*.zip -delta' > .gitattributes
git gc
```
I will quote this excellent response
from [Re: serious performance issues with images, audio files, and other "non-code" data](https://public-inbox.org/git/20100514051049.GF6075@coredum... |
33486633 | Upgrading Oh My Zsh gives me 'not a git repository' error | 42 | 2015-11-02 20:49:01 | <p>Since I upgrade my OSX to El Capitan when I want to update Oh My Zsh <code>upgrade_oh_my_zsh</code> I got the following error:</p>
<pre><code>Upgrading Oh My Zsh
fatal: Not a git repository (or any of the parent directories): .git
There was an error updating. Try again later?
</code></pre>
<p>I never used git befo... | 35,778 | 3,815,379 | 2024-07-27 15:25:54 | 33,487,142 | 62 | 2015-11-02 21:19:44 | 4,010,391 | 2022-12-14 15:22:50 | https://stackoverflow.com/q/33486633 | https://stackoverflow.com/a/33487142 | <p>Looks like your git repo was removed from oh-my-zsh? You can re-add the remote and update to the latest version of Zsh by running:</p>
<pre><code>cd ~/.oh-my-zsh
git init # you've already done this step, so you can skip
git remote add origin https://github.com/ohmyzsh/ohmyzsh.git
git fetch
git reset --hard origin/ma... | <p>Looks like your git repo was removed from oh-my-zsh? You can re-add the remote and update to the latest version of Zsh by running:</p> <pre><code>cd ~/.oh-my-zsh git init # you've already done this step, so you can skip git remote add origin https://github.com/ohmyzsh/ohmyzsh.git git fetch git reset --hard origin/ma... | 119, 93854 | git, oh-my-zsh | <h1>Upgrading Oh My Zsh gives me 'not a git repository' error</h1>
<p>Since I upgrade my OSX to El Capitan when I want to update Oh My Zsh <code>upgrade_oh_my_zsh</code> I got the following error:</p>
<pre><code>Upgrading Oh My Zsh
fatal: Not a git repository (or any of the parent directories): .git
There was an error... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,915 | git | # Upgrading Oh My Zsh gives me 'not a git repository' error
Since I upgrade my OSX to El Capitan when I want to update Oh My Zsh `upgrade_oh_my_zsh` I got the following error:
```
Upgrading Oh My Zsh
fatal: Not a git repository (or any of the parent directories): .git
There was an error updating. Try again later?
```... | Looks like your git repo was removed from oh-my-zsh? You can re-add the remote and update to the latest version of Zsh by running:
```
cd ~/.oh-my-zsh
git init # you've already done this step, so you can skip
git remote add origin https://github.com/ohmyzsh/ohmyzsh.git
git fetch
git reset --hard origin/master
```
Aft... |
47872070 | How to check out a branch with GitPython | 41 | 2017-12-18 16:00:05 | <p>I have cloned a repository with GitPython, now I would like to checkout a branch and update the local repository's working tree with the contents of that branch. Ideally, I'd also be able to check if the branch exists before doing this. This is what I have so far:</p>
<pre><code>import git
repo_clone_url = "git@gi... | 59,077 | 12,149 | 2023-10-05 12:48:38 | 47,872,315 | 62 | 2017-12-18 16:13:13 | 7,200,715 | 2019-02-10 09:18:47 | https://stackoverflow.com/q/47872070 | https://stackoverflow.com/a/47872315 | <p>If the branch exists:</p>
<pre><code>repo.git.checkout('branchename')
</code></pre>
<p>If not:</p>
<pre><code>repo.git.checkout('-b', 'branchename')
</code></pre>
<hr>
<p><em>Basically, with GitPython, if you know how to do it within command line, but not within the API, just use <code>repo.git.action("your com... | <p>If the branch exists:</p> <pre><code>repo.git.checkout('branchename') </code></pre> <p>If not:</p> <pre><code>repo.git.checkout('-b', 'branchename') </code></pre> <hr> <p><em>Basically, with GitPython, if you know how to do it within command line, but not within the API, just use <code>repo.git.action("your com... | 16, 119, 61013 | git, gitpython, python | <h1>How to check out a branch with GitPython</h1>
<p>I have cloned a repository with GitPython, now I would like to checkout a branch and update the local repository's working tree with the contents of that branch. Ideally, I'd also be able to check if the branch exists before doing this. This is what I have so far:</p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,916 | git | # How to check out a branch with GitPython
I have cloned a repository with GitPython, now I would like to checkout a branch and update the local repository's working tree with the contents of that branch. Ideally, I'd also be able to check if the branch exists before doing this. This is what I have so far:
```
import... | If the branch exists:
```
repo.git.checkout('branchename')
```
If not:
```
repo.git.checkout('-b', 'branchename')
```
---
*Basically, with GitPython, if you know how to do it within command line, but not within the API, just use `repo.git.action("your command without leading 'git' and 'action'")`, example: `git lo... |
1312633 | Examining a changeset in HG | 41 | 2009-08-21 15:24:18 | <p>How can I examine a changeset in mercurial without looking up its parent? In mercurial, what's the equivalent of</p>
<pre><code>git show HEAD^
</code></pre>
<p>Git-show gives the changeset metadata and the diff as well.</p>
| 24,393 | 125,844 | 2019-11-19 19:33:44 | 1,313,873 | 62 | 2009-08-21 19:39:38 | 13,498 | 2018-02-22 10:07:49 | https://stackoverflow.com/q/1312633 | https://stackoverflow.com/a/1313873 | <p>Your question has two parts. First, how to get the metadata and diff for a changeset all at once:</p>
<pre><code>hg log --patch --rev tip
</code></pre>
<p>You can shorten the options:</p>
<pre><code>hg log -pr tip
</code></pre>
<p>The second part of the question is how to say "the parent changeset of X" without... | <p>Your question has two parts. First, how to get the metadata and diff for a changeset all at once:</p> <pre><code>hg log --patch --rev tip </code></pre> <p>You can shorten the options:</p> <pre><code>hg log -pr tip </code></pre> <p>The second part of the question is how to say "the parent changeset of X" without... | 119, 802 | git, mercurial | <h1>Examining a changeset in HG</h1>
<p>How can I examine a changeset in mercurial without looking up its parent? In mercurial, what's the equivalent of</p>
<pre><code>git show HEAD^
</code></pre>
<p>Git-show gives the changeset metadata and the diff as well.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,917 | git | # Examining a changeset in HG
How can I examine a changeset in mercurial without looking up its parent? In mercurial, what's the equivalent of
```
git show HEAD^
```
Git-show gives the changeset metadata and the diff as well. | Your question has two parts. First, how to get the metadata and diff for a changeset all at once:
```
hg log --patch --rev tip
```
You can shorten the options:
```
hg log -pr tip
```
The second part of the question is how to say "the parent changeset of X" without looking it up. For that you can use the [parentrevs... |
2766600 | Git archive of repository with uncommitted changes | 34 | 2010-05-04 15:21:42 | <p>How can I create an archive of the current repository including local uncommitted changes using <code>git archive</code>?</p>
| 16,559 | 79,111 | 2022-05-24 06:22:09 | 12,010,656 | 62 | 2012-08-17 17:46:56 | 1,564,201 | 2012-08-17 17:46:56 | https://stackoverflow.com/q/2766600 | https://stackoverflow.com/a/12010656 | <p>I know this is old, but I think I found a solution.</p>
<p>Run:</p>
<pre><code>stashName=`git stash create`;
git archive <options> $stashName
</code></pre>
<p>Since git wants a solid commit to make an archive, we can make a 'one off' commit using <code>git stash</code>. The <code>create</code> command just... | <p>I know this is old, but I think I found a solution.</p> <p>Run:</p> <pre><code>stashName=`git stash create`; git archive <options> $stashName </code></pre> <p>Since git wants a solid commit to make an archive, we can make a 'one off' commit using <code>git stash</code>. The <code>create</code> command just... | 119 | git | <h1>Git archive of repository with uncommitted changes</h1>
<p>How can I create an archive of the current repository including local uncommitted changes using <code>git archive</code>?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,918 | git | # Git archive of repository with uncommitted changes
How can I create an archive of the current repository including local uncommitted changes using `git archive`? | I know this is old, but I think I found a solution.
Run:
```
stashName=`git stash create`;
git archive <options> $stashName
```
Since git wants a solid commit to make an archive, we can make a 'one off' commit using `git stash`. The `create` command just creates the stash commit (doesn't reset your working directory... |
15384502 | Issues with Git - rebase / squash | 33 | 2013-03-13 11:51:00 | <p>I'm trying to squash a few commits in a git repository.</p>
<p><code>> git rebase -i HEAD~3</code></p>
<p><code>Successfully rebased and updated refs/heads/staging.</code></p>
<p>A file opens titled <code>git-rebase-todo</code> :</p>
<pre><code>pick a2f3467 Require statement incorrect
pick c41212e Require fil... | 7,666 | 1,089,153 | 2022-02-03 17:08:52 | 15,430,849 | 62 | 2013-03-15 11:09:55 | 159,834 | 2013-03-15 11:19:15 | https://stackoverflow.com/q/15384502 | https://stackoverflow.com/a/15430849 | <p>The problem is that when sublimetext2 is started, it doesn't block and immediately returns. Git then thinks that you're done editing the file and performs the rebase. That's why you see the</p>
<pre><code>Successfully rebased and updated refs/heads/staging
</code></pre>
<p>message, before you even edited the file.... | <p>The problem is that when sublimetext2 is started, it doesn't block and immediately returns. Git then thinks that you're done editing the file and performs the rebase. That's why you see the</p> <pre><code>Successfully rebased and updated refs/heads/staging </code></pre> <p>message, before you even edited the file.... | 119, 29934, 78970 | git, git-rebase, sublimetext2 | <h1>Issues with Git - rebase / squash</h1>
<p>I'm trying to squash a few commits in a git repository.</p>
<p><code>> git rebase -i HEAD~3</code></p>
<p><code>Successfully rebased and updated refs/heads/staging.</code></p>
<p>A file opens titled <code>git-rebase-todo</code> :</p>
<pre><code>pick a2f3467 Require s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,919 | git | # Issues with Git - rebase / squash
I'm trying to squash a few commits in a git repository.
`> git rebase -i HEAD~3`
`Successfully rebased and updated refs/heads/staging.`
A file opens titled `git-rebase-todo` :
```
pick a2f3467 Require statement incorrect
pick c41212e Require file in environment
pick 2743221 This... | The problem is that when sublimetext2 is started, it doesn't block and immediately returns. Git then thinks that you're done editing the file and performs the rebase. That's why you see the
```
Successfully rebased and updated refs/heads/staging
```
message, before you even edited the file. Use the [`subl`](http://ww... |
625919 | How to ignore a file which is already committed? | 33 | 2009-03-09 11:52:15 | <p>Previously, the following was my <code>.gitignore</code> file:</p>
<pre><code>...
config/database.yml
.DS_Store
</code></pre>
<p>Later I created an <code>app_config.yml</code> file in the config directory and committed it.</p>
<p>Now, I realized that I don't need the <code>app_config.yml</code> file in the git re... | 14,069 | 60,072 | 2019-02-26 03:51:44 | 625,958 | 62 | 2009-03-09 12:04:01 | 6,309 | 2009-03-09 12:19:16 | https://stackoverflow.com/q/625919 | https://stackoverflow.com/a/625958 | <p>As mentionned in "<a href="http://gitready.com/beginner/2009/03/06/ignoring-doesnt-remove-a-file.html" rel="noreferrer">ignoring doesn't remove a file </a>"<br>
(the following quote the great article from <strong>Nick Quaranto</strong>,<br>
in his blog <a href="http://gitready.com/" rel="noreferrer"><strong>git read... | <p>As mentionned in "<a href="http://gitready.com/beginner/2009/03/06/ignoring-doesnt-remove-a-file.html" rel="noreferrer">ignoring doesn't remove a file </a>"<br> (the following quote the great article from <strong>Nick Quaranto</strong>,<br> in his blog <a href="http://gitready.com/" rel="noreferrer"><strong>git read... | 119, 25056 | git, gitignore | <h1>How to ignore a file which is already committed?</h1>
<p>Previously, the following was my <code>.gitignore</code> file:</p>
<pre><code>...
config/database.yml
.DS_Store
</code></pre>
<p>Later I created an <code>app_config.yml</code> file in the config directory and committed it.</p>
<p>Now, I realized that I don... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,920 | git | # How to ignore a file which is already committed?
Previously, the following was my `.gitignore` file:
```
...
config/database.yml
.DS_Store
```
Later I created an `app_config.yml` file in the config directory and committed it.
Now, I realized that I don't need the `app_config.yml` file in the git repository.
And I... | As mentionned in "[ignoring doesn't remove a file](http://gitready.com/beginner/2009/03/06/ignoring-doesnt-remove-a-file.html) "
(the following quote the great article from **Nick Quaranto**,
in his blog [**git ready**](http://gitready.com/) "learn git one commit at a time"):
> **When you tell Git to ignore files,... |
62639637 | Git - " cannot lock ref is at " on git Pull | 30 | 2020-06-29 13:50:39 | <p>I see the below error when I do git pull on my terminal in intellij.
The project is constantly updated by several developers and I'm sure something is out of sync, but cannot figure out what that is.</p>
<pre><code>error: cannot lock ref 'refs/remotes/origin/feature/SOMETHING-1234': is at e131d16d4b4b8c32e3d16d28559... | 48,766 | 13,548,254 | 2024-08-27 19:51:29 | 62,641,853 | 62 | 2020-06-29 15:47:37 | 1,256,452 | 2020-06-29 15:47:37 | https://stackoverflow.com/q/62639637 | https://stackoverflow.com/a/62641853 | <p>Note: this <em>is</em> a duplicate, but the other question has no accepted answer, so I am posting one here. The problem occurs because someone created a branch (<code>feature/SOMETHING-1234</code> in your example above) that differs <em>only in case</em> from a name that your Git already picked up. For instance, ... | <p>Note: this <em>is</em> a duplicate, but the other question has no accepted answer, so I am posting one here. The problem occurs because someone created a branch (<code>feature/SOMETHING-1234</code> in your example above) that differs <em>only in case</em> from a name that your Git already picked up. For instance, ... | 119 | git | <h1>Git - " cannot lock ref is at " on git Pull</h1>
<p>I see the below error when I do git pull on my terminal in intellij.
The project is constantly updated by several developers and I'm sure something is out of sync, but cannot figure out what that is.</p>
<pre><code>error: cannot lock ref 'refs/remotes/origin/featu... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,921 | git | # Git - " cannot lock ref is at " on git Pull
I see the below error when I do git pull on my terminal in intellij.
The project is constantly updated by several developers and I'm sure something is out of sync, but cannot figure out what that is.
```
error: cannot lock ref 'refs/remotes/origin/feature/SOMETHING-1234':... | Note: this *is* a duplicate, but the other question has no accepted answer, so I am posting one here. The problem occurs because someone created a branch (`feature/SOMETHING-1234` in your example above) that differs *only in case* from a name that your Git already picked up. For instance, you might have `feature/someth... |
25351450 | What does 'adding to the index' really mean in Git? | 30 | 2014-08-17 16:54:49 | <p>I've got a question regarding Git basics.</p>
<p>Basically, what does the action known as "add to the index" mean in Git? I understand it like this:</p>
<p><em>If for any file git calculates SHA-1 sum then basically adding to index means that it calculates SHA-1 sum and add file to the staging area.</em></p>
<p>A... | 24,265 | 1,432,980 | 2015-02-23 07:44:50 | 25,352,119 | 62 | 2014-08-17 18:08:02 | 2,541,573 | 2015-02-23 07:44:50 | https://stackoverflow.com/q/25351450 | https://stackoverflow.com/a/25352119 | <h2>A useful metaphor</h2>
<p>"Adding a file to the index", "staging a file", "adding a file to the staging area" are all synonymous.</p>
<p>I personally prefer the term <em>staging area</em> to <em>index</em> because it lends itself to a useful metaphor. If <em>committing</em> is akin to "taking a snapshot", <em>sta... | <h2>A useful metaphor</h2> <p>"Adding a file to the index", "staging a file", "adding a file to the staging area" are all synonymous.</p> <p>I personally prefer the term <em>staging area</em> to <em>index</em> because it lends itself to a useful metaphor. If <em>committing</em> is akin to "taking a snapshot", <em>sta... | 119 | git | <h1>What does 'adding to the index' really mean in Git?</h1>
<p>I've got a question regarding Git basics.</p>
<p>Basically, what does the action known as "add to the index" mean in Git? I understand it like this:</p>
<p><em>If for any file git calculates SHA-1 sum then basically adding to index means that it calculat... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,922 | git | # What does 'adding to the index' really mean in Git?
I've got a question regarding Git basics.
Basically, what does the action known as "add to the index" mean in Git? I understand it like this:
*If for any file git calculates SHA-1 sum then basically adding to index means that it calculates SHA-1 sum and add file ... | ## A useful metaphor
"Adding a file to the index", "staging a file", "adding a file to the staging area" are all synonymous.
I personally prefer the term *staging area* to *index* because it lends itself to a useful metaphor. If *committing* is akin to "taking a snapshot", *staging* is about "**composing the shot**".... |
4955752 | Set git diff to a default value | 29 | 2011-02-10 10:12:31 | <p>I previously changed my git diff tool with <code>git config --global diff.external <diff-tool-name></code>. I decided I don't like that tool and wanted to switch back.</p>
<p>I tried meddling around and did something like: <code>git config --global diff.external git-diff</code>. Now calling <code>git diff</co... | 16,962 | 453,594 | 2025-08-17 03:43:27 | 4,955,913 | 62 | 2011-02-10 10:27:16 | 520,162 | 2011-02-10 10:27:16 | https://stackoverflow.com/q/4955752 | https://stackoverflow.com/a/4955913 | <p>Try<br>
<code>git config --global --unset diff</code></p>
<p>and</p>
<p><code>git config --global --unset diff.external</code></p>
<p>See the explanation of <a href="http://git-scm.com/docs/git-config" rel="noreferrer"><code>git config</code></a> for further details.</p>
| <p>Try<br> <code>git config --global --unset diff</code></p> <p>and</p> <p><code>git config --global --unset diff.external</code></p> <p>See the explanation of <a href="http://git-scm.com/docs/git-config" rel="noreferrer"><code>git config</code></a> for further details.</p> | 119, 606 | diff, git | <h1>Set git diff to a default value</h1>
<p>I previously changed my git diff tool with <code>git config --global diff.external <diff-tool-name></code>. I decided I don't like that tool and wanted to switch back.</p>
<p>I tried meddling around and did something like: <code>git config --global diff.external git-di... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,925 | git | # Set git diff to a default value
I previously changed my git diff tool with `git config --global diff.external <diff-tool-name>`. I decided I don't like that tool and wanted to switch back.
I tried meddling around and did something like: `git config --global diff.external git-diff`. Now calling `git diff` to see uns... | Try
`git config --global --unset diff`
and
`git config --global --unset diff.external`
See the explanation of [`git config`](http://git-scm.com/docs/git-config) for further details. |
44473483 | What does git fetch exactly do? | 28 | 2017-06-10 12:49:38 | <p>Edit: I have checked this <a href="https://stackoverflow.com/questions/9237348/what-does-fetch-head-in-git-mean">What does FETCH_HEAD in Git mean?</a> before asking the question.<br>
Sorry for the original inaccurate question. </p>
<p>My question is how does fetch really work? Does fetch drop all current log?</... | 35,087 | 7,955,302 | 2019-08-27 09:04:44 | 44,476,803 | 62 | 2017-06-10 18:38:02 | 1,256,452 | 2017-06-10 18:38:02 | https://stackoverflow.com/q/44473483 | https://stackoverflow.com/a/44476803 | <p><code>git fetch</code> itself is really quite simple. The complicated parts come before and after.</p>
<p>The first thing to know here is that Git stores <em>commits</em>. In fact, this is essentially what Git is about: it manages a collection of commits. This collection rarely <em>shrinks:</em> for the most par... | <p><code>git fetch</code> itself is really quite simple. The complicated parts come before and after.</p> <p>The first thing to know here is that Git stores <em>commits</em>. In fact, this is essentially what Git is about: it manages a collection of commits. This collection rarely <em>shrinks:</em> for the most par... | 119, 33720 | git, git-fetch | <h1>What does git fetch exactly do?</h1>
<p>Edit: I have checked this <a href="https://stackoverflow.com/questions/9237348/what-does-fetch-head-in-git-mean">What does FETCH_HEAD in Git mean?</a> before asking the question.<br>
Sorry for the original inaccurate question. </p>
<p>My question is how does fetch really ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,926 | git | # What does git fetch exactly do?
Edit: I have checked this [What does FETCH_HEAD in Git mean?](https://stackoverflow.com/questions/9237348/what-does-fetch-head-in-git-mean) before asking the question.
Sorry for the original inaccurate question.
My question is how does fetch really work? Does fetch drop all current... | `git fetch` itself is really quite simple. The complicated parts come before and after.
The first thing to know here is that Git stores *commits*. In fact, this is essentially what Git is about: it manages a collection of commits. This collection rarely *shrinks:* for the most part, the only thing you ever do with thi... |
27312647 | Get total remote branches in Git | 18 | 2014-12-05 09:29:24 | <p>How can I get the total number remote branches in Git?</p>
<p>To get all the remotes branches, I do this statement below, but I cannot get the count/total of these branches. I tried <em>--count</em>, but it didn't work:</p>
<pre><code> git branch -r
</code></pre>
<p>How would I get just the count of these?</p>
| 19,541 | 1,564,562 | 2023-12-20 11:09:32 | 27,312,659 | 62 | 2014-12-05 09:30:10 | 440,564 | 2022-04-11 20:52:55 | https://stackoverflow.com/q/27312647 | https://stackoverflow.com/a/27312659 | <p>Something like</p>
<pre><code> git branch -r | wc -l
</code></pre>
<p>using a shell.</p>
<p><code>wc -l</code> counts the number of line on its input.</p>
| <p>Something like</p> <pre><code> git branch -r | wc -l </code></pre> <p>using a shell.</p> <p><code>wc -l</code> counts the number of line on its input.</p> | 119 | git | <h1>Get total remote branches in Git</h1>
<p>How can I get the total number remote branches in Git?</p>
<p>To get all the remotes branches, I do this statement below, but I cannot get the count/total of these branches. I tried <em>--count</em>, but it didn't work:</p>
<pre><code> git branch -r
</code></pre>
<p>How wou... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,927 | git | # Get total remote branches in Git
How can I get the total number remote branches in Git?
To get all the remotes branches, I do this statement below, but I cannot get the count/total of these branches. I tried *--count*, but it didn't work:
```
git branch -r
```
How would I get just the count of these? | Something like
```
git branch -r | wc -l
```
using a shell.
`wc -l` counts the number of line on its input. |
7818927 | Git push branch from one remote to another? | 158 | 2011-10-19 09:06:03 | <p>I have the following remotes set up:</p>
<pre><code>$ git remote
korg
rorg
</code></pre>
<p>And the following branches:</p>
<pre><code>$ git branch -a
* (no branch)
remotes/korg/gingerbread
remotes/korg/gingerbread-release
remotes/korg/honeycomb
remotes/korg/honeycomb-mr1-release
remotes/korg/master
... | 63,837 | 81,398 | 2020-09-16 04:51:46 | 7,819,233 | 61 | 2011-10-19 09:33:15 | 291,641 | 2011-10-19 09:33:15 | https://stackoverflow.com/q/7818927 | https://stackoverflow.com/a/7819233 | <p>A quick test making some temporary repositories shows you can construct a refspec that can do this:</p>
<pre><code>$ git push rorg origin/one:refs/heads/one
Counting objects: 5, done.
Writing objects: 100% (3/3), 240 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
To /tmp/ror... | <p>A quick test making some temporary repositories shows you can construct a refspec that can do this:</p> <pre><code>$ git push rorg origin/one:refs/heads/one Counting objects: 5, done. Writing objects: 100% (3/3), 240 bytes, done. Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. To /tmp/ror... | 119, 28898, 41346, 76220 | git, git-branch, git-push, git-remote | <h1>Git push branch from one remote to another?</h1>
<p>I have the following remotes set up:</p>
<pre><code>$ git remote
korg
rorg
</code></pre>
<p>And the following branches:</p>
<pre><code>$ git branch -a
* (no branch)
remotes/korg/gingerbread
remotes/korg/gingerbread-release
remotes/korg/honeycomb
remote... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,928 | git | # Git push branch from one remote to another?
I have the following remotes set up:
```
$ git remote
korg
rorg
```
And the following branches:
```
$ git branch -a
* (no branch)
remotes/korg/gingerbread
remotes/korg/gingerbread-release
remotes/korg/honeycomb
remotes/korg/honeycomb-mr1-release
remotes/korg/... | A quick test making some temporary repositories shows you can construct a refspec that can do this:
```
$ git push rorg origin/one:refs/heads/one
Counting objects: 5, done.
Writing objects: 100% (3/3), 240 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
To /tmp/rorg
* [new bran... |
13385690 | How to use git with gnome-keyring integration | 154 | 2012-11-14 19:15:04 | <p>Git 1.8.0 supports integration with gnome-keyring.</p>
<p><a href="http://www.h-online.com/open/news/item/Git-1-8-0-can-access-Windows-and-GNOME-keyrings-1733879.html" rel="noreferrer">http://www.h-online.com/open/news/item/Git-1-8-0-can-access-Windows-and-GNOME-keyrings-1733879.html</a></p>
<p>After reading the d... | 95,929 | 929,899 | 2025-02-19 04:04:09 | 13,390,889 | 61 | 2012-11-15 02:51:49 | 929,899 | 2016-03-21 20:19:19 | https://stackoverflow.com/q/13385690 | https://stackoverflow.com/a/13390889 | <p>Git 1.8.0 comes with gnome-keyring support but the binary needs to be compiled for your platform.</p>
<p>This is what solved it for me in Archlinux:</p>
<pre><code>$ sudo pacman -S libgnome-keyring
$ cd /usr/share/git/credential/gnome-keyring
$ make
$ git config --global credential.helper /usr/share/git/credential... | <p>Git 1.8.0 comes with gnome-keyring support but the binary needs to be compiled for your platform.</p> <p>This is what solved it for me in Archlinux:</p> <pre><code>$ sudo pacman -S libgnome-keyring $ cd /usr/share/git/credential/gnome-keyring $ make $ git config --global credential.helper /usr/share/git/credential... | 119, 3294 | git, gnome | <h1>How to use git with gnome-keyring integration</h1>
<p>Git 1.8.0 supports integration with gnome-keyring.</p>
<p><a href="http://www.h-online.com/open/news/item/Git-1-8-0-can-access-Windows-and-GNOME-keyrings-1733879.html" rel="noreferrer">http://www.h-online.com/open/news/item/Git-1-8-0-can-access-Windows-and-GNOM... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,929 | git | # How to use git with gnome-keyring integration
Git 1.8.0 supports integration with gnome-keyring.
<http://www.h-online.com/open/news/item/Git-1-8-0-can-access-Windows-and-GNOME-keyrings-1733879.html>
After reading the docs about the git credentials helpers: <http://git-scm.com/docs/gitcredentials.html>
I was not a... | Git 1.8.0 comes with gnome-keyring support but the binary needs to be compiled for your platform.
This is what solved it for me in Archlinux:
```
$ sudo pacman -S libgnome-keyring
$ cd /usr/share/git/credential/gnome-keyring
$ make
$ git config --global credential.helper /usr/share/git/credential/gnome-keyring/git-cr... |
20002557 | How to remove a too large file in a commit when my branch is ahead of master by 5 commits | 117 | 2013-11-15 13:48:13 | <p><strong>Context</strong></p>
<p>I'm working alone on a project and I used github until now to save my work other than on my computer.
Unfortunately, I added a very large file to the local repository : 300mb (which exceed Github's limit).</p>
<p><strong>What I did</strong></p>
<p>I will try to make an history of what... | 125,588 | 2,633,866 | 2024-08-23 05:58:02 | 20,003,313 | 61 | 2013-11-15 14:27:16 | 498,699 | 2013-11-15 14:58:09 | https://stackoverflow.com/q/20002557 | https://stackoverflow.com/a/20003313 | <p>When you deleted your file, that will be a change and that is the unstaged change that git is complaining about. If you do a git status you should see the file listed as removed/deleted. To undo this change you should <code>git checkout -- <filename></code>. Then the file will be back and your branch should... | <p>When you deleted your file, that will be a change and that is the unstaged change that git is complaining about. If you do a git status you should see the file listed as removed/deleted. To undo this change you should <code>git checkout -- <filename></code>. Then the file will be back and your branch should... | 119 | git | <h1>How to remove a too large file in a commit when my branch is ahead of master by 5 commits</h1>
<p><strong>Context</strong></p>
<p>I'm working alone on a project and I used github until now to save my work other than on my computer.
Unfortunately, I added a very large file to the local repository : 300mb (which exce... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,930 | git | # How to remove a too large file in a commit when my branch is ahead of master by 5 commits
**Context**
I'm working alone on a project and I used github until now to save my work other than on my computer.
Unfortunately, I added a very large file to the local repository : 300mb (which exceed Github's limit).
**What ... | When you deleted your file, that will be a change and that is the unstaged change that git is complaining about. If you do a git status you should see the file listed as removed/deleted. To undo this change you should `git checkout -- <filename>`. Then the file will be back and your branch should be clean. You can also... |
15661110 | Line history viewer - Git | 105 | 2013-03-27 14:15:43 | <p>I wondered if any of you knew of a tool that would allow me to select a line in my code and then view a list view of the history of that line on a commit-by-commit basis.</p>
<p>Does anyone know of such a tool?</p>
| 93,764 | 2,005,008 | 2024-12-04 09:33:56 | 15,661,467 | 61 | 2013-03-27 14:32:22 | 438,742 | 2018-08-08 09:40:01 | https://stackoverflow.com/q/15661110 | https://stackoverflow.com/a/15661467 | <p>I know only the IntelliJ IDEA "<a href="https://www.jetbrains.com/help/idea/2017.1/viewing-changes-information.html#changes_history" rel="noreferrer">Viewing Changes History for Selection</a>" feature. </p>
<p>You could also try to use several <code>git blame</code> commands to iterate over history of a fragment.</... | <p>I know only the IntelliJ IDEA "<a href="https://www.jetbrains.com/help/idea/2017.1/viewing-changes-information.html#changes_history" rel="noreferrer">Viewing Changes History for Selection</a>" feature. </p> <p>You could also try to use several <code>git blame</code> commands to iterate over history of a fragment.</... | 81, 110, 119, 9325 | git, ide, line, versioning | <h1>Line history viewer - Git</h1>
<p>I wondered if any of you knew of a tool that would allow me to select a line in my code and then view a list view of the history of that line on a commit-by-commit basis.</p>
<p>Does anyone know of such a tool?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,931 | git | # Line history viewer - Git
I wondered if any of you knew of a tool that would allow me to select a line in my code and then view a list view of the history of that line on a commit-by-commit basis.
Does anyone know of such a tool? | I know only the IntelliJ IDEA "[Viewing Changes History for Selection](https://www.jetbrains.com/help/idea/2017.1/viewing-changes-information.html#changes_history)" feature.
You could also try to use several `git blame` commands to iterate over history of a fragment. |
20870895 | How to diagnose and fix git fatal: unable to read tree | 102 | 2014-01-01 16:54:48 | <p>I'm using <code>git</code> to manage files on a project, and keep running into this problem.</p>
<p>When I run <code>git status</code> I get the message</p>
<pre><code>fatal: unable to read tree e2d920161d41631066945a3cbcd1b043de919570
</code></pre>
<p>As I understand it, I should check the output of <code>git fs... | 165,505 | 1,091,649 | 2025-02-12 12:49:49 | 20,918,469 | 61 | 2014-01-04 07:55:44 | 6,309 | 2016-07-26 19:29:34 | https://stackoverflow.com/q/20870895 | https://stackoverflow.com/a/20918469 | <p>Following my <a href="https://stackoverflow.com/a/1507935/6309">older recommendation</a>, it boils down to being able to find a repo which actually contains the missing elements (here full trees).<br>
This is what is shown in "<a href="https://stackoverflow.com/a/18687206/6309">How to fix corrupted git repository?</... | <p>Following my <a href="https://stackoverflow.com/a/1507935/6309">older recommendation</a>, it boils down to being able to find a repo which actually contains the missing elements (here full trees).<br> This is what is shown in "<a href="https://stackoverflow.com/a/18687206/6309">How to fix corrupted git repository?</... | 119 | git | <h1>How to diagnose and fix git fatal: unable to read tree</h1>
<p>I'm using <code>git</code> to manage files on a project, and keep running into this problem.</p>
<p>When I run <code>git status</code> I get the message</p>
<pre><code>fatal: unable to read tree e2d920161d41631066945a3cbcd1b043de919570
</code></pre>
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 16,932 | git | # How to diagnose and fix git fatal: unable to read tree
I'm using `git` to manage files on a project, and keep running into this problem.
When I run `git status` I get the message
```
fatal: unable to read tree e2d920161d41631066945a3cbcd1b043de919570
```
As I understand it, I should check the output of `git fsck`... | Following my [older recommendation](https://stackoverflow.com/a/1507935/6309), it boils down to being able to find a repo which actually contains the missing elements (here full trees).
This is what is shown in "[How to fix corrupted git repository?](https://stackoverflow.com/a/18687206/6309)".
But if a full clone d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.