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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9764288 | Git reset to previous commit | 66 | 2012-03-19 02:32:35 | <p>I have three commits I made which I attempted to clean up some code. Anyways I managed to completely destroy what I was working on. And I want to delete the past three commits and return to a specific commit SHA1.</p>
<p>How can I restore to that previous commit and delete the history of those 3 commits? (The histo... | 113,300 | 150,062 | 2024-06-22 07:00:37 | 9,764,350 | 43 | 2012-03-19 02:43:18 | 7,595 | 2012-03-19 02:43:18 | https://stackoverflow.com/q/9764288 | https://stackoverflow.com/a/9764350 | <p>Since your commits are pushed remotely you need to remove them. I'll assume your branch is <code>master</code> and it's pushed over <code>origin</code>.</p>
<p>You first need to remove <code>master</code> from <code>origin</code>:</p>
<p><code>git push origin :master</code> (note the colon)</p>
<p>Then you need t... | <p>Since your commits are pushed remotely you need to remove them. I'll assume your branch is <code>master</code> and it's pushed over <code>origin</code>.</p> <p>You first need to remove <code>master</code> from <code>origin</code>:</p> <p><code>git push origin :master</code> (note the colon)</p> <p>Then you need t... | 119 | git | <h1>Git reset to previous commit</h1>
<p>I have three commits I made which I attempted to clean up some code. Anyways I managed to completely destroy what I was working on. And I want to delete the past three commits and return to a specific commit SHA1.</p>
<p>How can I restore to that previous commit and delete the ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,803 | git | # Git reset to previous commit
I have three commits I made which I attempted to clean up some code. Anyways I managed to completely destroy what I was working on. And I want to delete the past three commits and return to a specific commit SHA1.
How can I restore to that previous commit and delete the history of those... | Since your commits are pushed remotely you need to remove them. I'll assume your branch is `master` and it's pushed over `origin`.
You first need to remove `master` from `origin`:
`git push origin :master` (note the colon)
Then you need to get `master` to the status you want, I'll assume the commit hash is `ABCDE`:
... |
40697663 | How to show the size of each commit with "git log"? | 65 | 2016-11-19 20:37:39 | <p>How can I get commit size shown in the output of <code>git log</code>?</p>
<p>You may understand <em>commit size</em> as the diff between its parents and itself, or anything reasonable that tells you <em>how big</em> the commit is.</p>
<p><code>git log</code> has a <code>--log-size</code> option but its the size o... | 65,168 | 418,966 | 2024-02-26 16:20:52 | 40,698,537 | 43 | 2016-11-19 22:18:14 | 14,660 | 2016-11-19 22:40:10 | https://stackoverflow.com/q/40697663 | https://stackoverflow.com/a/40698537 | <p>The "size" of a commit can mean different things. If you mean how much disk storage it takes up... that's very tricky to tell in Git and probably unproductive. Whereas something like SVN stores commits as deltas, when you change a file in Git it stores a new copy of the file as an object in a graph database. One obj... | <p>The "size" of a commit can mean different things. If you mean how much disk storage it takes up... that's very tricky to tell in Git and probably unproductive. Whereas something like SVN stores commits as deltas, when you change a file in Git it stores a new copy of the file as an object in a graph database. One obj... | 119, 47913 | git, git-log | <h1>How to show the size of each commit with "git log"?</h1>
<p>How can I get commit size shown in the output of <code>git log</code>?</p>
<p>You may understand <em>commit size</em> as the diff between its parents and itself, or anything reasonable that tells you <em>how big</em> the commit is.</p>
<p><code>git log</... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,804 | git | # How to show the size of each commit with "git log"?
How can I get commit size shown in the output of `git log`?
You may understand *commit size* as the diff between its parents and itself, or anything reasonable that tells you *how big* the commit is.
`git log` has a `--log-size` option but its the size of the log... | The "size" of a commit can mean different things. If you mean how much disk storage it takes up... that's very tricky to tell in Git and probably unproductive. Whereas something like SVN stores commits as deltas, when you change a file in Git it stores a new copy of the file as an object in a graph database. One object... |
6786555 | Automatic version number both in setup.py (setuptools) AND source code? | 65 | 2011-07-22 06:47:31 | <p><strong>SITUATION:</strong></p>
<p>I have a python library, which is controlled by git, and bundled with distutils/setuptools. And I want to automatically generate version number based on git tags, both for <code>setup.py sdist</code> and alike commands, and for the library itself.</p>
<p>For the first task I can ... | 48,089 | 857,383 | 2021-03-25 11:39:55 | 7,502,821 | 43 | 2011-09-21 15:53:22 | 821,378 | 2016-03-05 14:02:12 | https://stackoverflow.com/q/6786555 | https://stackoverflow.com/a/7502821 | <p>You could also reverse the dependency: put the version in <code>mylib/__init__.py</code>, parse that file in setup.py to get the version parameter, and use git tag $(setup.py --version) on the command line to create your tag.</p>
<pre><code>git tag -a v$(python setup.py --version) -m 'description of version'
</cod... | <p>You could also reverse the dependency: put the version in <code>mylib/__init__.py</code>, parse that file in setup.py to get the version parameter, and use git tag $(setup.py --version) on the command line to create your tag.</p> <pre><code>git tag -a v$(python setup.py --version) -m 'description of version' </cod... | 16, 119, 2869, 5792, 11066 | distutils, git, python, setuptools, version | <h1>Automatic version number both in setup.py (setuptools) AND source code?</h1>
<p><strong>SITUATION:</strong></p>
<p>I have a python library, which is controlled by git, and bundled with distutils/setuptools. And I want to automatically generate version number based on git tags, both for <code>setup.py sdist</code> ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,805 | git | # Automatic version number both in setup.py (setuptools) AND source code?
**SITUATION:**
I have a python library, which is controlled by git, and bundled with distutils/setuptools. And I want to automatically generate version number based on git tags, both for `setup.py sdist` and alike commands, and for the library ... | You could also reverse the dependency: put the version in `mylib/__init__.py`, parse that file in setup.py to get the version parameter, and use git tag $(setup.py --version) on the command line to create your tag.
```
git tag -a v$(python setup.py --version) -m 'description of version'
```
Is there anything more com... |
16160199 | How to quickly undo staged and unstaged changes in git? | 64 | 2013-04-23 03:03:39 | <p>What's the quickest way to undo changes (staged and unstaged) in Git?</p>
<p>Both files unstaged.</p>
<pre><code>$ git status -s
M file1.txt # unstaged
?? oops.txt # unstaged
</code></pre>
<p>One file staged, one file unstaged.</p>
<pre><code>$ git status -s
M file1.txt # staged
?? oops.txt # unstaged
</code><... | 147,362 | 58,678 | 2024-10-14 19:55:30 | 16,162,884 | 43 | 2013-04-23 06:57:32 | 1,965,396 | 2024-10-14 19:55:30 | https://stackoverflow.com/q/16160199 | https://stackoverflow.com/a/16162884 | <p>You need to use two commands: <code>git reset --hard</code> and <code>git clean -fd</code>.<code>git reset --hard</code> will undo all staged changes and <code>git clean -fd</code>, unstaged changes (force delete, and remove directories too). You can create a alias that will do the two commands. For that, just add t... | <p>You need to use two commands: <code>git reset --hard</code> and <code>git clean -fd</code>.<code>git reset --hard</code> will undo all staged changes and <code>git clean -fd</code>, unstaged changes (force delete, and remove directories too). You can create a alias that will do the two commands. For that, just add t... | 119 | git | <h1>How to quickly undo staged and unstaged changes in git?</h1>
<p>What's the quickest way to undo changes (staged and unstaged) in Git?</p>
<p>Both files unstaged.</p>
<pre><code>$ git status -s
M file1.txt # unstaged
?? oops.txt # unstaged
</code></pre>
<p>One file staged, one file unstaged.</p>
<pre><code>$ gi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,806 | git | # How to quickly undo staged and unstaged changes in git?
What's the quickest way to undo changes (staged and unstaged) in Git?
Both files unstaged.
```
$ git status -s
M file1.txt # unstaged
?? oops.txt # unstaged
```
One file staged, one file unstaged.
```
$ git status -s
M file1.txt # staged
?? oops.txt # uns... | You need to use two commands: `git reset --hard` and `git clean -fd`.`git reset --hard` will undo all staged changes and `git clean -fd`, unstaged changes (force delete, and remove directories too). You can create a alias that will do the two commands. For that, just add the following lines in your `.gitconfig`:
```
[... |
55045596 | How to set default remote in git? | 56 | 2019-03-07 14:01:12 | <p>I have multiple remotes in my git repository. If I execute <code>git pull</code>, then it asks for the password of one of my colleagues.</p>
<p>How can I change the remote to <code>black</code>?</p>
| 47,296 | 4,684,797 | 2024-08-13 16:03:05 | 55,045,894 | 43 | 2019-03-07 14:14:45 | 4,265,352 | 2019-03-07 14:14:45 | https://stackoverflow.com/q/55045596 | https://stackoverflow.com/a/55045894 | <p>There is no default remote, each branch can track a specific branch from a remote repo. </p>
<p>If you have created the branch using <code>git checkout -b <branch-name></code> where <code><branch-name></code> is the name of a remote branch then the new branch tracks that branch (from whatever remote hos... | <p>There is no default remote, each branch can track a specific branch from a remote repo. </p> <p>If you have created the branch using <code>git checkout -b <branch-name></code> where <code><branch-name></code> is the name of a remote branch then the new branch tracks that branch (from whatever remote hos... | 119, 1879, 28896 | branch, git, git-pull | <h1>How to set default remote in git?</h1>
<p>I have multiple remotes in my git repository. If I execute <code>git pull</code>, then it asks for the password of one of my colleagues.</p>
<p>How can I change the remote to <code>black</code>?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,807 | git | # How to set default remote in git?
I have multiple remotes in my git repository. If I execute `git pull`, then it asks for the password of one of my colleagues.
How can I change the remote to `black`? | There is no default remote, each branch can track a specific branch from a remote repo.
If you have created the branch using `git checkout -b <branch-name>` where `<branch-name>` is the name of a remote branch then the new branch tracks that branch (from whatever remote hosts it).
If you created the branch locally th... |
6526451 | how to include git commit-number into a c++ executable? | 55 | 2011-06-29 19:55:26 | <p>i use git as a version tracker for my c++ project. </p>
<p>sometimes i need to repeat a calculation and i would like to know which version of the program i used.</p>
<p>what would be a good way to put a # of the commit into the main executable? in other words. i'd like the program to tell me the # of the current c... | 29,314 | 390,066 | 2025-11-05 15:57:28 | 6,526,504 | 43 | 2011-06-29 19:59:54 | 36,723 | 2025-11-05 15:57:28 | https://stackoverflow.com/q/6526451 | https://stackoverflow.com/a/6526504 | <p>Probably the easiest way to do this would be to add to your makefile a rule to generate a C file with the current git commit ID:</p>
<pre class="lang-make prettyprint-override"><code>gitversion.c: .git/HEAD .git/index
echo 'const char *gitversion = "$(shell git rev-parse HEAD)";' >$@
</code></pre>
<... | <p>Probably the easiest way to do this would be to add to your makefile a rule to generate a C file with the current git commit ID:</p> <pre class="lang-make prettyprint-override"><code>gitversion.c: .git/HEAD .git/index echo 'const char *gitversion = "$(shell git rev-parse HEAD)";' >$@ </code></pre> <... | 10, 119, 4301 | c++, git, makefile | <h1>how to include git commit-number into a c++ executable?</h1>
<p>i use git as a version tracker for my c++ project. </p>
<p>sometimes i need to repeat a calculation and i would like to know which version of the program i used.</p>
<p>what would be a good way to put a # of the commit into the main executable? in ot... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,808 | git | # how to include git commit-number into a c++ executable?
i use git as a version tracker for my c++ project.
sometimes i need to repeat a calculation and i would like to know which version of the program i used.
what would be a good way to put a # of the commit into the main executable? in other words. i'd like the ... | Probably the easiest way to do this would be to add to your makefile a rule to generate a C file with the current git commit ID:
```
gitversion.c: .git/HEAD .git/index
echo 'const char *gitversion = "$(shell git rev-parse HEAD)";' >$@
```
Now simply add `gitversion.c` to your build process as normal. Make sure to... |
6548046 | Merging to a branch in git without switching to it | 53 | 2011-07-01 12:38:03 | <p>I have an application running in a git repository on a branch (say <code>dev</code>). The application modifies the content in some the repository and commits them. I now have to merge these changes into another branch (say <code>master</code>) but the snag is that I don't want to <code>git checkout master</code> bef... | 6,833 | 229,602 | 2021-06-23 20:42:00 | 6,550,905 | 43 | 2011-07-01 16:51:49 | 825,246 | 2012-01-10 22:23:13 | https://stackoverflow.com/q/6548046 | https://stackoverflow.com/a/6550905 | <p>The "master" in your case appears to be "fast-forwardable". You could "push" the branch to master.</p>
<pre><code>cd /path_to_dir_with_no_branch_switch/
git push . appbranch:master
</code></pre>
| <p>The "master" in your case appears to be "fast-forwardable". You could "push" the branch to master.</p> <pre><code>cd /path_to_dir_with_no_branch_switch/ git push . appbranch:master </code></pre> | 119, 717, 28897 | git, git-merge, merge | <h1>Merging to a branch in git without switching to it</h1>
<p>I have an application running in a git repository on a branch (say <code>dev</code>). The application modifies the content in some the repository and commits them. I now have to merge these changes into another branch (say <code>master</code>) but the snag ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,809 | git | # Merging to a branch in git without switching to it
I have an application running in a git repository on a branch (say `dev`). The application modifies the content in some the repository and commits them. I now have to merge these changes into another branch (say `master`) but the snag is that I don't want to `git ch... | The "master" in your case appears to be "fast-forwardable". You could "push" the branch to master.
```
cd /path_to_dir_with_no_branch_switch/
git push . appbranch:master
``` |
4110652 | How to substitute text from files in git history? | 53 | 2010-11-05 22:33:50 | <p>I've always used an interface based git client (smartGit) and thus don't have much experience with the git console.</p>
<p>However, I now face the need to substitute a string in all .txt files from history (so, not erasing the whole file but just substituting a string). I found the following command:</p>
<pre><cod... | 37,121 | 45,974 | 2024-11-21 19:44:52 | 4,114,121 | 43 | 2010-11-06 17:04:27 | 298,054 | 2010-11-06 17:04:27 | https://stackoverflow.com/q/4110652 | https://stackoverflow.com/a/4114121 | <p>You can avoid touching undesired files by passing <code>-name "pattern"</code> to <code>find</code>.</p>
<p>This works for me:</p>
<pre><code>git filter-branch --tree-filter "find . -name '*.php' -exec sed -i -e \
's/originalpassword/newpassword/g' {} \;"
</code></pre>
| <p>You can avoid touching undesired files by passing <code>-name "pattern"</code> to <code>find</code>.</p> <p>This works for me:</p> <pre><code>git filter-branch --tree-filter "find . -name '*.php' -exec sed -i -e \ 's/originalpassword/newpassword/g' {} \;" </code></pre> | 119, 16107, 46509, 91259, 105532 | bfg-repo-cleaner, git, git-filter-branch, git-rewrite-history, substitution | <h1>How to substitute text from files in git history?</h1>
<p>I've always used an interface based git client (smartGit) and thus don't have much experience with the git console.</p>
<p>However, I now face the need to substitute a string in all .txt files from history (so, not erasing the whole file but just substituti... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,810 | git | # How to substitute text from files in git history?
I've always used an interface based git client (smartGit) and thus don't have much experience with the git console.
However, I now face the need to substitute a string in all .txt files from history (so, not erasing the whole file but just substituting a string). I ... | You can avoid touching undesired files by passing `-name "pattern"` to `find`.
This works for me:
```
git filter-branch --tree-filter "find . -name '*.php' -exec sed -i -e \
's/originalpassword/newpassword/g' {} \;"
``` |
1977610 | change default git hooks | 48 | 2009-12-29 23:38:22 | <p>Not sure if this is possible in git (I haven't found it but I may be using the wrong vocabulary in my searches), but it be would useful to be able to modify and enable hooks as the defaults for all new repositories (at the time of creation I mean) so these don't have to be customized each time a new repository is cr... | 44,947 | 163,815 | 2016-08-22 07:24:16 | 1,977,655 | 43 | 2009-12-29 23:51:41 | 69,755 | 2012-11-21 00:46:13 | https://stackoverflow.com/q/1977610 | https://stackoverflow.com/a/1977655 | <p>From the <a href="http://www.kernel.org/pub/software/scm/git/docs/v1.6.0.6/git-init.html" rel="noreferrer"><code>git-init</code></a> man page (also works with <a href="http://git-scm.com/docs/git-clone" rel="noreferrer"><code>git-clone</code></a> if you are cloning an existing repo instead of creating a new one from... | <p>From the <a href="http://www.kernel.org/pub/software/scm/git/docs/v1.6.0.6/git-init.html" rel="noreferrer"><code>git-init</code></a> man page (also works with <a href="http://git-scm.com/docs/git-clone" rel="noreferrer"><code>git-clone</code></a> if you are cloning an existing repo instead of creating a new one from... | 119, 43087 | git, githooks | <h1>change default git hooks</h1>
<p>Not sure if this is possible in git (I haven't found it but I may be using the wrong vocabulary in my searches), but it be would useful to be able to modify and enable hooks as the defaults for all new repositories (at the time of creation I mean) so these don't have to be customize... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,811 | git | # change default git hooks
Not sure if this is possible in git (I haven't found it but I may be using the wrong vocabulary in my searches), but it be would useful to be able to modify and enable hooks as the defaults for all new repositories (at the time of creation I mean) so these don't have to be customized each ti... | From the [`git-init`](http://www.kernel.org/pub/software/scm/git/docs/v1.6.0.6/git-init.html) man page (also works with [`git-clone`](http://git-scm.com/docs/git-clone) if you are cloning an existing repo instead of creating a new one from scratch):
```
--template=<template_directory>
Provide the dir... |
11151623 | Does Git flow deletes branch on remote server? | 46 | 2012-06-22 07:08:15 | <p>I am using git along with <b>git flow</b>. Here git flow has a <code>develop</code> branch. Whenever i need to start feature i type</p>
<pre><code>git flow feature start new
</code></pre>
<p>a new branch <code>feature/new</code> is created. Then i do the changes and <b>commit</b> them using</p>
<pre><code>git pus... | 25,454 | 1,177,790 | 2025-06-06 02:56:31 | 11,152,136 | 43 | 2012-06-22 07:46:24 | 477,037 | 2014-05-29 12:03:30 | https://stackoverflow.com/q/11151623 | https://stackoverflow.com/a/11152136 | <p>Looking at the <a href="https://github.com/nvie/gitflow/blob/15aab26490facf285acef56cb5d61025eacb3a69/git-flow-feature#L352">source</a> it seems that the remote feature branch is deleted only if you call <code>git flow feature finish</code> with <code>-F</code>.</p>
<p>However, this fetches the remote before finish... | <p>Looking at the <a href="https://github.com/nvie/gitflow/blob/15aab26490facf285acef56cb5d61025eacb3a69/git-flow-feature#L352">source</a> it seems that the remote feature branch is deleted only if you call <code>git flow feature finish</code> with <code>-F</code>.</p> <p>However, this fetches the remote before finish... | 119, 64339 | git, git-flow | <h1>Does Git flow deletes branch on remote server?</h1>
<p>I am using git along with <b>git flow</b>. Here git flow has a <code>develop</code> branch. Whenever i need to start feature i type</p>
<pre><code>git flow feature start new
</code></pre>
<p>a new branch <code>feature/new</code> is created. Then i do the chan... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,813 | git | # Does Git flow deletes branch on remote server?
I am using git along with **git flow**. Here git flow has a `develop` branch. Whenever i need to start feature i type
```
git flow feature start new
```
a new branch `feature/new` is created. Then i do the changes and **commit** them using
```
git push origin feature... | Looking at the [source](https://github.com/nvie/gitflow/blob/15aab26490facf285acef56cb5d61025eacb3a69/git-flow-feature#L352) it seems that the remote feature branch is deleted only if you call `git flow feature finish` with `-F`.
However, this fetches the remote before finishing the feature. From the [docs](https://gi... |
62264 | Dealing with SVN keyword expansion with git-svn | 45 | 2008-09-15 12:04:31 | <p>I recently asked about <a href="https://stackoverflow.com/questions/39742/does-git-have-anything-like-svn-propset-svnkeywords-or-pre-post-commit-hooks">keyword expansion in Git</a> and I'm willing to accept the design not to really support this idea in Git. </p>
<p>For better or worse, the project I'm working on at... | 20,384 | 4,161 | 2015-12-09 11:20:10 | 72,874 | 43 | 2008-09-16 14:25:23 | 12,089 | 2008-09-16 14:25:23 | https://stackoverflow.com/q/62264 | https://stackoverflow.com/a/72874 | <p>What's going on here: Git is optimized to switch between branches as quickly as possible. In particular, <code>git checkout</code> is designed to not touch any files that are identical in both branches.</p>
<p>Unfortunately, RCS keyword substitution breaks this. For example, using <code>$Date$</code> would require... | <p>What's going on here: Git is optimized to switch between branches as quickly as possible. In particular, <code>git checkout</code> is designed to not touch any files that are identical in both branches.</p> <p>Unfortunately, RCS keyword substitution breaks this. For example, using <code>$Date$</code> would require... | 63, 119, 456 | git, svn, version-control | <h1>Dealing with SVN keyword expansion with git-svn</h1>
<p>I recently asked about <a href="https://stackoverflow.com/questions/39742/does-git-have-anything-like-svn-propset-svnkeywords-or-pre-post-commit-hooks">keyword expansion in Git</a> and I'm willing to accept the design not to really support this idea in Git. </... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,814 | git | # Dealing with SVN keyword expansion with git-svn
I recently asked about [keyword expansion in Git](https://stackoverflow.com/questions/39742/does-git-have-anything-like-svn-propset-svnkeywords-or-pre-post-commit-hooks) and I'm willing to accept the design not to really support this idea in Git.
For better or worse, ... | What's going on here: Git is optimized to switch between branches as quickly as possible. In particular, `git checkout` is designed to not touch any files that are identical in both branches.
Unfortunately, RCS keyword substitution breaks this. For example, using `$Date$` would require `git checkout` to touch every fi... |
25937736 | Is there a way to specify which ssh key should be used for npm install | 38 | 2014-09-19 15:45:42 | <p>I have a private repo that I want to install in my package.json file.</p>
<pre><code>"private-module": "git+ssh://git@bitbucket.org:private/private-module.git"
</code></pre>
<p>By default npm uses your default private key. I want to be able to specify which ssh key npm should use when running <code>npm install</co... | 50,179 | 516,690 | 2026-01-16 08:39:09 | 25,938,257 | 43 | 2014-09-19 16:15:50 | 2,050,455 | 2014-09-19 16:15:50 | https://stackoverflow.com/q/25937736 | https://stackoverflow.com/a/25938257 | <p>Here are a few solutions:</p>
<ul>
<li><p>Add an entry to your <code>~/.ssh/config</code>. For example:</p>
<pre>
Host bitbucket.org
IdentityFile ~/.ssh/bitbucket_key
IdentitiesOnly yes
</pre></li>
<li><p>Use <code>ssh-agent</code> and add your key to the agent instance beforehand.</p></li>
<li><p>Use so... | <p>Here are a few solutions:</p> <ul> <li><p>Add an entry to your <code>~/.ssh/config</code>. For example:</p> <pre> Host bitbucket.org IdentityFile ~/.ssh/bitbucket_key IdentitiesOnly yes </pre></li> <li><p>Use <code>ssh-agent</code> and add your key to the agent instance beforehand.</p></li> <li><p>Use so... | 119, 386, 46426, 61387 | git, node.js, npm, ssh | <h1>Is there a way to specify which ssh key should be used for npm install</h1>
<p>I have a private repo that I want to install in my package.json file.</p>
<pre><code>"private-module": "git+ssh://git@bitbucket.org:private/private-module.git"
</code></pre>
<p>By default npm uses your default private key. I want to be... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,818 | git | # Is there a way to specify which ssh key should be used for npm install
I have a private repo that I want to install in my package.json file.
```
"private-module": "git+ssh://git@bitbucket.org:private/private-module.git"
```
By default npm uses your default private key. I want to be able to specify which ssh key np... | Here are a few solutions:
- Add an entry to your `~/.ssh/config`. For example:
```
Host bitbucket.org
IdentityFile ~/.ssh/bitbucket_key
IdentitiesOnly yes
```
- Use `ssh-agent` and add your key to the agent instance beforehand.
- Use something like [ssh-ident](https://github.com/ccontavalli/ssh-id... |
14768509 | Unable to checkout git submodule path | 38 | 2013-02-08 08:29:53 | <p>I have a problem when working with git submodules.</p>
<p>Whenever i receive a new submodule reference from the upstream repository, executing <code>git submodule update</code> gives the following result:</p>
<pre><code>fatal: reference is not a tree: dd208d46ecdd1ac0d2b2594a610fe4c9150fece1
Unable to checkout 'dd... | 70,104 | 476,310 | 2025-02-12 10:30:57 | 14,776,899 | 43 | 2013-02-08 16:19:12 | 354,393 | 2014-09-09 16:39:05 | https://stackoverflow.com/q/14768509 | https://stackoverflow.com/a/14776899 | <p>When doing <code>git submodule update</code>, git tries to checkout the commit/tree which is saved in the super project (in your example, the one with commit id <code>dd208d4...</code>)</p>
<p>I think you get the error because within the submodule there no such object present. You have to make sure that it is there... | <p>When doing <code>git submodule update</code>, git tries to checkout the commit/tree which is saved in the super project (in your example, the one with commit id <code>dd208d4...</code>)</p> <p>I think you get the error because within the submodule there no such object present. You have to make sure that it is there... | 119, 41612 | git, git-submodules | <h1>Unable to checkout git submodule path</h1>
<p>I have a problem when working with git submodules.</p>
<p>Whenever i receive a new submodule reference from the upstream repository, executing <code>git submodule update</code> gives the following result:</p>
<pre><code>fatal: reference is not a tree: dd208d46ecdd1ac0... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,819 | git | # Unable to checkout git submodule path
I have a problem when working with git submodules.
Whenever i receive a new submodule reference from the upstream repository, executing `git submodule update` gives the following result:
```
fatal: reference is not a tree: dd208d46ecdd1ac0d2b2594a610fe4c9150fece1
Unable to che... | When doing `git submodule update`, git tries to checkout the commit/tree which is saved in the super project (in your example, the one with commit id `dd208d4...`)
I think you get the error because within the submodule there no such object present. You have to make sure that it is there. Usually that means that you ha... |
2760283 | Does Mercurial have an equivalent to git clean? | 38 | 2010-05-03 18:31:32 | <p>hg clean does not seem to exist, which kinda bothers me. Is this a feature that Mercurial doesn't have or did they just name it differently?</p>
| 21,782 | 310,121 | 2018-02-22 10:19:09 | 2,760,320 | 43 | 2010-05-03 18:37:50 | 63,147 | 2018-02-22 10:19:09 | https://stackoverflow.com/q/2760283 | https://stackoverflow.com/a/2760320 | <p>There is no equivalent to <code>git clean</code> in the core Mercurial package. </p>
<p>However, the <a href="https://www.mercurial-scm.org/wiki/PurgeExtension" rel="nofollow noreferrer"><code>hg purge</code></a> extension does what you are after. </p>
<p>There is an <a href="https://bz.mercurial-scm.org/show_bu... | <p>There is no equivalent to <code>git clean</code> in the core Mercurial package. </p> <p>However, the <a href="https://www.mercurial-scm.org/wiki/PurgeExtension" rel="nofollow noreferrer"><code>hg purge</code></a> extension does what you are after. </p> <p>There is an <a href="https://bz.mercurial-scm.org/show_bu... | 119, 802 | git, mercurial | <h1>Does Mercurial have an equivalent to git clean?</h1>
<p>hg clean does not seem to exist, which kinda bothers me. Is this a feature that Mercurial doesn't have or did they just name it differently?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,820 | git | # Does Mercurial have an equivalent to git clean?
hg clean does not seem to exist, which kinda bothers me. Is this a feature that Mercurial doesn't have or did they just name it differently? | There is no equivalent to `git clean` in the core Mercurial package.
However, the [`hg purge`](https://www.mercurial-scm.org/wiki/PurgeExtension) extension does what you are after.
There is an [open issue](https://bz.mercurial-scm.org/show_bug.cgi?id=1665) to make this extension part of the core package. |
22731126 | What is the best practice for writing long commit messages so that they will be displayed correctly? | 37 | 2014-03-29 12:32:12 | <p>I usually write long commit messages in my git bash so that later some one reading my code could easily see what I done. For example in VS 2013 in Windows form application when designing a form I wrote following.</p>
<pre><code>git commit -m "Add Name,age ,height,weight and salary labels with corresponding text... | 37,528 | 2,908,528 | 2024-01-17 21:50:21 | 22,731,217 | 43 | 2014-03-29 12:40:34 | null | 2018-05-31 11:16:31 | https://stackoverflow.com/q/22731126 | https://stackoverflow.com/a/22731217 | <p>The way git displays log messages is that it will take the 1st line and use that in <code>git log --oneline</code>, and then anything else is displayed when using the normal <code>git log</code>, as long as there's a blank line between the first and second parts:</p>
<pre class="lang-none prettyprint-override"><cod... | <p>The way git displays log messages is that it will take the 1st line and use that in <code>git log --oneline</code>, and then anything else is displayed when using the normal <code>git log</code>, as long as there's a blank line between the first and second parts:</p> <pre class="lang-none prettyprint-override"><cod... | 119, 3809, 53850 | commit-message, git, git-commit | <h1>What is the best practice for writing long commit messages so that they will be displayed correctly?</h1>
<p>I usually write long commit messages in my git bash so that later some one reading my code could easily see what I done. For example in VS 2013 in Windows form application when designing a form I wrote follo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,821 | git | # What is the best practice for writing long commit messages so that they will be displayed correctly?
I usually write long commit messages in my git bash so that later some one reading my code could easily see what I done. For example in VS 2013 in Windows form application when designing a form I wrote following.
``... | The way git displays log messages is that it will take the 1st line and use that in `git log --oneline`, and then anything else is displayed when using the normal `git log`, as long as there's a blank line between the first and second parts:
```
Add summary line here
An example of how to write long commit messages.
B... |
5873025 | Heredoc in a Makefile? | 37 | 2011-05-03 17:02:45 | <p>Is this possible at all and how?</p>
<p><strong>Update:</strong> I need this because I create a file both from dynamic and static data. </p>
<p><strong>Use case:</strong> I have a test directory. Each C file produces a test executable. With</p>
<pre><code>SRCS = $(wildcard [a-z]*.c)
</code></pre>
<p>I can add ne... | 29,933 | 220,060 | 2022-10-27 22:44:59 | 7,377,522 | 43 | 2011-09-11 10:08:34 | 439,189 | 2011-09-11 10:08:34 | https://stackoverflow.com/q/5873025 | https://stackoverflow.com/a/7377522 | <p>Another GNU Make solution.</p>
<p>You can do it using the <code>define</code> and <code>export</code> commands as follows:</p>
<pre><code>define GITIGNOREDS
*.o
depend
endef
SRCS = $(wildcard [a-z]*.c)
EXES = $(SRCS:.c=)
export GITIGNOREDS
.gitignore: $(SRCS)
echo $(EXES) | sed 's/ /\n/g' > $@
echo "... | <p>Another GNU Make solution.</p> <p>You can do it using the <code>define</code> and <code>export</code> commands as follows:</p> <pre><code>define GITIGNOREDS *.o depend endef SRCS = $(wildcard [a-z]*.c) EXES = $(SRCS:.c=) export GITIGNOREDS .gitignore: $(SRCS) echo $(EXES) | sed 's/ /\n/g' > $@ echo "... | 4301, 7449, 25056 | gitignore, heredoc, makefile | <h1>Heredoc in a Makefile?</h1>
<p>Is this possible at all and how?</p>
<p><strong>Update:</strong> I need this because I create a file both from dynamic and static data. </p>
<p><strong>Use case:</strong> I have a test directory. Each C file produces a test executable. With</p>
<pre><code>SRCS = $(wildcard [a-z]*.c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,822 | git | # Heredoc in a Makefile?
Is this possible at all and how?
**Update:** I need this because I create a file both from dynamic and static data.
**Use case:** I have a test directory. Each C file produces a test executable. With
```
SRCS = $(wildcard [a-z]*.c)
```
I can add new tests as needed and make will find the n... | Another GNU Make solution.
You can do it using the `define` and `export` commands as follows:
```
define GITIGNOREDS
*.o
depend
endef
SRCS = $(wildcard [a-z]*.c)
EXES = $(SRCS:.c=)
export GITIGNOREDS
.gitignore: $(SRCS)
echo $(EXES) | sed 's/ /\n/g' > $@
echo "$$GITIGNOREDS" >> $@
```
You have to be caref... |
23992934 | gitk display only specified branches | 36 | 2014-06-02 10:59:14 | <p>I want to compare 2 branches using gitk, without the clutter of other branch histories.<br>
I can achieve this via the gui: View > New view > Branches & tags: v0.8.x v0.9.x<br>
I tried the following, but it still shows all branches: <code>gitk --branches v0.8.x v0.9.x</code><br>
What is the correct syntax?</p>
| 29,088 | 1,622,684 | 2025-11-24 20:37:22 | 23,993,076 | 43 | 2014-06-02 11:06:49 | 520,162 | 2014-06-02 11:17:11 | https://stackoverflow.com/q/23992934 | https://stackoverflow.com/a/23993076 | <p><code>gitk v0.8.x v0.9.x</code> does it for me. </p>
<p>However, a closer look on the displayed branches shows me that there are actually not the given branches displayed. In addition, all branches that point to a commit in the history of the two branches are also shown.</p>
<p>So, the command displays all branche... | <p><code>gitk v0.8.x v0.9.x</code> does it for me. </p> <p>However, a closer look on the displayed branches shows me that there are actually not the given branches displayed. In addition, all branches that point to a commit in the history of the two branches are also shown.</p> <p>So, the command displays all branche... | 119, 30785 | git, gitk | <h1>gitk display only specified branches</h1>
<p>I want to compare 2 branches using gitk, without the clutter of other branch histories.<br>
I can achieve this via the gui: View > New view > Branches & tags: v0.8.x v0.9.x<br>
I tried the following, but it still shows all branches: <code>gitk --branches v0.8.x v0.9.... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,823 | git | # gitk display only specified branches
I want to compare 2 branches using gitk, without the clutter of other branch histories.
I can achieve this via the gui: View > New view > Branches & tags: v0.8.x v0.9.x
I tried the following, but it still shows all branches: `gitk --branches v0.8.x v0.9.x`
What is the corre... | `gitk v0.8.x v0.9.x` does it for me.
However, a closer look on the displayed branches shows me that there are actually not the given branches displayed. In addition, all branches that point to a commit in the history of the two branches are also shown.
So, the command displays all branches that are specified includin... |
6505557 | How to tell if git has ever tracked file X | 36 | 2011-06-28 11:16:08 | <p>I've tried googling for a solution to this problem but haven't yet found one.</p>
<p>Given a working directory named '/project', I'm trying to find a way of telling if git has ever in the history of the repository tracked a file named '/project/x/y/fubar'.</p>
<p>Is this possible? It seems like the kind of thing t... | 12,472 | 433,987 | 2023-12-23 12:39:39 | 6,506,320 | 43 | 2011-06-28 12:23:30 | 526,535 | 2023-12-23 12:39:22 | https://stackoverflow.com/q/6505557 | https://stackoverflow.com/a/6506320 | <p>Simplest would be <code>git log --all -- x/y/fubar</code> - if the file was there, it would have give at least one log entry.</p>
| <p>Simplest would be <code>git log --all -- x/y/fubar</code> - if the file was there, it would have give at least one log entry.</p> | 119 | git | <h1>How to tell if git has ever tracked file X</h1>
<p>I've tried googling for a solution to this problem but haven't yet found one.</p>
<p>Given a working directory named '/project', I'm trying to find a way of telling if git has ever in the history of the repository tracked a file named '/project/x/y/fubar'.</p>
<p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,824 | git | # How to tell if git has ever tracked file X
I've tried googling for a solution to this problem but haven't yet found one.
Given a working directory named '/project', I'm trying to find a way of telling if git has ever in the history of the repository tracked a file named '/project/x/y/fubar'.
Is this possible? It s... | Simplest would be `git log --all -- x/y/fubar` - if the file was there, it would have give at least one log entry. |
45107500 | git bisect says Bisecting: a merge base must be tested | 34 | 2017-07-14 16:15:14 | <p>I did a git bisect and got the result</p>
<pre><code>Bisecting: a merge base must be tested
[bbdaf1111eea5365c0c94d6045d6263aab718925] Fix display bug with main-stage
</code></pre>
<p>How can I proceed?</p>
| 10,240 | 288,568 | 2019-05-16 14:56:20 | 45,111,908 | 43 | 2017-07-14 21:36:21 | 1,406,321 | 2019-05-16 14:56:20 | https://stackoverflow.com/q/45107500 | https://stackoverflow.com/a/45111908 | <p>This will happen if the given good and bad revision are not direct descendants of each other.</p>
<p>Let's assume a repository like this (using exemplary names for the commits):</p>
<pre><code>* dffa2 good-commit
* b38f4 a2
* cc19f a1
| * d1f17 bad-commit
| * fbd1f b2
| * f66cc b1
|/
* 09f66 merge-base-commit
</co... | <p>This will happen if the given good and bad revision are not direct descendants of each other.</p> <p>Let's assume a repository like this (using exemplary names for the commits):</p> <pre><code>* dffa2 good-commit * b38f4 a2 * cc19f a1 | * d1f17 bad-commit | * fbd1f b2 | * f66cc b1 |/ * 09f66 merge-base-commit </co... | 119, 47326 | git, git-bisect | <h1>git bisect says Bisecting: a merge base must be tested</h1>
<p>I did a git bisect and got the result</p>
<pre><code>Bisecting: a merge base must be tested
[bbdaf1111eea5365c0c94d6045d6263aab718925] Fix display bug with main-stage
</code></pre>
<p>How can I proceed?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,826 | git | # git bisect says Bisecting: a merge base must be tested
I did a git bisect and got the result
```
Bisecting: a merge base must be tested
[bbdaf1111eea5365c0c94d6045d6263aab718925] Fix display bug with main-stage
```
How can I proceed? | This will happen if the given good and bad revision are not direct descendants of each other.
Let's assume a repository like this (using exemplary names for the commits):
```
* dffa2 good-commit
* b38f4 a2
* cc19f a1
| * d1f17 bad-commit
| * fbd1f b2
| * f66cc b1
|/
* 09f66 merge-base-commit
```
# What "merge base" ... |
21414725 | Show git tags sorted by date | 34 | 2014-01-28 19:15:18 | <p>How to list <strong>git tags in chronological order</strong>? (recent tags first)</p>
<p><code>git tag</code> only displays alphabetical order. </p>
| 16,284 | 1,176,782 | 2024-01-23 17:38:42 | 39,839,178 | 43 | 2016-10-03 19:39:15 | 1,923,095 | 2017-03-09 19:09:36 | https://stackoverflow.com/q/21414725 | https://stackoverflow.com/a/39839178 | <p>The correct answer is:</p>
<pre><code>git tag --sort=-taggerdate
</code></pre>
<p><code>taggerdate</code> is the appropriate field. According to the <a href="https://git-scm.com/docs/git-tag" rel="noreferrer">git tag man page</a>:</p>
<blockquote>
<p>Prefix <code>-</code> to sort in descending order of the val... | <p>The correct answer is:</p> <pre><code>git tag --sort=-taggerdate </code></pre> <p><code>taggerdate</code> is the appropriate field. According to the <a href="https://git-scm.com/docs/git-tag" rel="noreferrer">git tag man page</a>:</p> <blockquote> <p>Prefix <code>-</code> to sort in descending order of the val... | 119, 60718 | git, git-tag | <h1>Show git tags sorted by date</h1>
<p>How to list <strong>git tags in chronological order</strong>? (recent tags first)</p>
<p><code>git tag</code> only displays alphabetical order. </p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,827 | git | # Show git tags sorted by date
How to list **git tags in chronological order**? (recent tags first)
`git tag` only displays alphabetical order. | The correct answer is:
```
git tag --sort=-taggerdate
```
`taggerdate` is the appropriate field. According to the [git tag man page](https://git-scm.com/docs/git-tag):
> Prefix `-` to sort in descending order of the value.
[`git tag`](https://git-scm.com/docs/git-tag) uses the same sorting keys as [`git-for-each-re... |
19523903 | How to temporarily disable git http proxy | 34 | 2013-10-22 16:55:33 | <p>I am using git behind a corporate firewall, and I am successfully cloning external projects by using the http.proxy --global config.</p>
<p>My problem arises when I want to clone through http on the intranet. I suspect that the proxy config interferes with the intranet request.</p>
<p>I know I could reset the conf... | 31,725 | 28,275 | 2018-08-28 17:58:31 | 19,524,910 | 43 | 2013-10-22 17:50:43 | 6,309 | 2013-10-22 17:50:43 | https://stackoverflow.com/q/19523903 | https://stackoverflow.com/a/19524910 | <p>I always set:</p>
<pre><code>no_proxy=.mycompany
</code></pre>
<p>(<code>export</code> if I am on Unix, or a simple <code>set</code> on Windows)</p>
<p>It is enough to bypass the proxy for all intranet url ending with "<code>.mycompany</code>".</p>
<p>See for an example:</p>
<ul>
<li>"<a href="https://stackover... | <p>I always set:</p> <pre><code>no_proxy=.mycompany </code></pre> <p>(<code>export</code> if I am on Unix, or a simple <code>set</code> on Windows)</p> <p>It is enough to bypass the proxy for all intranet url ending with "<code>.mycompany</code>".</p> <p>See for an example:</p> <ul> <li>"<a href="https://stackover... | 119, 24756 | git, http-proxy | <h1>How to temporarily disable git http proxy</h1>
<p>I am using git behind a corporate firewall, and I am successfully cloning external projects by using the http.proxy --global config.</p>
<p>My problem arises when I want to clone through http on the intranet. I suspect that the proxy config interferes with the intr... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,829 | git | # How to temporarily disable git http proxy
I am using git behind a corporate firewall, and I am successfully cloning external projects by using the http.proxy --global config.
My problem arises when I want to clone through http on the intranet. I suspect that the proxy config interferes with the intranet request.
I... | I always set:
```
no_proxy=.mycompany
```
(`export` if I am on Unix, or a simple `set` on Windows)
It is enough to bypass the proxy for all intranet url ending with "`.mycompany`".
See for an example:
- "[Can't update/install using composer behind a corporate firewall](https://stackoverflow.com/a/18458500/6309)"
-... |
29579546 | Git excludesfile for a branch | 31 | 2015-04-11 15:24:32 | <p>I want to ignore certain files within a branch without having to rely on a tracked <code>.gitignore</code> file that will be overwritten during merges with other branches.</p>
<p>I’ve closely followed <a href="https://stackoverflow.com/questions/1836742">a Stack Overflow answer</a> along with <a href="http://cognit... | 20,095 | 3,092,596 | 2022-12-02 12:05:52 | 29,583,813 | 43 | 2015-04-11 22:29:54 | 2,157,640 | 2022-12-02 12:05:52 | https://stackoverflow.com/q/29579546 | https://stackoverflow.com/a/29583813 | <h1>Git does not support per-branch excludes files</h1>
<p>You’re trying to achieve something that Git does not support. The <a href="http://cogniton-mind.tumblr.com/post/1423976659/howto-gitignore-for-different-branches" rel="noreferrer">blog post</a> is the original source of this hoax that <a href="https://stackover... | <h1>Git does not support per-branch excludes files</h1> <p>You’re trying to achieve something that Git does not support. The <a href="http://cogniton-mind.tumblr.com/post/1423976659/howto-gitignore-for-different-branches" rel="noreferrer">blog post</a> is the original source of this hoax that <a href="https://stackover... | 119, 25056, 32868 | git, git-config, gitignore | <h1>Git excludesfile for a branch</h1>
<p>I want to ignore certain files within a branch without having to rely on a tracked <code>.gitignore</code> file that will be overwritten during merges with other branches.</p>
<p>I’ve closely followed <a href="https://stackoverflow.com/questions/1836742">a Stack Overflow answe... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,833 | git | # Git excludesfile for a branch
I want to ignore certain files within a branch without having to rely on a tracked `.gitignore` file that will be overwritten during merges with other branches.
I’ve closely followed [a Stack Overflow answer](https://stackoverflow.com/questions/1836742) along with [the linked blog post... | # Git does not support per-branch excludes files
You’re trying to achieve something that Git does not support. The [blog post](http://cogniton-mind.tumblr.com/post/1423976659/howto-gitignore-for-different-branches) is the original source of this hoax that [the Stack Overflow answer](https://stackoverflow.com/a/4044387... |
7291186 | Git warn before committing if string appears in source (or diff) | 31 | 2011-09-03 04:34:27 | <p>I would like to be prevented† when staging‡ in a <code>git</code> repo if the changes I am about to commit contain a certain string (say, <code>@todo</code> or <code>@hack</code>).</p>
<p>Can someone show me how to achieve this?</p>
<p><em>† or warned.</em><br>
<em>‡ or when committing.</em></p>
| 5,582 | 211,327 | 2024-12-09 14:26:42 | 7,292,992 | 43 | 2011-09-03 12:04:09 | 140,750 | 2021-03-08 15:21:15 | https://stackoverflow.com/q/7291186 | https://stackoverflow.com/a/7292992 | <p>A simple pre-commit hook that checks if the string '@todo' is being added could look like:</p>
<pre><code>#!/bin/sh
. git-sh-setup # for die
if git-diff-index -p -M --cached HEAD -- \
| grep '^+' \
| grep @todo; then
die Blocking commit because string @todo detected in patch
fi
</code></pre>
<p>If this is the... | <p>A simple pre-commit hook that checks if the string '@todo' is being added could look like:</p> <pre><code>#!/bin/sh . git-sh-setup # for die if git-diff-index -p -M --cached HEAD -- \ | grep '^+' \ | grep @todo; then die Blocking commit because string @todo detected in patch fi </code></pre> <p>If this is the... | 119 | git | <h1>Git warn before committing if string appears in source (or diff)</h1>
<p>I would like to be prevented† when staging‡ in a <code>git</code> repo if the changes I am about to commit contain a certain string (say, <code>@todo</code> or <code>@hack</code>).</p>
<p>Can someone show me how to achieve this?</p>
<p><em>†... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,834 | git | # Git warn before committing if string appears in source (or diff)
I would like to be prevented† when staging‡ in a `git` repo if the changes I am about to commit contain a certain string (say, `@todo` or `@hack`).
Can someone show me how to achieve this?
*† or warned.*
*‡ or when committing.* | A simple pre-commit hook that checks if the string '@todo' is being added could look like:
```
#!/bin/sh
. git-sh-setup # for die
if git-diff-index -p -M --cached HEAD -- \
| grep '^+' \
| grep @todo; then
die Blocking commit because string @todo detected in patch
fi
```
If this is the content of `.git/hooks/p... |
1773731 | In git, how do I remove a commit from one branch and apply it to a different branch? | 31 | 2009-11-20 22:55:15 | <p>I have two branches off of master, each one for a different feature, and then I have a synthesis branch that combines the two. I committed something to the synthesis branch, but now I see I would have rather applied that change to one of the branches particular to that feature. Is there a way to do this unapply/ap... | 15,117 | 1,236,375 | 2009-11-20 23:00:44 | 1,773,751 | 43 | 2009-11-20 23:00:20 | 158,676 | 2009-11-20 23:00:20 | https://stackoverflow.com/q/1773731 | https://stackoverflow.com/a/1773751 | <p>Cherry-pick commit to target branch and reset source branch. Assuming, you want to move the latest commit from <code>source</code> branch to <code>target</code>, do:</p>
<pre><code>git checkout target
git cherry-pick source
git checkout source
git reset --hard source^
</code></pre>
<p>If the commit wasn't the las... | <p>Cherry-pick commit to target branch and reset source branch. Assuming, you want to move the latest commit from <code>source</code> branch to <code>target</code>, do:</p> <pre><code>git checkout target git cherry-pick source git checkout source git reset --hard source^ </code></pre> <p>If the commit wasn't the las... | 119, 1879 | branch, git | <h1>In git, how do I remove a commit from one branch and apply it to a different branch?</h1>
<p>I have two branches off of master, each one for a different feature, and then I have a synthesis branch that combines the two. I committed something to the synthesis branch, but now I see I would have rather applied that c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,835 | git | # In git, how do I remove a commit from one branch and apply it to a different branch?
I have two branches off of master, each one for a different feature, and then I have a synthesis branch that combines the two. I committed something to the synthesis branch, but now I see I would have rather applied that change to o... | Cherry-pick commit to target branch and reset source branch. Assuming, you want to move the latest commit from `source` branch to `target`, do:
```
git checkout target
git cherry-pick source
git checkout source
git reset --hard source^
```
If the commit wasn't the last, you will have to use `git rebase -i` instead of... |
7457942 | How to undo a git merge squash? | 30 | 2011-09-17 21:31:28 | <p>I have just done a</p>
<pre><code>git merge --squash feature-branch
</code></pre>
<p>into my <code>develop</code> branch.</p>
<p>The problem is that the above command updated the head without creating a new commit. My intention was to create one single commit to apply to the head of <code>develop</code>.</p>
<p>... | 47,306 | 893,746 | 2015-02-07 17:49:39 | 7,460,508 | 43 | 2011-09-18 09:04:07 | 223,092 | 2011-09-18 09:04:07 | https://stackoverflow.com/q/7457942 | https://stackoverflow.com/a/7460508 | <p>If you run <code>git merge --squash <other-branch></code> the working tree and index are updated with what the result of the merge would be, but it doesn't create the commit. All you need to do is to run:</p>
<pre><code>git commit
</code></pre>
<p>However, if you change your mind before committing and just ... | <p>If you run <code>git merge --squash <other-branch></code> the working tree and index are updated with what the result of the merge would be, but it doesn't create the commit. All you need to do is to run:</p> <pre><code>git commit </code></pre> <p>However, if you change your mind before committing and just ... | 119, 456, 28897 | git, git-merge, version-control | <h1>How to undo a git merge squash?</h1>
<p>I have just done a</p>
<pre><code>git merge --squash feature-branch
</code></pre>
<p>into my <code>develop</code> branch.</p>
<p>The problem is that the above command updated the head without creating a new commit. My intention was to create one single commit to apply to t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,836 | git | # How to undo a git merge squash?
I have just done a
```
git merge --squash feature-branch
```
into my `develop` branch.
The problem is that the above command updated the head without creating a new commit. My intention was to create one single commit to apply to the head of `develop`.
So in short, the log for the... | If you run `git merge --squash <other-branch>` the working tree and index are updated with what the result of the merge would be, but it doesn't create the commit. All you need to do is to run:
```
git commit
```
However, if you change your mind before committing and just want to abort the merge, you can simply run:
... |
20430291 | Using SASS with Git, what files do I ignore and how? | 29 | 2013-12-06 17:46:43 | <p>I've got a framework in my <code>/project</code> directory, where I have multiple <code>.sass-cache</code> folders.</p>
<p>For example, I could have this</p>
<pre><code>/project/-/-/one/.sass-cache
</code></pre>
<p>And this</p>
<pre><code>/project/-/-/two/.sass-cache
</code></pre>
<p>And this</p>
<pre><code>/p... | 29,152 | 988,469 | 2018-09-10 21:59:58 | 20,430,985 | 43 | 2013-12-06 18:25:00 | 845,488 | 2013-12-06 18:25:00 | https://stackoverflow.com/q/20430291 | https://stackoverflow.com/a/20430985 | <p>With <code>.gitignore</code>, a single asterisk is only a wildcard for a specific directory. If your git version is up-to-date, you should be able to use the double asterisk to indicate any level of subdirectories.</p>
<p>Single asterisk will only match files for that directories depth</p>
<pre><code>foo/*/* == fo... | <p>With <code>.gitignore</code>, a single asterisk is only a wildcard for a specific directory. If your git version is up-to-date, you should be able to use the double asterisk to indicate any level of subdirectories.</p> <p>Single asterisk will only match files for that directories depth</p> <pre><code>foo/*/* == fo... | 4, 119, 6367 | css, git, sass | <h1>Using SASS with Git, what files do I ignore and how?</h1>
<p>I've got a framework in my <code>/project</code> directory, where I have multiple <code>.sass-cache</code> folders.</p>
<p>For example, I could have this</p>
<pre><code>/project/-/-/one/.sass-cache
</code></pre>
<p>And this</p>
<pre><code>/project/-/-... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,837 | git | # Using SASS with Git, what files do I ignore and how?
I've got a framework in my `/project` directory, where I have multiple `.sass-cache` folders.
For example, I could have this
```
/project/-/-/one/.sass-cache
```
And this
```
/project/-/-/two/.sass-cache
```
And this
```
/project/three/.sass-cache
```
And I... | With `.gitignore`, a single asterisk is only a wildcard for a specific directory. If your git version is up-to-date, you should be able to use the double asterisk to indicate any level of subdirectories.
Single asterisk will only match files for that directories depth
```
foo/*/* == foo/bar/file.xyz
foo/*/* != foo/ba... |
12433165 | Is there a posh-git equivalent for the Mac? | 29 | 2012-09-14 23:19:12 | <p>I just found (and have fallen hard for) PowerShell with the posh-git module installed. I'd really like something similar on my Mac. Does such an equivalent exist?</p>
| 12,237 | 153,535 | 2018-01-15 21:01:08 | 12,433,427 | 43 | 2012-09-15 00:02:55 | 506,338 | 2012-09-15 00:02:55 | https://stackoverflow.com/q/12433165 | https://stackoverflow.com/a/12433427 | <p>There are certainly ways to get features similar to what posh-git gives you.</p>
<p>For instance, <a href="https://github.com/bobthecow/git-flow-completion/wiki/Install-Bash-git-completion">installing <code>bash-completion</code></a> gives you the ability to <code><tab></code> complete Git commands.</p>
<p>O... | <p>There are certainly ways to get features similar to what posh-git gives you.</p> <p>For instance, <a href="https://github.com/bobthecow/git-flow-completion/wiki/Install-Bash-git-completion">installing <code>bash-completion</code></a> gives you the ability to <code><tab></code> complete Git commands.</p> <p>O... | 119, 369 | git, macos | <h1>Is there a posh-git equivalent for the Mac?</h1>
<p>I just found (and have fallen hard for) PowerShell with the posh-git module installed. I'd really like something similar on my Mac. Does such an equivalent exist?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,838 | git | # Is there a posh-git equivalent for the Mac?
I just found (and have fallen hard for) PowerShell with the posh-git module installed. I'd really like something similar on my Mac. Does such an equivalent exist? | There are certainly ways to get features similar to what posh-git gives you.
For instance, [installing `bash-completion`](https://github.com/bobthecow/git-flow-completion/wiki/Install-Bash-git-completion) gives you the ability to `<tab>` complete Git commands.
Once you install `bash-completion`, you can add this to y... |
13525629 | Understanding git init | 28 | 2012-11-23 08:51:04 | <p>What is <code>git init</code> for exactly? Must I do it once per computer or once per project that uses git? I downloaded my project by <code>git clone</code> and got it working, but now it is storing my project also to <code>C:/Users/myUser/git</code> , is that certain folder or I can change it? </p>
<p>I don't re... | 44,885 | 625,189 | 2020-05-27 08:09:35 | 13,525,947 | 43 | 2012-11-23 09:16:35 | 167,735 | 2013-08-01 05:34:16 | https://stackoverflow.com/q/13525629 | https://stackoverflow.com/a/13525947 | <p>That's actually a lot of questions and misunderstandings. I'm not sure I'd be able to address them all so I'm only going to address what's directly asked.</p>
<ol>
<li><p><strong>git init is for every project</strong></p>
<p>Almost correct. <code>git init</code> is used to start using git on a project that's not u... | <p>That's actually a lot of questions and misunderstandings. I'm not sure I'd be able to address them all so I'm only going to address what's directly asked.</p> <ol> <li><p><strong>git init is for every project</strong></p> <p>Almost correct. <code>git init</code> is used to start using git on a project that's not u... | 119 | git | <h1>Understanding git init</h1>
<p>What is <code>git init</code> for exactly? Must I do it once per computer or once per project that uses git? I downloaded my project by <code>git clone</code> and got it working, but now it is storing my project also to <code>C:/Users/myUser/git</code> , is that certain folder or I ca... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,839 | git | # Understanding git init
What is `git init` for exactly? Must I do it once per computer or once per project that uses git? I downloaded my project by `git clone` and got it working, but now it is storing my project also to `C:/Users/myUser/git` , is that certain folder or I can change it?
I don't really know much abo... | That's actually a lot of questions and misunderstandings. I'm not sure I'd be able to address them all so I'm only going to address what's directly asked.
1. **git init is for every project**
Almost correct. `git init` is used to start using git on a project that's not under git. For projects that are already unde... |
9104266 | How do I access a git repo on a windows share? | 27 | 2012-02-01 22:22:40 | <p>I want to be able to sync a work repo from my Windows 7 desktop to my Windows 7 laptop without pushing my commits to our main server. How do I do this? I can't figure out how to set up a remote path so that git can understand where it is. I generally use Git Bash for dealing with git, not the windows commandline, so... | 14,488 | 129,171 | 2014-11-07 22:09:41 | 9,104,446 | 43 | 2012-02-01 22:38:25 | 1,016,963 | 2012-02-01 22:38:25 | https://stackoverflow.com/q/9104266 | https://stackoverflow.com/a/9104446 | <p>While Git doesn't recognize backslashes, Windows <em>does</em> recognize forward slashes:</p>
<pre><code>git remote add desktop //MyWorkPCName/dev/myrepo
</code></pre>
<p>Git Bash also lets you access windows drives using UNIX-style paths, e.g. <code>C:\Users\bug\repo</code> becomes <code>/c/Users/bug/repo</code>.... | <p>While Git doesn't recognize backslashes, Windows <em>does</em> recognize forward slashes:</p> <pre><code>git remote add desktop //MyWorkPCName/dev/myrepo </code></pre> <p>Git Bash also lets you access windows drives using UNIX-style paths, e.g. <code>C:\Users\bug\repo</code> becomes <code>/c/Users/bug/repo</code>.... | 64, 119, 1575, 34595, 41346 | git, git-remote, share, windows, windows-7 | <h1>How do I access a git repo on a windows share?</h1>
<p>I want to be able to sync a work repo from my Windows 7 desktop to my Windows 7 laptop without pushing my commits to our main server. How do I do this? I can't figure out how to set up a remote path so that git can understand where it is. I generally use Git Ba... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,841 | git | # How do I access a git repo on a windows share?
I want to be able to sync a work repo from my Windows 7 desktop to my Windows 7 laptop without pushing my commits to our main server. How do I do this? I can't figure out how to set up a remote path so that git can understand where it is. I generally use Git Bash for de... | While Git doesn't recognize backslashes, Windows *does* recognize forward slashes:
```
git remote add desktop //MyWorkPCName/dev/myrepo
```
Git Bash also lets you access windows drives using UNIX-style paths, e.g. `C:\Users\bug\repo` becomes `/c/Users/bug/repo`. |
4377573 | How to Link 1 git repository to some other repositories? | 26 | 2010-12-07 14:18:02 | <p>How to Link 1 git repository to some other repositories ?</p>
<p>Assume I have following repositories :</p>
<p><strong>/var/Common.git</strong></p>
<p><strong>/var/Project1.git</strong></p>
<p><strong>/var/Project2.git</strong></p>
<p>Now, I want to use <strong>Common.git</strong> in other repositories. how can... | 37,579 | 365,229 | 2020-10-02 07:06:50 | 4,377,799 | 43 | 2010-12-07 14:38:04 | 119,963 | 2010-12-07 14:38:04 | https://stackoverflow.com/q/4377573 | https://stackoverflow.com/a/4377799 | <p>You're probably looking for <a href="http://git-scm.com/docs/git-submodule">submodules</a>:</p>
<blockquote>
<p>Submodules allow foreign repositories to be embedded within a dedicated subdirectory of the source tree, always pointed at a particular commit.</p>
</blockquote>
<p>A key word there is <em>embedded</em... | <p>You're probably looking for <a href="http://git-scm.com/docs/git-submodule">submodules</a>:</p> <blockquote> <p>Submodules allow foreign repositories to be embedded within a dedicated subdirectory of the source tree, always pointed at a particular commit.</p> </blockquote> <p>A key word there is <em>embedded</em... | 119, 7330 | git, repository | <h1>How to Link 1 git repository to some other repositories?</h1>
<p>How to Link 1 git repository to some other repositories ?</p>
<p>Assume I have following repositories :</p>
<p><strong>/var/Common.git</strong></p>
<p><strong>/var/Project1.git</strong></p>
<p><strong>/var/Project2.git</strong></p>
<p>Now, I want... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,842 | git | # How to Link 1 git repository to some other repositories?
How to Link 1 git repository to some other repositories ?
Assume I have following repositories :
**/var/Common.git**
**/var/Project1.git**
**/var/Project2.git**
Now, I want to use **Common.git** in other repositories. how can I do it ? | You're probably looking for [submodules](http://git-scm.com/docs/git-submodule):
> Submodules allow foreign repositories to be embedded within a dedicated subdirectory of the source tree, always pointed at a particular commit.
A key word there is *embedded*: an actual clone of Common.git would be embedded inside each... |
21486481 | Is it possible to view git diffs using a GUI side-by-side tool on Mac? | 25 | 2014-01-31 17:36:13 | <p>I really hate visualizing diffs using the default UNIX <code>diff</code> tool. Is it possible to do view git diffs using a GUI tool that will nicely display the local and remote side-by-side, similar how it is possible to set the <code>mergetool</code> to be <code>DiffMerge</code> and when you do </p>
<pre><code>g... | 29,406 | 1,312,080 | 2023-03-20 08:14:06 | 21,491,785 | 43 | 2014-01-31 23:12:55 | 679,227 | 2023-03-20 08:14:06 | https://stackoverflow.com/q/21486481 | https://stackoverflow.com/a/21491785 | <p>You could use <code>opendiff</code>. It is a command line tool which opens the GUI of <a href="https://www.google.com/search?q=filemerge" rel="nofollow noreferrer">FileMerge</a>.</p>
<p>You could instruct Git to use it automatically for <code>git-mergetool</code> with:</p>
<pre><code>git config --global merge.tool o... | <p>You could use <code>opendiff</code>. It is a command line tool which opens the GUI of <a href="https://www.google.com/search?q=filemerge" rel="nofollow noreferrer">FileMerge</a>.</p> <p>You could instruct Git to use it automatically for <code>git-mergetool</code> with:</p> <pre><code>git config --global merge.tool o... | 119, 369, 606 | diff, git, macos | <h1>Is it possible to view git diffs using a GUI side-by-side tool on Mac?</h1>
<p>I really hate visualizing diffs using the default UNIX <code>diff</code> tool. Is it possible to do view git diffs using a GUI tool that will nicely display the local and remote side-by-side, similar how it is possible to set the <code>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,843 | git | # Is it possible to view git diffs using a GUI side-by-side tool on Mac?
I really hate visualizing diffs using the default UNIX `diff` tool. Is it possible to do view git diffs using a GUI tool that will nicely display the local and remote side-by-side, similar how it is possible to set the `mergetool` to be `DiffMerg... | You could use `opendiff`. It is a command line tool which opens the GUI of [FileMerge](https://www.google.com/search?q=filemerge).
You could instruct Git to use it automatically for `git-mergetool` with:
```
git config --global merge.tool opendiff
```
If you want it for `git-difftool` as well:
```
git config --glob... |
17320511 | git difference on parameter one dash and two dashes | 25 | 2013-06-26 12:49:47 | <p>in git when I specify a parameter, ie</p>
<blockquote>
<p>git log -n 5</p>
</blockquote>
<p>what is the difference of using a parameter with one dash "-" as opposed to two dashes "--"</p>
<blockquote>
<p>git log --author="Larvae"</p>
</blockquote>
| 4,437 | 523,507 | 2023-06-28 12:07:51 | 17,320,608 | 43 | 2013-06-26 12:53:44 | 457,352 | 2013-06-26 12:53:44 | https://stackoverflow.com/q/17320511 | https://stackoverflow.com/a/17320608 | <p>That's not really git specific. Many programs use the following convention:</p>
<ul>
<li>single-letter parameter: one dash</li>
<li>multi-letter parameter: two dashes</li>
</ul>
<p>This is handy, because it allows you to specify many single-letter parmeters at once with a single dash and all letters of the paramet... | <p>That's not really git specific. Many programs use the following convention:</p> <ul> <li>single-letter parameter: one dash</li> <li>multi-letter parameter: two dashes</li> </ul> <p>This is handy, because it allows you to specify many single-letter parmeters at once with a single dash and all letters of the paramet... | 34, 119, 360 | git, parameters, unix | <h1>git difference on parameter one dash and two dashes</h1>
<p>in git when I specify a parameter, ie</p>
<blockquote>
<p>git log -n 5</p>
</blockquote>
<p>what is the difference of using a parameter with one dash "-" as opposed to two dashes "--"</p>
<blockquote>
<p>git log --author="Larvae"</p>
</blockquote>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,844 | git | # git difference on parameter one dash and two dashes
in git when I specify a parameter, ie
> git log -n 5
what is the difference of using a parameter with one dash "-" as opposed to two dashes "--"
> git log --author="Larvae" | That's not really git specific. Many programs use the following convention:
- single-letter parameter: one dash
- multi-letter parameter: two dashes
This is handy, because it allows you to specify many single-letter parmeters at once with a single dash and all letters of the parameters you need: `ls -al` is equivalen... |
25294227 | git-subtree pull merge conflict | 24 | 2014-08-13 19:08:14 | <p>So I used git-subtree to have various branches of repoB in sub-directories of repoA, like so</p>
<pre><code>git clone repoA
cd repoA
// some commits to repoA here
git subtree add --prefix=src/dirA repoB branchA
</code></pre>
<p>I did a few commits in repoA using</p>
<pre><code>git subtree push --prefix=src/dirA r... | 12,127 | 1,066,647 | 2021-03-09 10:58:39 | 25,311,871 | 43 | 2014-08-14 15:27:22 | 1,066,647 | 2014-08-14 15:27:22 | https://stackoverflow.com/q/25294227 | https://stackoverflow.com/a/25311871 | <p>Ok, so I figured this out. It was a two-pronged problem. First of all, my tree actually looked like this:</p>
<p><img src="https://i.sstatic.net/r78KZ.png" alt="Status Quo"></p>
<p>I had a commit in my tree that touched <code>src/dirA</code>, but was not yet pushed when <code>repoB/branchA</code> had already moved... | <p>Ok, so I figured this out. It was a two-pronged problem. First of all, my tree actually looked like this:</p> <p><img src="https://i.sstatic.net/r78KZ.png" alt="Status Quo"></p> <p>I had a commit in my tree that touched <code>src/dirA</code>, but was not yet pushed when <code>repoB/branchA</code> had already moved... | 119, 68200 | git, git-subtree | <h1>git-subtree pull merge conflict</h1>
<p>So I used git-subtree to have various branches of repoB in sub-directories of repoA, like so</p>
<pre><code>git clone repoA
cd repoA
// some commits to repoA here
git subtree add --prefix=src/dirA repoB branchA
</code></pre>
<p>I did a few commits in repoA using</p>
<pre><... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,845 | git | # git-subtree pull merge conflict
So I used git-subtree to have various branches of repoB in sub-directories of repoA, like so
```
git clone repoA
cd repoA
// some commits to repoA here
git subtree add --prefix=src/dirA repoB branchA
```
I did a few commits in repoA using
```
git subtree push --prefix=src/dirA repo... | Ok, so I figured this out. It was a two-pronged problem. First of all, my tree actually looked like this:

I had a commit in my tree that touched `src/dirA`, but was not yet pushed when `repoB/branchA` had already moved on.
I discovered that `git subtree pull` would not ... |
71155954 | Backticks in git commit message | 23 | 2022-02-17 10:00:42 | <p>I did</p>
<pre><code>git commit -m "Changed function name `sum` to `sum_list`"
</code></pre>
<p>My intention with the backticks was that <code>sum</code> and <code>sum_list</code> be typed in a monospace font when someone views the commit message in GitHub or the like. It works like this in other contexts,... | 5,601 | 16,751,401 | 2023-07-05 09:21:53 | 71,155,997 | 43 | 2022-02-17 10:03:13 | 887,539 | 2022-02-17 10:10:58 | https://stackoverflow.com/q/71155954 | https://stackoverflow.com/a/71155997 | <p>TLDR: Use single quotes:</p>
<pre><code>$ git commit -m 'Changed function name `sum` to `sum_list`'
</code></pre>
<p>Using backticks is a way to tell the shell to execute the content, it's called a command substitution, consider the following:</p>
<pre><code>$ echo "hello `ls` world"
hello Applications
Des... | <p>TLDR: Use single quotes:</p> <pre><code>$ git commit -m 'Changed function name `sum` to `sum_list`' </code></pre> <p>Using backticks is a way to tell the shell to execute the content, it's called a command substitution, consider the following:</p> <pre><code>$ echo "hello `ls` world" hello Applications Des... | 119, 3809, 52059, 53850 | commit-message, git, git-commit, monospace | <h1>Backticks in git commit message</h1>
<p>I did</p>
<pre><code>git commit -m "Changed function name `sum` to `sum_list`"
</code></pre>
<p>My intention with the backticks was that <code>sum</code> and <code>sum_list</code> be typed in a monospace font when someone views the commit message in GitHub or the li... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,846 | git | # Backticks in git commit message
I did
```
git commit -m "Changed function name `sum` to `sum_list`"
```
My intention with the backticks was that `sum` and `sum_list` be typed in a monospace font when someone views the commit message in GitHub or the like. It works like this in other contexts, for example in Markdo... | TLDR: Use single quotes:
```
$ git commit -m 'Changed function name `sum` to `sum_list`'
```
Using backticks is a way to tell the shell to execute the content, it's called a command substitution, consider the following:
```
$ echo "hello `ls` world"
hello Applications
Desktop
Documents
Downloads
Library
Movies
Music... |
38606443 | Failed to connect to bitbucket.org port 443: Network is unreachable | 23 | 2016-07-27 07:25:26 | <p>I am getting issue while pushing code.</p>
<pre><code>git push origin master
fatal: unable to access 'https://xxxxxxxxxx@bitbucket.org/xxxxxx/xxxxxx.git/':
Failed to connect to bitbucket.org port 443: Network is unreachable
</code></pre>
<p>How to avoid that error message?</p>
| 81,984 | 2,489,231 | 2025-05-19 15:15:58 | 38,606,704 | 43 | 2016-07-27 07:38:15 | 6,309 | 2025-05-16 18:23:19 | https://stackoverflow.com/q/38606443 | https://stackoverflow.com/a/38606704 | <p>TL;DR - Try first <code>git push --ipv4</code></p>
<hr />
<p>There have been many issues reporting problems accessing Bitbucket through HTTPS (ref: <a href="https://bitbucket.org/site/master/issues/13060/failed-to-connect-to-bitbucketorg-port-443" rel="nofollow noreferrer">issue 13060</a>, <a href="https://bitbucket... | <p>TL;DR - Try first <code>git push --ipv4</code></p> <hr /> <p>There have been many issues reporting problems accessing Bitbucket through HTTPS (ref: <a href="https://bitbucket.org/site/master/issues/13060/failed-to-connect-to-bitbucketorg-port-443" rel="nofollow noreferrer">issue 13060</a>, <a href="https://bitbucket... | 119, 8337 | bitbucket, git | <h1>Failed to connect to bitbucket.org port 443: Network is unreachable</h1>
<p>I am getting issue while pushing code.</p>
<pre><code>git push origin master
fatal: unable to access 'https://xxxxxxxxxx@bitbucket.org/xxxxxx/xxxxxx.git/':
Failed to connect to bitbucket.org port 443: Network is unreachable
</code></pre>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,847 | git | # Failed to connect to bitbucket.org port 443: Network is unreachable
I am getting issue while pushing code.
```
git push origin master
fatal: unable to access 'https://xxxxxxxxxx@bitbucket.org/xxxxxx/xxxxxx.git/':
Failed to connect to bitbucket.org port 443: Network is unreachable
```
How to avoid that error mess... | TL;DR - Try first `git push --ipv4`
---
There have been many issues reporting problems accessing Bitbucket through HTTPS (ref: [issue 13060](https://bitbucket.org/site/master/issues/13060/failed-to-connect-to-bitbucketorg-port-443), [issue 12184](https://bitbucket.org/site/master/issues/12184/failed-to-connect-to-bit... |
31990372 | Remove old and add new git in android studio | 23 | 2015-08-13 14:00:29 | <p>I have tried to configure android studio with git and messed up.</p>
<p>How to completely remove old git that I could create new one?</p>
| 37,395 | 3,423,115 | 2022-05-22 09:07:22 | 31,991,358 | 43 | 2015-08-13 14:40:07 | 3,686,755 | 2018-01-03 22:50:28 | https://stackoverflow.com/q/31990372 | https://stackoverflow.com/a/31991358 | <p>In order to drop the current git repository and create a new one you need to:</p>
<ul>
<li><p>Go to the project's directory: <code>cd PROJECT_DIRECTORY</code></p></li>
<li><p>Remove all the git specific files: <code>rm -rf $(find . -name ".git*")</code></p></li>
<li><p>Initialize a new git repository: <code>git ini... | <p>In order to drop the current git repository and create a new one you need to:</p> <ul> <li><p>Go to the project's directory: <code>cd PROJECT_DIRECTORY</code></p></li> <li><p>Remove all the git specific files: <code>rm -rf $(find . -name ".git*")</code></p></li> <li><p>Initialize a new git repository: <code>git ini... | 119, 456, 1386, 91905 | android, android-studio, git, version-control | <h1>Remove old and add new git in android studio</h1>
<p>I have tried to configure android studio with git and messed up.</p>
<p>How to completely remove old git that I could create new one?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,848 | git | # Remove old and add new git in android studio
I have tried to configure android studio with git and messed up.
How to completely remove old git that I could create new one? | In order to drop the current git repository and create a new one you need to:
- Go to the project's directory: `cd PROJECT_DIRECTORY`
- Remove all the git specific files: `rm -rf $(find . -name ".git*")`
- Initialize a new git repository: `git init`
This doesn't remove your project's files, only git configs |
36570193 | Merging develop branch into master | 22 | 2016-04-12 10:12:46 | <p>I have a local repo with 2 branches <code>master</code> and <code>develop</code>. </p>
<ul>
<li>in <code>develop</code> branch I have all my Drupal 8 core code</li>
<li>in my <code>master</code> branch I have 1 commit (Initial commit)</li>
</ul>
<p>On my remote repo I have all my Drupal 8 core code in branch <code... | 56,639 | 4,822,666 | 2020-12-04 15:16:31 | 36,570,620 | 43 | 2016-04-12 10:30:35 | 1,011,253 | 2016-04-12 10:30:35 | https://stackoverflow.com/q/36570193 | https://stackoverflow.com/a/36570620 | <p>Summary: you need to switch to your develop branch, pull the code from the remote repo, then merge it into master (locally) and push it back to remote repo (into master branch)</p>
<pre><code>git checkout develop
git pull origin develop
git checkout master
git merge develop
git push origin master
</code></pre>
| <p>Summary: you need to switch to your develop branch, pull the code from the remote repo, then merge it into master (locally) and push it back to remote repo (into master branch)</p> <pre><code>git checkout develop git pull origin develop git checkout master git merge develop git push origin master </code></pre> | 119, 717 | git, merge | <h1>Merging develop branch into master</h1>
<p>I have a local repo with 2 branches <code>master</code> and <code>develop</code>. </p>
<ul>
<li>in <code>develop</code> branch I have all my Drupal 8 core code</li>
<li>in my <code>master</code> branch I have 1 commit (Initial commit)</li>
</ul>
<p>On my remote repo I ha... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,850 | git | # Merging develop branch into master
I have a local repo with 2 branches `master` and `develop`.
- in `develop` branch I have all my Drupal 8 core code
- in my `master` branch I have 1 commit (Initial commit)
On my remote repo I have all my Drupal 8 core code in branch `develop`. How do I get this code in the remote... | Summary: you need to switch to your develop branch, pull the code from the remote repo, then merge it into master (locally) and push it back to remote repo (into master branch)
```
git checkout develop
git pull origin develop
git checkout master
git merge develop
git push origin master
``` |
38006584 | How to clone and integrate external (from git) cmake project into local one | 21 | 2016-06-24 06:06:33 | <p>I faced with a problem when I was trying to use Google Test. </p>
<p>There are lot of manuals on how to use <code>ExternalProject_Add</code> for the adding gtest into the project, however most of these describe a method based on downloading zip archive with gtest and build it.</p>
<p>As we know gtest is github-hos... | 49,004 | 2,920,614 | 2018-11-21 10:42:15 | 38,026,254 | 43 | 2016-06-25 07:51:09 | 5,452,885 | 2016-06-25 07:51:09 | https://stackoverflow.com/q/38006584 | https://stackoverflow.com/a/38026254 | <p>I would go with the first approach. You don't need to specify a build command because cmake is used by default. This could look like:</p>
<pre><code>cmake_minimum_required(VERSION 3.0)
project(GTestProject)
include(ExternalProject)
set(EXTERNAL_INSTALL_LOCATION ${CMAKE_BINARY_DIR}/external)
ExternalProject_Add(g... | <p>I would go with the first approach. You don't need to specify a build command because cmake is used by default. This could look like:</p> <pre><code>cmake_minimum_required(VERSION 3.0) project(GTestProject) include(ExternalProject) set(EXTERNAL_INSTALL_LOCATION ${CMAKE_BINARY_DIR}/external) ExternalProject_Add(g... | 10, 119, 8822, 14210 | c++, cmake, git, googletest | <h1>How to clone and integrate external (from git) cmake project into local one</h1>
<p>I faced with a problem when I was trying to use Google Test. </p>
<p>There are lot of manuals on how to use <code>ExternalProject_Add</code> for the adding gtest into the project, however most of these describe a method based on do... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,853 | git | # How to clone and integrate external (from git) cmake project into local one
I faced with a problem when I was trying to use Google Test.
There are lot of manuals on how to use `ExternalProject_Add` for the adding gtest into the project, however most of these describe a method based on downloading zip archive with g... | I would go with the first approach. You don't need to specify a build command because cmake is used by default. This could look like:
```
cmake_minimum_required(VERSION 3.0)
project(GTestProject)
include(ExternalProject)
set(EXTERNAL_INSTALL_LOCATION ${CMAKE_BINARY_DIR}/external)
ExternalProject_Add(googletest
... |
25323878 | rebase to squash multiple commits on same branch | 21 | 2014-08-15 09:06:20 | <p>Can we use rebase to squash multiple commits into one single commit on the same branch?</p>
<p>Taking an example, i have created two topic branches - issueA_1 and issueA_2 from master. I make a couple of commits in both branches, as can be seen in the diagram(i am using commit names here instead of commit hashes fo... | 23,568 | 2,105,986 | 2014-08-15 09:25:16 | 25,323,915 | 43 | 2014-08-15 09:09:09 | 1,138,252 | 2014-08-15 09:09:09 | https://stackoverflow.com/q/25323878 | https://stackoverflow.com/a/25323915 | <p>Yes, the simplest way I find is to do:</p>
<pre><code>git rebase -i HEAD~3
</code></pre>
<p>This will let you review the last 3 commits and you can then squash them.</p>
| <p>Yes, the simplest way I find is to do:</p> <pre><code>git rebase -i HEAD~3 </code></pre> <p>This will let you review the last 3 commits and you can then squash them.</p> | 119 | git | <h1>rebase to squash multiple commits on same branch</h1>
<p>Can we use rebase to squash multiple commits into one single commit on the same branch?</p>
<p>Taking an example, i have created two topic branches - issueA_1 and issueA_2 from master. I make a couple of commits in both branches, as can be seen in the diagra... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,854 | git | # rebase to squash multiple commits on same branch
Can we use rebase to squash multiple commits into one single commit on the same branch?
Taking an example, i have created two topic branches - issueA_1 and issueA_2 from master. I make a couple of commits in both branches, as can be seen in the diagram(i am using com... | Yes, the simplest way I find is to do:
```
git rebase -i HEAD~3
```
This will let you review the last 3 commits and you can then squash them. |
18518279 | Installing git on a cPanel server | 21 | 2013-08-29 18:18:42 | <p>I need to install git on cPanel but I am finding a lot of information indicating that this is not a simple process.</p>
<p>I have a cPanel/WHM instance on a CentOS distribution and am trying to install git without breaking cPanel. The information I have found says that installing git can break cPanel because of the... | 26,886 | 1,718,570 | 2014-10-15 08:50:05 | 18,528,174 | 43 | 2013-08-30 08:19:01 | 608,692 | 2013-08-30 08:19:01 | https://stackoverflow.com/q/18518279 | https://stackoverflow.com/a/18528174 | <p>I figured out the same problem, but I find out that from the WHM/Cpanel version 11.36+ Git is installed by default in the system and available for all the account.</p>
<p>You have just to create a Git's account (be sure to add remote ssh access) then in your .bashrc you add just this alias</p>
<p><code>alias git="... | <p>I figured out the same problem, but I find out that from the WHM/Cpanel version 11.36+ Git is installed by default in the system and available for all the account.</p> <p>You have just to create a Git's account (be sure to add remote ssh access) then in your .bashrc you add just this alias</p> <p><code>alias git="... | 119, 529, 5652, 12409, 12410 | cpanel, git, installation, rpm, whm | <h1>Installing git on a cPanel server</h1>
<p>I need to install git on cPanel but I am finding a lot of information indicating that this is not a simple process.</p>
<p>I have a cPanel/WHM instance on a CentOS distribution and am trying to install git without breaking cPanel. The information I have found says that ins... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,855 | git | # Installing git on a cPanel server
I need to install git on cPanel but I am finding a lot of information indicating that this is not a simple process.
I have a cPanel/WHM instance on a CentOS distribution and am trying to install git without breaking cPanel. The information I have found says that installing git can ... | I figured out the same problem, but I find out that from the WHM/Cpanel version 11.36+ Git is installed by default in the system and available for all the account.
You have just to create a Git's account (be sure to add remote ssh access) then in your .bashrc you add just this alias
`alias git="/usr/local/cpanel/3rdp... |
16578465 | On OSX using sourcetree / git-svn getting "Can't locate SVN/Core.pm in @INC " | 20 | 2013-05-16 03:20:54 | <p>I'm using OSX and want get a svn repo into a local git repo using <code>sourcetree</code>. </p>
<p>When I add a bookmark using sourcetree using SVN URL, thus <code>sourcetree</code> knows it's a SVN url, but when I click the clone button, it reports an error like following:</p>
<pre><code>Can't locate SVN/Core.pm... | 14,723 | 2,252,692 | 2020-11-05 00:30:39 | 35,842,945 | 43 | 2016-03-07 11:47:57 | 449,347 | 2020-03-25 14:08:37 | https://stackoverflow.com/q/16578465 | https://stackoverflow.com/a/35842945 | <p>I hit this missing <code>SVN/Core.pm</code> issue recently with <em>el capitain</em>. </p>
<p>Fix I used was from <a href="https://paulschreiber.com/blog/2015/11/09/fixing-git-svn-on-os-x-el-capitan/comment-page-1/#comment-437843" rel="nofollow noreferrer">Paul Schreiber's blog</a> :</p>
<pre><code>sudo mkdir /Lib... | <p>I hit this missing <code>SVN/Core.pm</code> issue recently with <em>el capitain</em>. </p> <p>Fix I used was from <a href="https://paulschreiber.com/blog/2015/11/09/fixing-git-svn-on-os-x-el-capitan/comment-page-1/#comment-437843" rel="nofollow noreferrer">Paul Schreiber's blog</a> :</p> <pre><code>sudo mkdir /Lib... | 369, 6452 | git-svn, macos | <h1>On OSX using sourcetree / git-svn getting "Can't locate SVN/Core.pm in @INC "</h1>
<p>I'm using OSX and want get a svn repo into a local git repo using <code>sourcetree</code>. </p>
<p>When I add a bookmark using sourcetree using SVN URL, thus <code>sourcetree</code> knows it's a SVN url, but when I click the clo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,857 | git | # On OSX using sourcetree / git-svn getting "Can't locate SVN/Core.pm in @INC "
I'm using OSX and want get a svn repo into a local git repo using `sourcetree`.
When I add a bookmark using sourcetree using SVN URL, thus `sourcetree` knows it's a SVN url, but when I click the clone button, it reports an error like foll... | I hit this missing `SVN/Core.pm` issue recently with *el capitain*.
Fix I used was from [Paul Schreiber's blog](https://paulschreiber.com/blog/2015/11/09/fixing-git-svn-on-os-x-el-capitan/comment-page-1/#comment-437843) :
```
sudo mkdir /Library/Perl/5.18/auto
sudo ln -s /Applications/Xcode.app/Contents/Developer/Lib... |
8889753 | Only master branch is visible after cloning a Git repo | 20 | 2012-01-17 04:44:45 | <p>I am working on a project and I created a repository with a <code>master</code> branch. Someone who is working on it added a branch named <code>new-branch</code> -- their code changes are in this branch. </p>
<p>However, when I clone the repository:</p>
<pre><code>$ git clone git@github.com:me/my-repo.git
</code><... | 24,155 | 651,174 | 2023-08-11 12:07:54 | 8,889,780 | 43 | 2012-01-17 04:48:22 | 893 | 2013-05-24 14:53:45 | https://stackoverflow.com/q/8889753 | https://stackoverflow.com/a/8889780 | <p>When you clone a repository, all remote branches are created as "remote tracking branches" in your repository. These aren't shown by default, but you can see these with:</p>
<pre><code>git branch -a
</code></pre>
<p>If you do a <code>git checkout new-branch</code>, git will find the remote tracking branch of the s... | <p>When you clone a repository, all remote branches are created as "remote tracking branches" in your repository. These aren't shown by default, but you can see these with:</p> <pre><code>git branch -a </code></pre> <p>If you do a <code>git checkout new-branch</code>, git will find the remote tracking branch of the s... | 119 | git | <h1>Only master branch is visible after cloning a Git repo</h1>
<p>I am working on a project and I created a repository with a <code>master</code> branch. Someone who is working on it added a branch named <code>new-branch</code> -- their code changes are in this branch. </p>
<p>However, when I clone the repository:</p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,858 | git | # Only master branch is visible after cloning a Git repo
I am working on a project and I created a repository with a `master` branch. Someone who is working on it added a branch named `new-branch` -- their code changes are in this branch.
However, when I clone the repository:
```
$ git clone git@github.com:me/my-rep... | When you clone a repository, all remote branches are created as "remote tracking branches" in your repository. These aren't shown by default, but you can see these with:
```
git branch -a
```
If you do a `git checkout new-branch`, git will find the remote tracking branch of the same name, automatically create a new l... |
5361559 | What does the --stdlayout do in git svn clone? | 20 | 2011-03-19 10:33:15 | <p>I just spotted <a href="https://stackoverflow.com/questions/4249129/recover-from-git-svn-clone-without-stdlayout">this question</a> about recovering from a clone done without --stdlayout. I didn't find documentation of this flag - what does it do?</p>
| 16,220 | 11,236 | 2017-03-03 15:18:43 | 5,361,588 | 43 | 2011-03-19 10:40:59 | 2,988 | 2011-03-19 10:40:59 | https://stackoverflow.com/q/5361559 | https://stackoverflow.com/a/5361588 | <p>Subversion doesn't have any concept of <em>branch</em> or <em>tag</em>. Instead, those are typically simulated by simply copying the contents of the repository into a directory.</p>
<p>In order for <code>git svn</code> to be able to recognize branches and tags and the main branch ("trunk"), you have to explicitly t... | <p>Subversion doesn't have any concept of <em>branch</em> or <em>tag</em>. Instead, those are typically simulated by simply copying the contents of the repository into a directory.</p> <p>In order for <code>git svn</code> to be able to recognize branches and tags and the main branch ("trunk"), you have to explicitly t... | 63, 119, 6452 | git, git-svn, svn | <h1>What does the --stdlayout do in git svn clone?</h1>
<p>I just spotted <a href="https://stackoverflow.com/questions/4249129/recover-from-git-svn-clone-without-stdlayout">this question</a> about recovering from a clone done without --stdlayout. I didn't find documentation of this flag - what does it do?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,859 | git | # What does the --stdlayout do in git svn clone?
I just spotted [this question](https://stackoverflow.com/questions/4249129/recover-from-git-svn-clone-without-stdlayout) about recovering from a clone done without --stdlayout. I didn't find documentation of this flag - what does it do? | Subversion doesn't have any concept of *branch* or *tag*. Instead, those are typically simulated by simply copying the contents of the repository into a directory.
In order for `git svn` to be able to recognize branches and tags and the main branch ("trunk"), you have to explicitly tell it where to find them, using th... |
38380009 | Git error when pushing - update_ref failed | 18 | 2016-07-14 16:55:24 | <p>I have a problem when i try to push my local commits, it has probably happened when Android Studio has crushed. Here is the error:</p>
<blockquote>
<p>update_ref failed for ref 'refs/remotes/origin/master': cannot lock
ref 'refs/remotes/origin/master': unable to resolve reference
refs/remotes/origin/master: I... | 28,911 | 6,089,829 | 2023-05-17 15:15:15 | 38,384,517 | 43 | 2016-07-14 21:24:42 | 1,256,452 | 2016-07-14 21:24:42 | https://stackoverflow.com/q/38380009 | https://stackoverflow.com/a/38384517 | <p>Your <code>refs/remotes/origin</code> directory—this is a directory within in your local repository—has some sort of problem. (It's not clear to me what exactly went wrong, but your guess that it happened when Android Studio crashed seems likely to me as well.)</p>
<p>To fix it, you can <em>probably</em> use the s... | <p>Your <code>refs/remotes/origin</code> directory—this is a directory within in your local repository—has some sort of problem. (It's not clear to me what exactly went wrong, but your guess that it happened when Android Studio crashed seems likely to me as well.)</p> <p>To fix it, you can <em>probably</em> use the s... | 119, 91905 | android-studio, git | <h1>Git error when pushing - update_ref failed</h1>
<p>I have a problem when i try to push my local commits, it has probably happened when Android Studio has crushed. Here is the error:</p>
<blockquote>
<p>update_ref failed for ref 'refs/remotes/origin/master': cannot lock
ref 'refs/remotes/origin/master': unable ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,860 | git | # Git error when pushing - update_ref failed
I have a problem when i try to push my local commits, it has probably happened when Android Studio has crushed. Here is the error:
> update_ref failed for ref 'refs/remotes/origin/master': cannot lock
> ref 'refs/remotes/origin/master': unable to resolve reference
> refs/r... | Your `refs/remotes/origin` directory—this is a directory within in your local repository—has some sort of problem. (It's not clear to me what exactly went wrong, but your guess that it happened when Android Studio crashed seems likely to me as well.)
To fix it, you can *probably* use the sequence of commands below. No... |
33972491 | Ideal Android Studio gitignore file | 18 | 2015-11-28 14:36:28 | <p>i recently created an Android project but it is my first time to work with Android Studio, i placed the project in a Git folder to be able work with another developer remotely through Git and i found that the default .gitignore file contains the following:</p>
<pre><code>*.iml
.gradle
/local.properties
/.idea/works... | 17,960 | 1,851,977 | 2015-11-28 14:38:13 | 33,972,511 | 43 | 2015-11-28 14:38:13 | 1,017,973 | 2015-11-28 14:38:13 | https://stackoverflow.com/q/33972491 | https://stackoverflow.com/a/33972511 | <p>As for me, ideal gitignore file is:</p>
<pre><code>### Android ###
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated... | <p>As for me, ideal gitignore file is:</p> <pre><code>### Android ### # Built application files *.apk *.ap_ # Files for the Dalvik VM *.dex # Java class files *.class # Generated files bin/ gen/ # Gradle files .gradle/ build/ # Local configuration file (sdk path, etc) local.properties # Proguard folder generated... | 119, 1386, 8337, 25056, 91905 | android, android-studio, bitbucket, git, gitignore | <h1>Ideal Android Studio gitignore file</h1>
<p>i recently created an Android project but it is my first time to work with Android Studio, i placed the project in a Git folder to be able work with another developer remotely through Git and i found that the default .gitignore file contains the following:</p>
<pre><code... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,861 | git | # Ideal Android Studio gitignore file
i recently created an Android project but it is my first time to work with Android Studio, i placed the project in a Git folder to be able work with another developer remotely through Git and i found that the default .gitignore file contains the following:
```
*.iml
.gradle
/loca... | As for me, ideal gitignore file is:
```
### Android ###
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
pr... |
34975423 | Visual Studio 2015 & Git error: open("somefile.VC.opendb"): Permission denied fatal: Unable to process path myfile.VC.opendb | 17 | 2016-01-24 11:53:18 | <p><strong>Setup:</strong></p>
<ul>
<li>Windows 10</li>
<li>Visual Studio 2015 with update </li>
<li>Running in Administrator mode</li>
</ul>
<hr>
<p>I cannot commit my changes using Visual Studio 2015 because the commit option does not appear.</p>
<p>When I go to the source folder and try to commit from there, I h... | 42,313 | 596,841 | 2023-03-13 10:45:08 | 34,979,320 | 43 | 2016-01-24 17:57:42 | 736,079 | 2016-01-24 17:57:42 | https://stackoverflow.com/q/34975423 | https://stackoverflow.com/a/34979320 | <p>The <code>.opendb</code> file was added in Visual Studio 2015 update 1, but was not added to the default <code>.gitignore</code> file until after the release of update 1.</p>
<p>You can use the updated version, <a href="https://github.com/github/gitignore/blob/f51f0baa5a721f0af6fbf0ae377ecd86c6eaa3b4/VisualStudio.g... | <p>The <code>.opendb</code> file was added in Visual Studio 2015 update 1, but was not added to the default <code>.gitignore</code> file until after the release of update 1.</p> <p>You can use the updated version, <a href="https://github.com/github/gitignore/blob/f51f0baa5a721f0af6fbf0ae377ecd86c6eaa3b4/VisualStudio.g... | 119, 33953, 34469, 108143 | git, visual-c++, visual-studio, visual-studio-2015 | <h1>Visual Studio 2015 & Git error: open("somefile.VC.opendb"): Permission denied fatal: Unable to process path myfile.VC.opendb</h1>
<p><strong>Setup:</strong></p>
<ul>
<li>Windows 10</li>
<li>Visual Studio 2015 with update </li>
<li>Running in Administrator mode</li>
</ul>
<hr>
<p>I cannot commit my changes using ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,862 | git | # Visual Studio 2015 & Git error: open("somefile.VC.opendb"): Permission denied fatal: Unable to process path myfile.VC.opendb
**Setup:**
- Windows 10
- Visual Studio 2015 with update
- Running in Administrator mode
---
I cannot commit my changes using Visual Studio 2015 because the commit option does not appear.
... | The `.opendb` file was added in Visual Studio 2015 update 1, but was not added to the default `.gitignore` file until after the release of update 1.
You can use the updated version, [found here](https://github.com/github/gitignore/blob/f51f0baa5a721f0af6fbf0ae377ecd86c6eaa3b4/VisualStudio.gitignore), the `.opendb` ext... |
21194969 | Visual Studio and libgit2 Git Commit Error In Different Solution | 17 | 2014-01-17 20:10:43 | <p>While commiting from Visual Studio got my GIT repo, I get the following error below. It's weird because I have another copy of the project that uses the same repository and that solution commits just fine, same repo and everything. Clues?</p>
<pre><code>An error occurred. Detailed message: An error was raised by l... | 10,429 | 280,602 | 2015-05-15 06:52:21 | 21,195,602 | 43 | 2014-01-17 20:49:48 | 729,881 | 2014-01-17 20:49:48 | https://stackoverflow.com/q/21194969 | https://stackoverflow.com/a/21195602 | <p>Unfortunately, Visual Studio Tools for Git do not yet support remote repositories using the SSH protocol, only HTTP and HTTPS.</p>
<p>Investigate the <code>.git/config</code> in each repository to ensure that you did not clone one repository with SSH. If you did, try to switch the remote to an HTTPS endpoint.</p>
| <p>Unfortunately, Visual Studio Tools for Git do not yet support remote repositories using the SSH protocol, only HTTP and HTTPS.</p> <p>Investigate the <code>.git/config</code> in each repository to ensure that you did not clone one repository with SSH. If you did, try to switch the remote to an HTTPS endpoint.</p> | 119, 8337, 33953, 93364 | bitbucket, git, visual-studio, visual-studio-2013 | <h1>Visual Studio and libgit2 Git Commit Error In Different Solution</h1>
<p>While commiting from Visual Studio got my GIT repo, I get the following error below. It's weird because I have another copy of the project that uses the same repository and that solution commits just fine, same repo and everything. Clues?</p>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,863 | git | # Visual Studio and libgit2 Git Commit Error In Different Solution
While commiting from Visual Studio got my GIT repo, I get the following error below. It's weird because I have another copy of the project that uses the same repository and that solution commits just fine, same repo and everything. Clues?
```
An error... | Unfortunately, Visual Studio Tools for Git do not yet support remote repositories using the SSH protocol, only HTTP and HTTPS.
Investigate the `.git/config` in each repository to ensure that you did not clone one repository with SSH. If you did, try to switch the remote to an HTTPS endpoint. |
43448971 | Cherry-pick to specific commit from other branch | 15 | 2017-04-17 09:42:10 | <p>Is this possible ? Cherry picking from other branch into specific commit of master branch.
For eg:
Say, I've two branch: </p>
<pre><code> -> master : <commit1>, <commit2>, <commit3>
-> test: <c1>, <c2>, <c3>, <c4>
</code></pre>
<p>And now I want to cherry pick a c... | 34,073 | 2,092,405 | 2017-04-18 11:39:25 | 43,450,729 | 43 | 2017-04-17 11:37:21 | 1,256,452 | 2017-04-17 11:47:44 | https://stackoverflow.com/q/43448971 | https://stackoverflow.com/a/43450729 | <p>You have a fundamental error in how you are thinking Git works.</p>
<blockquote>
<p>Is this possible ? Cherry picking from other branch into specific commit of master branch.</p>
</blockquote>
<p>No: Git <em>cannot</em> change <em>any</em> commit. You can <em>add new commits</em>, and you can <em>copy</em> an e... | <p>You have a fundamental error in how you are thinking Git works.</p> <blockquote> <p>Is this possible ? Cherry picking from other branch into specific commit of master branch.</p> </blockquote> <p>No: Git <em>cannot</em> change <em>any</em> commit. You can <em>add new commits</em>, and you can <em>copy</em> an e... | 119, 456 | git, version-control | <h1>Cherry-pick to specific commit from other branch</h1>
<p>Is this possible ? Cherry picking from other branch into specific commit of master branch.
For eg:
Say, I've two branch: </p>
<pre><code> -> master : <commit1>, <commit2>, <commit3>
-> test: <c1>, <c2>, <c3>, <... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,865 | git | # Cherry-pick to specific commit from other branch
Is this possible ? Cherry picking from other branch into specific commit of master branch.
For eg:
Say, I've two branch:
```
-> master : <commit1>, <commit2>, <commit3>
-> test: <c1>, <c2>, <c3>, <c4>
```
And now I want to cherry pick a commit (eg: `<c3>`) from `t... | You have a fundamental error in how you are thinking Git works.
> Is this possible ? Cherry picking from other branch into specific commit of master branch.
No: Git *cannot* change *any* commit. You can *add new commits*, and you can *copy* an existing commit to make a new commit from it, i.e., add a new commit that ... |
27056788 | Git shows all files as modified after changing file permission | 8 | 2014-11-21 08:14:10 | <p>I changed the file permission to 777 of a non-bare git repository on Ubuntu OS. After that all files in the repository is showing as modified. I don't want to add all files again and commit. I want to commit the files that I have edited. Is there any way to fix this?</p>
| 6,461 | 2,867,261 | 2017-08-28 10:52:52 | 27,056,901 | 43 | 2014-11-21 08:20:41 | 521,209 | 2014-11-21 08:20:41 | https://stackoverflow.com/q/27056788 | https://stackoverflow.com/a/27056901 | <p><code>git config core.fileMode false</code></p>
<p>This tells git to ignore exec-bit changes.</p>
| <p><code>git config core.fileMode false</code></p> <p>This tells git to ignore exec-bit changes.</p> | 119 | git | <h1>Git shows all files as modified after changing file permission</h1>
<p>I changed the file permission to 777 of a non-bare git repository on Ubuntu OS. After that all files in the repository is showing as modified. I don't want to add all files again and commit. I want to commit the files that I have edited. Is ther... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,868 | git | # Git shows all files as modified after changing file permission
I changed the file permission to 777 of a non-bare git repository on Ubuntu OS. After that all files in the repository is showing as modified. I don't want to add all files again and commit. I want to commit the files that I have edited. Is there any way... | `git config core.fileMode false`
This tells git to ignore exec-bit changes. |
23612012 | fatal: Pathspec 'autoload_classmap.php' is in submodule 'module/CocktailMakerModule' | 8 | 2014-05-12 14:40:24 | <p>I have a repository on google code with my project.</p>
<p>I use Git source control.</p>
<p>It seems that when I try to add files to git from a specific directory, I get the following error: </p>
<pre><code>fatal: Pathspec 'autoload_classmap.php' is in submodule 'module/CocktailMakerModule'
</code></pre>
<p>Now ... | 8,740 | 80,932 | 2016-12-30 00:41:21 | 23,612,340 | 43 | 2014-05-12 14:54:31 | 80,932 | 2015-07-07 14:31:18 | https://stackoverflow.com/q/23612012 | https://stackoverflow.com/a/23612340 | <p>Still no idea how it happened. All documentation I read assumes I have a <code>.git</code> directory there but I don't.</p>
<p>I just did the following:</p>
<pre><code>git rm -rf --cached CocktailMakerModule/
git add CocktailMakerModule/
</code></pre>
<p>That seems to resolve the issue.</p>
| <p>Still no idea how it happened. All documentation I read assumes I have a <code>.git</code> directory there but I don't.</p> <p>I just did the following:</p> <pre><code>git rm -rf --cached CocktailMakerModule/ git add CocktailMakerModule/ </code></pre> <p>That seems to resolve the issue.</p> | 119 | git | <h1>fatal: Pathspec 'autoload_classmap.php' is in submodule 'module/CocktailMakerModule'</h1>
<p>I have a repository on google code with my project.</p>
<p>I use Git source control.</p>
<p>It seems that when I try to add files to git from a specific directory, I get the following error: </p>
<pre><code>fatal: Pathsp... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,869 | git | # fatal: Pathspec 'autoload_classmap.php' is in submodule 'module/CocktailMakerModule'
I have a repository on google code with my project.
I use Git source control.
It seems that when I try to add files to git from a specific directory, I get the following error:
```
fatal: Pathspec 'autoload_classmap.php' is in su... | Still no idea how it happened. All documentation I read assumes I have a `.git` directory there but I don't.
I just did the following:
```
git rm -rf --cached CocktailMakerModule/
git add CocktailMakerModule/
```
That seems to resolve the issue. |
3993426 | How to update remote branch information? | 132 | 2010-10-22 02:16:02 | <p>In a git repository, a remote branch I am not tracking was deleted. When I type</p>
<pre><code>git branch -r
</code></pre>
<p>the deleted branch still shows up (and I can check it out)</p>
<p>What git command do I have to run to update this info?</p>
| 95,699 | 437,249 | 2023-07-31 07:41:20 | 3,993,486 | 42 | 2010-10-22 02:32:40 | 250,168 | 2010-10-22 02:32:40 | https://stackoverflow.com/q/3993426 | https://stackoverflow.com/a/3993486 | <p>If you perform something like</p>
<pre><code>git branch -d -r remote_name/branch_name
</code></pre>
<p>you only remove your local checkout. This command doesn't do anything to the remote repository, which is why it still shows up.</p>
<p><strong>Solution:</strong></p>
<pre><code>git push origin :branch_name
</c... | <p>If you perform something like</p> <pre><code>git branch -d -r remote_name/branch_name </code></pre> <p>you only remove your local checkout. This command doesn't do anything to the remote repository, which is why it still shows up.</p> <p><strong>Solution:</strong></p> <pre><code>git push origin :branch_name </c... | 119 | git | <h1>How to update remote branch information?</h1>
<p>In a git repository, a remote branch I am not tracking was deleted. When I type</p>
<pre><code>git branch -r
</code></pre>
<p>the deleted branch still shows up (and I can check it out)</p>
<p>What git command do I have to run to update this info?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,871 | git | # How to update remote branch information?
In a git repository, a remote branch I am not tracking was deleted. When I type
```
git branch -r
```
the deleted branch still shows up (and I can check it out)
What git command do I have to run to update this info? | If you perform something like
```
git branch -d -r remote_name/branch_name
```
you only remove your local checkout. This command doesn't do anything to the remote repository, which is why it still shows up.
**Solution:**
```
git push origin :branch_name
```
will remove the the remote branch (note the ':'), and
``... |
15375192 | What is a Tracking Reference? | 87 | 2013-03-13 01:01:37 | <p>When I push a new branch up to a remote repository via Git Extensions, I get an alert saying</p>
<pre><code>The branch {branch name} does not have a tracking reference. Do
you want to add a tracking reference for {branch name}?
</code></pre>
<p>What is a tracking reference? I've found only a few mentions of track... | 42,126 | 216,440 | 2022-05-06 20:40:27 | 15,376,709 | 42 | 2013-03-13 03:46:27 | 61,048 | 2013-03-13 04:28:00 | https://stackoverflow.com/q/15375192 | https://stackoverflow.com/a/15376709 | <p>The basic idea is that there are purely local references (e.g., branches, tags), and then there are remote tracking references, which follow what happens in other repos. Because Git is decentralized, it is possible for you to choose a name for a branch that is the same as one used in a remote, without having known ... | <p>The basic idea is that there are purely local references (e.g., branches, tags), and then there are remote tracking references, which follow what happens in other repos. Because Git is decentralized, it is possible for you to choose a name for a branch that is the same as one used in a remote, without having known ... | 119, 39597 | git, git-extensions | <h1>What is a Tracking Reference?</h1>
<p>When I push a new branch up to a remote repository via Git Extensions, I get an alert saying</p>
<pre><code>The branch {branch name} does not have a tracking reference. Do
you want to add a tracking reference for {branch name}?
</code></pre>
<p>What is a tracking reference? ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,873 | git | # What is a Tracking Reference?
When I push a new branch up to a remote repository via Git Extensions, I get an alert saying
```
The branch {branch name} does not have a tracking reference. Do
you want to add a tracking reference for {branch name}?
```
What is a tracking reference? I've found only a few mentions of ... | The basic idea is that there are purely local references (e.g., branches, tags), and then there are remote tracking references, which follow what happens in other repos. Because Git is decentralized, it is possible for you to choose a name for a branch that is the same as one used in a remote, without having known abou... |
14959972 | Trouble setting up git with my GitHub Account error: could not lock config file | 78 | 2013-02-19 14:32:39 | <p>I'm getting this error when trying to set the global config:</p>
<pre><code>$ git config --global user.name "Your Name Here"
error: could not lock config file /pathto/file/.gitconfig: No such file or directory
</code></pre>
<p>and the file .gitconfig is already exists, anyone have any ideas?? </p>
| 219,720 | 1,283,774 | 2025-05-09 08:27:21 | 14,960,629 | 42 | 2013-02-19 15:03:37 | 6,309 | 2013-02-19 15:03:37 | https://stackoverflow.com/q/14959972 | https://stackoverflow.com/a/14960629 | <p>A bit like in "<a href="https://stackoverflow.com/a/10502155/6309">Trouble setting up Tower with my GitHub Account - error: could not lock config file</a>", check how that <code>~/.gitconfig</code> file has been created.<br>
Ie: with which rights associated to it?</p>
<p>Make also sure your <code>$HOME</code> varia... | <p>A bit like in "<a href="https://stackoverflow.com/a/10502155/6309">Trouble setting up Tower with my GitHub Account - error: could not lock config file</a>", check how that <code>~/.gitconfig</code> file has been created.<br> Ie: with which rights associated to it?</p> <p>Make also sure your <code>$HOME</code> varia... | 119 | git | <h1>Trouble setting up git with my GitHub Account error: could not lock config file</h1>
<p>I'm getting this error when trying to set the global config:</p>
<pre><code>$ git config --global user.name "Your Name Here"
error: could not lock config file /pathto/file/.gitconfig: No such file or directory
</code></pre>
<p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,875 | git | # Trouble setting up git with my GitHub Account error: could not lock config file
I'm getting this error when trying to set the global config:
```
$ git config --global user.name "Your Name Here"
error: could not lock config file /pathto/file/.gitconfig: No such file or directory
```
and the file .gitconfig is alrea... | A bit like in "[Trouble setting up Tower with my GitHub Account - error: could not lock config file](https://stackoverflow.com/a/10502155/6309)", check how that `~/.gitconfig` file has been created.
Ie: with which rights associated to it?
Make also sure your `$HOME` variable is correctly set when you are executing t... |
14023648 | Why does my git history look like a christmas tree? | 75 | 2012-12-24 16:25:16 | <p>When doing <code>git log --decorate --oneline --graph</code> in one of our repositories shortly before Christmas, we found that the following structure had appeared (rotated to emphasize the tenuous festive theme):</p>
<p><img src="https://i.sstatic.net/ZsXT6.png" alt="redacted git log output, rotated to look like ... | 11,218 | 223,092 | 2012-12-24 16:25:16 | 14,023,650 | 42 | 2012-12-24 16:25:16 | 223,092 | 2012-12-24 16:25:16 | https://stackoverflow.com/q/14023648 | https://stackoverflow.com/a/14023650 | <p>In this case the situation was that there was an unpushed commit at the tip of the <code>master</code> branch in one clone of the repository. Then <code>git pull</code> was run many times in the same repository, over a period of time when there was lots of new work being done upstream. (In this case, it happened b... | <p>In this case the situation was that there was an unpushed commit at the tip of the <code>master</code> branch in one clone of the repository. Then <code>git pull</code> was run many times in the same repository, over a period of time when there was lots of new work being done upstream. (In this case, it happened b... | 119, 28896 | git, git-pull | <h1>Why does my git history look like a christmas tree?</h1>
<p>When doing <code>git log --decorate --oneline --graph</code> in one of our repositories shortly before Christmas, we found that the following structure had appeared (rotated to emphasize the tenuous festive theme):</p>
<p><img src="https://i.sstatic.net/Z... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,876 | git | # Why does my git history look like a christmas tree?
When doing `git log --decorate --oneline --graph` in one of our repositories shortly before Christmas, we found that the following structure had appeared (rotated to emphasize the tenuous festive theme):
![redacted git log output, rotated to look like a Christmas ... | In this case the situation was that there was an unpushed commit at the tip of the `master` branch in one clone of the repository. Then `git pull` was run many times in the same repository, over a period of time when there was lots of new work being done upstream. (In this case, it happened because of an automated scri... |
3779274 | How can git be installed on CENTOS 5.5? | 72 | 2010-09-23 14:14:14 | <p>How can I install git on CENTOS 5.5 machine?
I tried to install it from yum but got following msg.</p>
<pre><code>root@host [~]# sudo yum install git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: centos.mirrors.tds.net
* base: mirror.ubiquityservers.com
* extras: mirrors.serv... | 105,600 | 303,309 | 2020-09-27 15:43:14 | 3,779,476 | 42 | 2010-09-23 14:33:02 | 390,989 | 2012-06-05 16:28:42 | https://stackoverflow.com/q/3779274 | https://stackoverflow.com/a/3779476 | <p>From source? From the repos? The easiest way is to use the repos: <code>sudo yum install git</code> should do it. It may first be necessary to set up an additional repo such as <a href="http://fedoraproject.org/wiki/EPEL" rel="noreferrer">EPEL</a> first if git is not provided by the main repos.</p>
<p>If you want t... | <p>From source? From the repos? The easiest way is to use the repos: <code>sudo yum install git</code> should do it. It may first be necessary to set up an additional repo such as <a href="http://fedoraproject.org/wiki/EPEL" rel="noreferrer">EPEL</a> first if git is not provided by the main repos.</p> <p>If you want t... | 119, 2091 | centos5, git | <h1>How can git be installed on CENTOS 5.5?</h1>
<p>How can I install git on CENTOS 5.5 machine?
I tried to install it from yum but got following msg.</p>
<pre><code>root@host [~]# sudo yum install git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: centos.mirrors.tds.net
* base: m... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,877 | git | # How can git be installed on CENTOS 5.5?
How can I install git on CENTOS 5.5 machine?
I tried to install it from yum but got following msg.
```
root@host [~]# sudo yum install git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: centos.mirrors.tds.net
* base: mirror.ubiquityserver... | From source? From the repos? The easiest way is to use the repos: `sudo yum install git` should do it. It may first be necessary to set up an additional repo such as [EPEL](http://fedoraproject.org/wiki/EPEL) first if git is not provided by the main repos.
If you want to install from source, you can try [these](http:/... |
22722575 | git remove file from stash | 69 | 2014-03-28 20:25:08 | <p>I have a stash with a bunch of files in it.</p>
<p>But I can't apply my stash because of a conflicting file. I've identified the problematic file in my stash and I want to remove it.</p>
<p>How can I remove a single file from a stash without destroying the entire thing?</p>
| 63,947 | null | 2021-11-16 14:28:14 | 22,723,131 | 42 | 2014-03-28 21:00:26 | 1,256,452 | 2014-03-28 21:00:26 | https://stackoverflow.com/q/22722575 | https://stackoverflow.com/a/22723131 | <p>A stash is a commit (or really, two or even sometimes three commits) and you cannot change a commit. The literal answer to your question, then, is "you can't". Fortunately, you don't <em>need</em> to.</p>
<p>You say you can't apply your stash because of a conflicting file. But you <em>can</em> apply it, you just... | <p>A stash is a commit (or really, two or even sometimes three commits) and you cannot change a commit. The literal answer to your question, then, is "you can't". Fortunately, you don't <em>need</em> to.</p> <p>You say you can't apply your stash because of a conflicting file. But you <em>can</em> apply it, you just... | 119, 13091, 62599 | git, git-stash, merge-conflict-resolution | <h1>git remove file from stash</h1>
<p>I have a stash with a bunch of files in it.</p>
<p>But I can't apply my stash because of a conflicting file. I've identified the problematic file in my stash and I want to remove it.</p>
<p>How can I remove a single file from a stash without destroying the entire thing?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,878 | git | # git remove file from stash
I have a stash with a bunch of files in it.
But I can't apply my stash because of a conflicting file. I've identified the problematic file in my stash and I want to remove it.
How can I remove a single file from a stash without destroying the entire thing? | A stash is a commit (or really, two or even sometimes three commits) and you cannot change a commit. The literal answer to your question, then, is "you can't". Fortunately, you don't *need* to.
You say you can't apply your stash because of a conflicting file. But you *can* apply it, you just get a merge conflict. All ... |
2118364 | How to identify conflicting commits by hash during git rebase? | 52 | 2010-01-22 15:40:39 | <p>When I encounter a merge conflict using <code>git rebase</code>, how can I identify the source of the conflict <em>in terms of commits</em>, rather than just file differences?</p>
<p>I already know how to make (basic) use of <code>git mergetool</code> or <code>git add</code> before <code>git rebase --continue</code... | 10,314 | 83,100 | 2020-03-10 16:56:45 | 2,118,461 | 42 | 2010-01-22 15:54:00 | 121,332 | 2010-01-23 01:23:55 | https://stackoverflow.com/q/2118364 | https://stackoverflow.com/a/2118461 | <h2>Short Answer</h2>
<p>If it says </p>
<pre><code>Patch failed at 0001 commit message for F
</code></pre>
<p>Then run</p>
<pre><code>$ head -1 .git/rebase-apply/0001
From ad1c7739c1152502229e3f2ab759ec5323988326 Mon Sep 17 00:00:00 2001
</code></pre>
<p>To get the SHA <code>ad1c77</code> of the failing commit, a... | <h2>Short Answer</h2> <p>If it says </p> <pre><code>Patch failed at 0001 commit message for F </code></pre> <p>Then run</p> <pre><code>$ head -1 .git/rebase-apply/0001 From ad1c7739c1152502229e3f2ab759ec5323988326 Mon Sep 17 00:00:00 2001 </code></pre> <p>To get the SHA <code>ad1c77</code> of the failing commit, a... | 119, 717, 29934 | git, git-rebase, merge | <h1>How to identify conflicting commits by hash during git rebase?</h1>
<p>When I encounter a merge conflict using <code>git rebase</code>, how can I identify the source of the conflict <em>in terms of commits</em>, rather than just file differences?</p>
<p>I already know how to make (basic) use of <code>git mergetool... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,882 | git | # How to identify conflicting commits by hash during git rebase?
When I encounter a merge conflict using `git rebase`, how can I identify the source of the conflict *in terms of commits*, rather than just file differences?
I already know how to make (basic) use of `git mergetool` or `git add` before `git rebase --con... | ## Short Answer
If it says
```
Patch failed at 0001 commit message for F
```
Then run
```
$ head -1 .git/rebase-apply/0001
From ad1c7739c1152502229e3f2ab759ec5323988326 Mon Sep 17 00:00:00 2001
```
To get the SHA `ad1c77` of the failing commit, and then use `git show ad1c77` to have a look at it.
## Long Answer
... |
44109234 | How to delete a git working tree branch when its working directory has been removed? | 48 | 2017-05-22 09:21:46 | <p>I've removed its working directory, because this git working tree is no longer useful, then I <code>git branch -D pubsub-sketch-tree</code> at the directory of main repository. An error thrown:</p>
<pre><code>error: Cannot delete branch 'pubsub-sketch-tree' checked out at '/Users/zhouhancheng/编程/github_own/sketch_w... | 77,264 | 4,803,321 | 2026-01-09 10:20:53 | 44,109,839 | 42 | 2017-05-22 09:51:35 | 1,256,452 | 2017-05-22 09:51:35 | https://stackoverflow.com/q/44109234 | https://stackoverflow.com/a/44109839 | <p>You are using <code>git worktree</code>, so the answer is in <a href="https://www.kernel.org/pub/software/scm/git/docs/git-worktree.html" rel="noreferrer">the <code>git worktree</code> documentation</a>:</p>
<blockquote>
<p>When you are done with a linked working tree you can simply delete it. The working tree’s ... | <p>You are using <code>git worktree</code>, so the answer is in <a href="https://www.kernel.org/pub/software/scm/git/docs/git-worktree.html" rel="noreferrer">the <code>git worktree</code> documentation</a>:</p> <blockquote> <p>When you are done with a linked working tree you can simply delete it. The working tree’s ... | 119, 117020 | git, git-worktree | <h1>How to delete a git working tree branch when its working directory has been removed?</h1>
<p>I've removed its working directory, because this git working tree is no longer useful, then I <code>git branch -D pubsub-sketch-tree</code> at the directory of main repository. An error thrown:</p>
<pre><code>error: Cannot... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,883 | git | # How to delete a git working tree branch when its working directory has been removed?
I've removed its working directory, because this git working tree is no longer useful, then I `git branch -D pubsub-sketch-tree` at the directory of main repository. An error thrown:
```
error: Cannot delete branch 'pubsub-sketch-t... | You are using `git worktree`, so the answer is in [the `git worktree` documentation](https://www.kernel.org/pub/software/scm/git/docs/git-worktree.html):
> When you are done with a linked working tree you can simply delete it. The working tree’s administrative files in the repository (see "DETAILS" below) will eventua... |
26135216 | Why Isn't There A Git Clone Specific Commit Option? | 48 | 2014-10-01 06:18:06 | <p>In light of a <a href="https://stackoverflow.com/q/26091467/1144203">recent question on SO</a>, I am wondering why isn't there an option in <a href="http://git-scm.com/docs/git-clone" rel="noreferrer"><code>git clone</code></a> such that the <code>HEAD</code> pointer of the newly created branch will point to a speci... | 39,626 | 1,144,203 | 2018-04-26 14:27:24 | 26,135,822 | 42 | 2014-10-01 07:03:26 | 1,256,452 | 2017-02-01 03:53:58 | https://stackoverflow.com/q/26135216 | https://stackoverflow.com/a/26135822 | <p>Two answers so far (at the time I wrote this, now there are more) are correct in what they say, but don't really answer the "why" question. Of course, the "why" question is really hard to answer, except by the authors of the various bits of Git (and even then, what if two frequent Git contributors gave two differen... | <p>Two answers so far (at the time I wrote this, now there are more) are correct in what they say, but don't really answer the "why" question. Of course, the "why" question is really hard to answer, except by the authors of the various bits of Git (and even then, what if two frequent Git contributors gave two differen... | 119, 34099 | git, git-clone | <h1>Why Isn't There A Git Clone Specific Commit Option?</h1>
<p>In light of a <a href="https://stackoverflow.com/q/26091467/1144203">recent question on SO</a>, I am wondering why isn't there an option in <a href="http://git-scm.com/docs/git-clone" rel="noreferrer"><code>git clone</code></a> such that the <code>HEAD</co... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,884 | git | # Why Isn't There A Git Clone Specific Commit Option?
In light of a [recent question on SO](https://stackoverflow.com/q/26091467/1144203), I am wondering why isn't there an option in [`git clone`](http://git-scm.com/docs/git-clone) such that the `HEAD` pointer of the newly created branch will point to a specified comm... | Two answers so far (at the time I wrote this, now there are more) are correct in what they say, but don't really answer the "why" question. Of course, the "why" question is really hard to answer, except by the authors of the various bits of Git (and even then, what if two frequent Git contributors gave two different an... |
5509677 | How do I do a git pull to a specific branch? | 47 | 2011-04-01 05:56:24 | <p>I am trying to pull from my heroku remote, I get this message:</p>
<pre><code>>git pull heroku
You asked to pull from the remote 'heroku', but did not specify
a branch. Because this is not the default configured remote
</code></pre>
<p>My local branch is 'develop'.</p>
<p>How do I pull from Heroku to my local ... | 118,614 | 91,970 | 2018-03-28 11:18:43 | 5,509,695 | 42 | 2011-04-01 06:00:11 | 238,030 | 2011-04-01 06:08:55 | https://stackoverflow.com/q/5509677 | https://stackoverflow.com/a/5509695 | <p>Updated answer: You need to specify what branch you want to pull from, since your local branch is not configured to pull from <code>heroku</code>'s <code>master</code>.</p>
<p>So try something like:</p>
<pre><code>git pull heroku master
</code></pre>
<p>Remember that you have to have checked out <code>develop</co... | <p>Updated answer: You need to specify what branch you want to pull from, since your local branch is not configured to pull from <code>heroku</code>'s <code>master</code>.</p> <p>So try something like:</p> <pre><code>git pull heroku master </code></pre> <p>Remember that you have to have checked out <code>develop</co... | 119 | git | <h1>How do I do a git pull to a specific branch?</h1>
<p>I am trying to pull from my heroku remote, I get this message:</p>
<pre><code>>git pull heroku
You asked to pull from the remote 'heroku', but did not specify
a branch. Because this is not the default configured remote
</code></pre>
<p>My local branch is 'de... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,885 | git | # How do I do a git pull to a specific branch?
I am trying to pull from my heroku remote, I get this message:
```
>git pull heroku
You asked to pull from the remote 'heroku', but did not specify
a branch. Because this is not the default configured remote
```
My local branch is 'develop'.
How do I pull from Heroku t... | Updated answer: You need to specify what branch you want to pull from, since your local branch is not configured to pull from `heroku`'s `master`.
So try something like:
```
git pull heroku master
```
Remember that you have to have checked out `develop` in order for this command to pull to the local branch `develop`... |
2085871 | Strategy for preventing or catching git history rewrite | 45 | 2010-01-18 12:13:51 | <p>Although I love the git history rewrite feature, how does one go about ensuring history isn't rewritten. </p>
<p>We dont mind what a programmer does on their own machine, but we need to ensure that a version is not pushed to the server that changes history.</p>
<p>ie We need to guarantee that a particular version ... | 8,193 | null | 2014-10-16 13:23:08 | 2,085,907 | 42 | 2010-01-18 12:19:19 | 6,309 | 2014-10-16 13:23:08 | https://stackoverflow.com/q/2085871 | https://stackoverflow.com/a/2085907 | <p>If you can run:</p>
<pre><code> git config --system receive.denyNonFastforwards true
</code></pre>
<p>on the server, that should take care of rewriting history case being pushed to said server.<br />
However that is for the all repo, not for a specifc file or group of files.</p>
<p><a href="http://git-scm.com/book/e... | <p>If you can run:</p> <pre><code> git config --system receive.denyNonFastforwards true </code></pre> <p>on the server, that should take care of rewriting history case being pushed to said server.<br /> However that is for the all repo, not for a specifc file or group of files.</p> <p><a href="http://git-scm.com/book/e... | 119 | git | <h1>Strategy for preventing or catching git history rewrite</h1>
<p>Although I love the git history rewrite feature, how does one go about ensuring history isn't rewritten. </p>
<p>We dont mind what a programmer does on their own machine, but we need to ensure that a version is not pushed to the server that changes hi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,887 | git | # Strategy for preventing or catching git history rewrite
Although I love the git history rewrite feature, how does one go about ensuring history isn't rewritten.
We dont mind what a programmer does on their own machine, but we need to ensure that a version is not pushed to the server that changes history.
ie We nee... | If you can run:
```
git config --system receive.denyNonFastforwards true
```
on the server, that should take care of rewriting history case being pushed to said server.
However that is for the all repo, not for a specifc file or group of files.
[`git config`](http://git-scm.com/book/en/Customizing-Git-Git-Configu... |
4515679 | git workflow: Can I prevent a certain file from being merged to another branch but still keep it under version control? | 44 | 2010-12-23 03:40:57 | <p>I have a repository with two branches: live and stage. The repository holds code for a web based application. I would like to maintain two different .htaccess files for the stage and live branches, but still keep them version controlled, since the nature of serving a stage site is a little bit different (right now f... | 26,180 | 305,340 | 2022-11-11 01:18:38 | 4,520,363 | 42 | 2010-12-23 16:00:05 | 305,340 | 2012-05-09 15:58:57 | https://stackoverflow.com/q/4515679 | https://stackoverflow.com/a/4520363 | <p>I found an <a href="https://stackoverflow.com/a/3970442/88709">answer on another question</a> on Stack Overflow, credit goes to fcurella:</p>
<blockquote>
<p>Let's say you want to exclude the file <code>config.php</code></p>
<p>On branch A:</p>
<ol>
<li><p>Create a file named <code>.gitattributes</cod... | <p>I found an <a href="https://stackoverflow.com/a/3970442/88709">answer on another question</a> on Stack Overflow, credit goes to fcurella:</p> <blockquote> <p>Let's say you want to exclude the file <code>config.php</code></p> <p>On branch A:</p> <ol> <li><p>Create a file named <code>.gitattributes</cod... | 119, 758, 28897 | git, git-merge, workflow | <h1>git workflow: Can I prevent a certain file from being merged to another branch but still keep it under version control?</h1>
<p>I have a repository with two branches: live and stage. The repository holds code for a web based application. I would like to maintain two different .htaccess files for the stage and live ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,888 | git | # git workflow: Can I prevent a certain file from being merged to another branch but still keep it under version control?
I have a repository with two branches: live and stage. The repository holds code for a web based application. I would like to maintain two different .htaccess files for the stage and live branches,... | I found an [answer on another question](https://stackoverflow.com/a/3970442/88709) on Stack Overflow, credit goes to fcurella:
> Let's say you want to exclude the file `config.php`
>
> On branch A:
>
> 1. Create a file named `.gitattributes` in the same dir, with this line: `config.php merge=ours`. This tells git what... |
13711455 | How can I merge a specific file from one branch into another branch in Git | 40 | 2012-12-04 20:38:35 | <p>I have 2 branches in a git repo, lets call them, dev and test. I have changes in a single file, somecode.js. Both branches have changes to somecode.js. The 2 branches have diverged significantly (but manageably) so a straight "merge" is insufficient.</p>
<p>I have tried <a href="http://jasonrudolph.com/blog/2009... | 22,701 | 1,356,721 | 2014-07-03 04:37:38 | 13,712,429 | 42 | 2012-12-04 21:40:17 | 337,297 | 2012-12-04 21:40:17 | https://stackoverflow.com/q/13711455 | https://stackoverflow.com/a/13712429 | <p>I think you like to use</p>
<pre><code>git checkout -p
</code></pre>
<p>In your case</p>
<pre><code>git checkout dev
git checkout -p test somecode.js
</code></pre>
<p>And you can interactively apply the diffs.</p>
| <p>I think you like to use</p> <pre><code>git checkout -p </code></pre> <p>In your case</p> <pre><code>git checkout dev git checkout -p test somecode.js </code></pre> <p>And you can interactively apply the diffs.</p> | 119 | git | <h1>How can I merge a specific file from one branch into another branch in Git</h1>
<p>I have 2 branches in a git repo, lets call them, dev and test. I have changes in a single file, somecode.js. Both branches have changes to somecode.js. The 2 branches have diverged significantly (but manageably) so a straight "mer... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,889 | git | # How can I merge a specific file from one branch into another branch in Git
I have 2 branches in a git repo, lets call them, dev and test. I have changes in a single file, somecode.js. Both branches have changes to somecode.js. The 2 branches have diverged significantly (but manageably) so a straight "merge" is insuf... | I think you like to use
```
git checkout -p
```
In your case
```
git checkout dev
git checkout -p test somecode.js
```
And you can interactively apply the diffs. |
43567577 | What is the difference between force push and normal push in git? | 39 | 2017-04-23 05:02:58 | <p>What is the difference between force push and normal push, and in what kind of situations should I force push in git? Is it good practice to force push into the master branch?</p>
| 44,166 | 7,764,309 | 2023-03-08 17:10:50 | 43,567,591 | 42 | 2017-04-23 05:05:14 | 6,309 | 2023-03-08 17:08:36 | https://stackoverflow.com/q/43567577 | https://stackoverflow.com/a/43567591 | <p>You only force a push when you need to replace the remote history with your local history.</p>
<p>This happens when you rewrite the local history, typically <a href="https://git-scm.com/book/es-ni/v1/Git-Branching-Rebasing" rel="noreferrer">through a <code>git rebase</code></a>.<br />
For instance, if you just pushe... | <p>You only force a push when you need to replace the remote history with your local history.</p> <p>This happens when you rewrite the local history, typically <a href="https://git-scm.com/book/es-ni/v1/Git-Branching-Rebasing" rel="noreferrer">through a <code>git rebase</code></a>.<br /> For instance, if you just pushe... | 119, 4236 | git, push | <h1>What is the difference between force push and normal push in git?</h1>
<p>What is the difference between force push and normal push, and in what kind of situations should I force push in git? Is it good practice to force push into the master branch?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,890 | git | # What is the difference between force push and normal push in git?
What is the difference between force push and normal push, and in what kind of situations should I force push in git? Is it good practice to force push into the master branch? | You only force a push when you need to replace the remote history with your local history.
This happens when you rewrite the local history, typically [through a `git rebase`](https://git-scm.com/book/es-ni/v1/Git-Branching-Rebasing).
For instance, if you just pushed an incorrect commit, and amend it locally, using a... |
34957237 | Can I configure git blame to always ignore certain commits? Want to fix git blame once and for all | 36 | 2016-01-22 22:47:39 | <p>I am in a repository where git blame has effectively been broken.</p>
<p>There are two commits I want to ignore in git blame. </p>
<ul>
<li>Commit 1 destroyed <em>a lot</em> of files.</li>
<li>Commit 2 immediately reverted commit 1.</li>
</ul>
<p>Every time I git blame a line now I see the author of [commit 2] in... | 20,198 | 1,708,136 | 2025-03-07 12:43:01 | 57,129,540 | 42 | 2019-07-21 00:25:27 | 6,309 | 2023-08-09 08:18:57 | https://stackoverflow.com/q/34957237 | https://stackoverflow.com/a/57129540 | <blockquote>
<p>These two commits make me sad whenever I use the Annotate feature in IntelliJ (which is basically git blame).<br />
Has anybody ever fixed this problem before without rewriting history?</p>
</blockquote>
<p>Before Q3 2019, no.<br />
But with Git 2.23, you will be able to instruct git blame to <em>ignore... | <blockquote> <p>These two commits make me sad whenever I use the Annotate feature in IntelliJ (which is basically git blame).<br /> Has anybody ever fixed this problem before without rewriting history?</p> </blockquote> <p>Before Q3 2019, no.<br /> But with Git 2.23, you will be able to instruct git blame to <em>ignore... | 119, 456 | git, version-control | <h1>Can I configure git blame to always ignore certain commits? Want to fix git blame once and for all</h1>
<p>I am in a repository where git blame has effectively been broken.</p>
<p>There are two commits I want to ignore in git blame. </p>
<ul>
<li>Commit 1 destroyed <em>a lot</em> of files.</li>
<li>Commit 2 immed... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,893 | git | # Can I configure git blame to always ignore certain commits? Want to fix git blame once and for all
I am in a repository where git blame has effectively been broken.
There are two commits I want to ignore in git blame.
- Commit 1 destroyed *a lot* of files.
- Commit 2 immediately reverted commit 1.
Every time I gi... | > These two commits make me sad whenever I use the Annotate feature in IntelliJ (which is basically git blame).
> Has anybody ever fixed this problem before without rewriting history?
Before Q3 2019, no.
But with Git 2.23, you will be able to instruct git blame to *ignore* those two problematic commits. (IntelliJ ... |
14891364 | How to show git author name in Sublime Text editor? | 36 | 2013-02-15 09:14:38 | <p>I'm using <a href="http://www.jisaacks.com/gitgutter" rel="noreferrer">GitGutter</a> with Sublime Text editor.</p>
<p>With this plug-in Git > This file > blame will open a new tab with annontations.</p>
<p>Is there any way to show the Git annotations in the same edit window probably just before the line number </p... | 29,746 | 174,261 | 2019-10-02 00:43:13 | 15,400,386 | 42 | 2013-03-14 02:58:23 | 46,011 | 2013-03-14 02:58:23 | https://stackoverflow.com/q/14891364 | https://stackoverflow.com/a/15400386 | <p>Ok a couple things here.</p>
<p>First off, The <code>git blame</code> feature is not a part of my <a href="https://github.com/jisaacks/GitGutter" rel="noreferrer"><strong>GitGutter</strong></a> plugin, it is a part of the <a href="https://github.com/kemayo/sublime-text-2-git" rel="noreferrer"><strong>Git</strong></... | <p>Ok a couple things here.</p> <p>First off, The <code>git blame</code> feature is not a part of my <a href="https://github.com/jisaacks/GitGutter" rel="noreferrer"><strong>GitGutter</strong></a> plugin, it is a part of the <a href="https://github.com/kemayo/sublime-text-2-git" rel="noreferrer"><strong>Git</strong></... | 119, 2404, 72788 | annotations, git, sublimetext | <h1>How to show git author name in Sublime Text editor?</h1>
<p>I'm using <a href="http://www.jisaacks.com/gitgutter" rel="noreferrer">GitGutter</a> with Sublime Text editor.</p>
<p>With this plug-in Git > This file > blame will open a new tab with annontations.</p>
<p>Is there any way to show the Git annotations in ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,894 | git | # How to show git author name in Sublime Text editor?
I'm using [GitGutter](http://www.jisaacks.com/gitgutter) with Sublime Text editor.
With this plug-in Git > This file > blame will open a new tab with annontations.
Is there any way to show the Git annotations in the same edit window probably just before the line ... | Ok a couple things here.
First off, The `git blame` feature is not a part of my [**GitGutter**](https://github.com/jisaacks/GitGutter) plugin, it is a part of the [**Git**](https://github.com/kemayo/sublime-text-2-git) plugin.
Secondly, @skuroda is correct that you can only put an icon in the gutter.
What you can do... |
72908270 | Why does the COMMIT_EDITMSG open when I try to commit in vscode? | 35 | 2022-07-08 07:48:34 | <p>Up until now, I can commit all my changes without any complications in VS Code. Now, when I try to commit my changes by clicking the little 'tick' on the top right corner of the 'Source Control' tab, a file named 'COMMIT_EDITMSG' shows up on the editor, and the Source Control panel remains in the loading state and n... | 63,896 | 18,690,626 | 2024-10-24 07:44:29 | 72,912,238 | 42 | 2022-07-08 13:36:19 | 7,215,141 | 2023-09-16 19:56:26 | https://stackoverflow.com/q/72908270 | https://stackoverflow.com/a/72912238 | <p>I just started getting this as well. Something surely changed in the default settings with a recent update.</p>
<p>The solution seems to be to turn off this setting</p>
<p><code>git.useEditorAsCommitInput</code></p>
<p>To change this, go to:</p>
<p>File > Preferences > Settings > search "git.useEditorA... | <p>I just started getting this as well. Something surely changed in the default settings with a recent update.</p> <p>The solution seems to be to turn off this setting</p> <p><code>git.useEditorAsCommitInput</code></p> <p>To change this, go to:</p> <p>File > Preferences > Settings > search "git.useEditorA... | 119, 111608 | git, visual-studio-code | <h1>Why does the COMMIT_EDITMSG open when I try to commit in vscode?</h1>
<p>Up until now, I can commit all my changes without any complications in VS Code. Now, when I try to commit my changes by clicking the little 'tick' on the top right corner of the 'Source Control' tab, a file named 'COMMIT_EDITMSG' shows up on t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,896 | git | # Why does the COMMIT_EDITMSG open when I try to commit in vscode?
Up until now, I can commit all my changes without any complications in VS Code. Now, when I try to commit my changes by clicking the little 'tick' on the top right corner of the 'Source Control' tab, a file named 'COMMIT_EDITMSG' shows up on the editor... | I just started getting this as well. Something surely changed in the default settings with a recent update.
The solution seems to be to turn off this setting
`git.useEditorAsCommitInput`
To change this, go to:
File > Preferences > Settings > search "git.useEditorAsCommitInput" then untick |
7718780 | how to undo git submodule update | 35 | 2011-10-10 21:15:54 | <p>I accidentally checked in a wrong submodule update: ( as part of a bigger commit )</p>
<p>-Subproject commit 025ffc<br>
+Subproject commit f59250</p>
<p>It is already pushed to the remote..</p>
<p>How do I undo this update?</p>
| 17,760 | 514,748 | 2011-10-10 22:28:31 | 7,719,325 | 42 | 2011-10-10 22:18:47 | 626,853 | 2011-10-10 22:28:31 | https://stackoverflow.com/q/7718780 | https://stackoverflow.com/a/7719325 | <p>Run <code>git checkout 025ffc</code> in the submodule directory and then <code>git add SubmoduleName; git commit -m 'Some message'</code> in the main directory.</p>
<p>(Remember that checking out a commit through its hash leaves you in "detached HEAD state", meaning that you're not on any branch. So if there alread... | <p>Run <code>git checkout 025ffc</code> in the submodule directory and then <code>git add SubmoduleName; git commit -m 'Some message'</code> in the main directory.</p> <p>(Remember that checking out a commit through its hash leaves you in "detached HEAD state", meaning that you're not on any branch. So if there alread... | 119, 5766, 41612 | git, git-submodules, undo | <h1>how to undo git submodule update</h1>
<p>I accidentally checked in a wrong submodule update: ( as part of a bigger commit )</p>
<p>-Subproject commit 025ffc<br>
+Subproject commit f59250</p>
<p>It is already pushed to the remote..</p>
<p>How do I undo this update?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,898 | git | # how to undo git submodule update
I accidentally checked in a wrong submodule update: ( as part of a bigger commit )
-Subproject commit 025ffc
+Subproject commit f59250
It is already pushed to the remote..
How do I undo this update? | Run `git checkout 025ffc` in the submodule directory and then `git add SubmoduleName; git commit -m 'Some message'` in the main directory.
(Remember that checking out a commit through its hash leaves you in "detached HEAD state", meaning that you're not on any branch. So if there already is a branch pointing to `025ff... |
57904284 | Where is Visual Studio's git.exe location? | 34 | 2019-09-12 10:01:16 | <p>I'm configuring <strong>git</strong> through command line but changes seems doesn't apply to <strong>Visual Studio</strong>'s git actions, so I'm wondering perhaps VS uses another git instance with other configs, where can I find which git.exe is getting used by VS?</p>
| 34,326 | 5,867,244 | 2025-04-29 22:24:11 | 57,938,031 | 42 | 2019-09-14 18:05:11 | 10,871,073 | 2022-07-04 04:31:54 | https://stackoverflow.com/q/57904284 | https://stackoverflow.com/a/57938031 | <p>Visual Studio gets the location of the various <code>git</code> tools from the <code>config</code> file in the <code>.git</code> folder, for example, in lines like this:</p>
<pre><code>[difftool "vsdiffmerge"]
cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\... | <p>Visual Studio gets the location of the various <code>git</code> tools from the <code>config</code> file in the <code>.git</code> folder, for example, in lines like this:</p> <pre><code>[difftool "vsdiffmerge"] cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\... | 119, 32868, 33953 | git, git-config, visual-studio | <h1>Where is Visual Studio's git.exe location?</h1>
<p>I'm configuring <strong>git</strong> through command line but changes seems doesn't apply to <strong>Visual Studio</strong>'s git actions, so I'm wondering perhaps VS uses another git instance with other configs, where can I find which git.exe is getting used by VS... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,899 | git | # Where is Visual Studio's git.exe location?
I'm configuring **git** through command line but changes seems doesn't apply to **Visual Studio**'s git actions, so I'm wondering perhaps VS uses another git instance with other configs, where can I find which git.exe is getting used by VS? | Visual Studio gets the location of the various `git` tools from the `config` file in the `.git` folder, for example, in lines like this:
```
[difftool "vsdiffmerge"]
cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\... |
27800512 | bypass pre-commit hook for merge commits | 34 | 2015-01-06 14:14:29 | <p>I setup some git hooks to run some <code>gulp</code> commands on pre-commit. I basically run <code>jshint</code>/<code>plato</code>. I basically want to bypass these for two cases:</p>
<ol>
<li>hotfix branches (master / hotfix)</li>
<li>git merge (or find a way to do it in a way that doesn't crash on the merge c... | 12,467 | 256,793 | 2024-04-07 08:23:42 | 27,800,562 | 42 | 2015-01-06 14:16:45 | 256,793 | 2015-01-06 14:16:45 | https://stackoverflow.com/q/27800512 | https://stackoverflow.com/a/27800562 | <p>So I just found a command that I think i can use to detect the "merge_head"</p>
<pre><code> git rev-parse -q --verify MERGE_HEAD
</code></pre>
<p>If rev-parse returns a hash that means we are currently in a merge state. I can use that to bypass this logic. But will wait for some better advice from more experienc... | <p>So I just found a command that I think i can use to detect the "merge_head"</p> <pre><code> git rev-parse -q --verify MERGE_HEAD </code></pre> <p>If rev-parse returns a hash that means we are currently in a merge state. I can use that to bypass this logic. But will wait for some better advice from more experienc... | 119, 41612, 43087 | git, githooks, git-submodules | <h1>bypass pre-commit hook for merge commits</h1>
<p>I setup some git hooks to run some <code>gulp</code> commands on pre-commit. I basically run <code>jshint</code>/<code>plato</code>. I basically want to bypass these for two cases:</p>
<ol>
<li>hotfix branches (master / hotfix)</li>
<li>git merge (or find a way t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,900 | git | # bypass pre-commit hook for merge commits
I setup some git hooks to run some `gulp` commands on pre-commit. I basically run `jshint`/`plato`. I basically want to bypass these for two cases:
1. hotfix branches (master / hotfix)
2. git merge (or find a way to do it in a way that doesn't crash on the merge commit case)... | So I just found a command that I think i can use to detect the "merge_head"
```
git rev-parse -q --verify MERGE_HEAD
```
If rev-parse returns a hash that means we are currently in a merge state. I can use that to bypass this logic. But will wait for some better advice from more experienced individuals. |
8883081 | Git, How to change a bare to a shared repo? | 34 | 2012-01-16 16:31:45 | <p>So this is how I set up my project:</p>
<pre><code>git init --bare
</code></pre>
<p>Later I learned that if you want to work on a project with multiple users this is how I should have done it:</p>
<pre><code>git init --bare --shared
</code></pre>
<p>Now I tried to work like that and luckily we are in the beginni... | 15,779 | 576,223 | 2016-12-09 18:35:01 | 8,883,202 | 42 | 2012-01-16 16:40:05 | 89,391 | 2016-12-09 18:35:01 | https://stackoverflow.com/q/8883081 | https://stackoverflow.com/a/8883202 | <p>Since the <code>--shared</code> option just sets the permissions on everything in the repository to group-writable you could do this manually later:</p>
<pre><code>$ chmod -R g+w the/repo/path
</code></pre>
<p>Plus, add</p>
<pre><code>sharedrepository = 1
</code></pre>
<p>under the <code>[core]</code> section in... | <p>Since the <code>--shared</code> option just sets the permissions on everything in the repository to group-writable you could do this manually later:</p> <pre><code>$ chmod -R g+w the/repo/path </code></pre> <p>Plus, add</p> <pre><code>sharedrepository = 1 </code></pre> <p>under the <code>[core]</code> section in... | 119, 2504, 7330, 64465 | git, git-bare, repository, shared | <h1>Git, How to change a bare to a shared repo?</h1>
<p>So this is how I set up my project:</p>
<pre><code>git init --bare
</code></pre>
<p>Later I learned that if you want to work on a project with multiple users this is how I should have done it:</p>
<pre><code>git init --bare --shared
</code></pre>
<p>Now I trie... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,901 | git | # Git, How to change a bare to a shared repo?
So this is how I set up my project:
```
git init --bare
```
Later I learned that if you want to work on a project with multiple users this is how I should have done it:
```
git init --bare --shared
```
Now I tried to work like that and luckily we are in the beginning s... | Since the `--shared` option just sets the permissions on everything in the repository to group-writable you could do this manually later:
```
$ chmod -R g+w the/repo/path
```
Plus, add
```
sharedrepository = 1
```
under the `[core]` section in `.git/config`. Shared repos also have the following [receive option](htt... |
11783813 | Git checkout second remote branch | 32 | 2012-08-02 18:42:42 | <p>I run:</p>
<pre><code> git checkout mygithub/master
</code></pre>
<p>but for some reason, running 'git status' shows "not currently on any branch". Running:</p>
<pre><code> git checkout master
</code></pre>
<p>and then <code>git status</code>, says that I'm now on branch master. Now I want to switch to another b... | 164,891 | 778,234 | 2023-02-27 09:47:18 | 11,783,894 | 42 | 2012-08-02 18:48:16 | 112,968 | 2012-08-02 18:48:16 | https://stackoverflow.com/q/11783813 | https://stackoverflow.com/a/11783894 | <p><code>mygithub/master</code> is a remote branch. To create a local branch based off of that remote branch, you have to use <code>git checkout -b mymaster mygithub/master</code>. Git tries to make this easy for you: if you write <code>git checkout branchname</code>, and branchname only exists in a remote, but not loc... | <p><code>mygithub/master</code> is a remote branch. To create a local branch based off of that remote branch, you have to use <code>git checkout -b mymaster mygithub/master</code>. Git tries to make this easy for you: if you write <code>git checkout branchname</code>, and branchname only exists in a remote, but not loc... | 119, 1879, 37230 | branch, git, git-checkout | <h1>Git checkout second remote branch</h1>
<p>I run:</p>
<pre><code> git checkout mygithub/master
</code></pre>
<p>but for some reason, running 'git status' shows "not currently on any branch". Running:</p>
<pre><code> git checkout master
</code></pre>
<p>and then <code>git status</code>, says that I'm now on branc... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,902 | git | # Git checkout second remote branch
I run:
```
git checkout mygithub/master
```
but for some reason, running 'git status' shows "not currently on any branch". Running:
```
git checkout master
```
and then `git status`, says that I'm now on branch master. Now I want to switch to another branch. Running `git check... | `mygithub/master` is a remote branch. To create a local branch based off of that remote branch, you have to use `git checkout -b mymaster mygithub/master`. Git tries to make this easy for you: if you write `git checkout branchname`, and branchname only exists in a remote, but not locally, Git will automatically set up ... |
65776556 | Exclamation mark in .gitignore doesn't work | 27 | 2021-01-18 14:37:21 | <p>I have this file structure</p>
<pre><code>aaafolder
└─ bbbfolder
├─ filename0.txt
├─ dddfolder
│ ├─ filename1.txt
│ └─ filename2.txt
├─ cccfolder
└─ filename.txt
</code></pre>
<p>I want all the contents of the <code>aaafolder</code> folder to be hidden, but all files in the <code>dddfolder</code>... | 11,545 | 14,334,343 | 2022-06-30 07:35:33 | 65,777,181 | 42 | 2021-01-18 15:13:48 | 729,881 | 2021-01-18 15:25:36 | https://stackoverflow.com/q/65776556 | https://stackoverflow.com/a/65777181 | <p>Per <a href="https://git-scm.com/docs/gitignore" rel="noreferrer">the <code>gitignore</code> documentation</a>, when negating:</p>
<blockquote>
<p>it is not possible to re-include a file if a parent directory of that file is excluded.</p>
</blockquote>
<p>This means that you'll need to ensure that the <em>parent</em... | <p>Per <a href="https://git-scm.com/docs/gitignore" rel="noreferrer">the <code>gitignore</code> documentation</a>, when negating:</p> <blockquote> <p>it is not possible to re-include a file if a parent directory of that file is excluded.</p> </blockquote> <p>This means that you'll need to ensure that the <em>parent</em... | 119, 25056 | git, gitignore | <h1>Exclamation mark in .gitignore doesn't work</h1>
<p>I have this file structure</p>
<pre><code>aaafolder
└─ bbbfolder
├─ filename0.txt
├─ dddfolder
│ ├─ filename1.txt
│ └─ filename2.txt
├─ cccfolder
└─ filename.txt
</code></pre>
<p>I want all the contents of the <code>aaafolder</code> folder to b... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,903 | git | # Exclamation mark in .gitignore doesn't work
I have this file structure
```
aaafolder
└─ bbbfolder
├─ filename0.txt
├─ dddfolder
│ ├─ filename1.txt
│ └─ filename2.txt
├─ cccfolder
└─ filename.txt
```
I want all the contents of the `aaafolder` folder to be hidden, but all files in the `dddfolder`... | Per [the `gitignore` documentation](https://git-scm.com/docs/gitignore), when negating:
> it is not possible to re-include a file if a parent directory of that file is excluded.
This means that you'll need to ensure that the *parent* of `dddfolder` is included, *even if the contents* of `dddfolder` are not included.
... |
14569172 | Problems with corrupt git repo | 27 | 2013-01-28 19:00:39 | <p>My git repo got corrupted while running a find and replace command (See here: <a href="https://stackoverflow.com/questions/14564936/git-reset-failing-after-find-and-replace">Git reset failing after find and replace</a>). So I deleted some pack files about which git told me that there were not reachable. So I ran rm ... | 39,078 | 1,275,959 | 2020-10-22 21:22:57 | 14,571,150 | 42 | 2013-01-28 21:00:27 | 758,345 | 2020-03-09 09:54:56 | https://stackoverflow.com/q/14569172 | https://stackoverflow.com/a/14571150 | <p>First: Make a backup of your <code>.git</code> directory in case you corrupt things more in this process. Then:</p>
<ul>
<li>Put back the best version of the packfiles you have available.</li>
<li><p>For each of the corrupt packfiles, run:</p>
<pre><code>mv .git/objects/pack/pack-**yourpack**.pack oldpack
git unpa... | <p>First: Make a backup of your <code>.git</code> directory in case you corrupt things more in this process. Then:</p> <ul> <li>Put back the best version of the packfiles you have available.</li> <li><p>For each of the corrupt packfiles, run:</p> <pre><code>mv .git/objects/pack/pack-**yourpack**.pack oldpack git unpa... | 119, 37230 | git, git-checkout | <h1>Problems with corrupt git repo</h1>
<p>My git repo got corrupted while running a find and replace command (See here: <a href="https://stackoverflow.com/questions/14564936/git-reset-failing-after-find-and-replace">Git reset failing after find and replace</a>). So I deleted some pack files about which git told me tha... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,905 | git | # Problems with corrupt git repo
My git repo got corrupted while running a find and replace command (See here: [Git reset failing after find and replace](https://stackoverflow.com/questions/14564936/git-reset-failing-after-find-and-replace)). So I deleted some pack files about which git told me that there were not rea... | First: Make a backup of your `.git` directory in case you corrupt things more in this process. Then:
- Put back the best version of the packfiles you have available.
- For each of the corrupt packfiles, run:
```
mv .git/objects/pack/pack-**yourpack**.pack oldpack
git unpack-objects -r < oldpack
```
- Run `git... |
8780257 | Git rebase a branch onto master failed, how to resolve? | 27 | 2012-01-08 18:53:34 | <p>I've been working on a local copy of a remote git repo.
I created a branch on my local copy, let's call it 'my_branch'.
I've committed a few times on my_branch.</p>
<p>I recently pushed 'my_branch' to remote. However I didn't know that someone else added a version to the remote master. So, I fetched it to my local ... | 68,679 | 201,381 | 2020-09-22 08:56:04 | 8,780,538 | 42 | 2012-01-08 19:31:46 | 130,535 | 2012-01-08 19:31:46 | https://stackoverflow.com/q/8780257 | https://stackoverflow.com/a/8780538 | <p>git rebase has found a <code>.git/rebase-apply</code> directory and so presumes that you might be in the middle of a rebase. This would have happened if there was a conflict during a previous rebase and the rebase was not finished; i.e. you did not run one of <code>git rebase --abort</code>, <code>git rebase --skip<... | <p>git rebase has found a <code>.git/rebase-apply</code> directory and so presumes that you might be in the middle of a rebase. This would have happened if there was a conflict during a previous rebase and the rebase was not finished; i.e. you did not run one of <code>git rebase --abort</code>, <code>git rebase --skip<... | 119, 29934 | git, git-rebase | <h1>Git rebase a branch onto master failed, how to resolve?</h1>
<p>I've been working on a local copy of a remote git repo.
I created a branch on my local copy, let's call it 'my_branch'.
I've committed a few times on my_branch.</p>
<p>I recently pushed 'my_branch' to remote. However I didn't know that someone else ad... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,906 | git | # Git rebase a branch onto master failed, how to resolve?
I've been working on a local copy of a remote git repo.
I created a branch on my local copy, let's call it 'my_branch'.
I've committed a few times on my_branch.
I recently pushed 'my_branch' to remote. However I didn't know that someone else added a version to... | git rebase has found a `.git/rebase-apply` directory and so presumes that you might be in the middle of a rebase. This would have happened if there was a conflict during a previous rebase and the rebase was not finished; i.e. you did not run one of `git rebase --abort`, `git rebase --skip` or `git rebase --continue` (t... |
52862861 | How to install a specific git branch with pipenv | 26 | 2018-10-17 20:09:59 | <p>How can I install a specific git branch with pipenv? I know this command will install the bitcoinlib master branch</p>
<pre><code>pipenv install -e git+https://github.com/1200wd/bitcoinlib.git#egg=bitcoinlib
</code></pre>
<p>But how can I install a branch that isn't master? </p>
| 12,382 | 5,838,056 | 2024-01-19 14:22:31 | 52,863,110 | 42 | 2018-10-17 20:29:47 | 5,838,056 | 2018-10-17 20:29:47 | https://stackoverflow.com/q/52862861 | https://stackoverflow.com/a/52863110 | <p>You need to simply use the @ symbol to specify branch and change the egg name to be a bit different if you're also using the master or some other branch. Follow this syntax</p>
<pre><code>pipenv install -e git+<your/target/git/repository/url.git>@branch#egg=package_name
</code></pre>
<p>So in my example I ne... | <p>You need to simply use the @ symbol to specify branch and change the egg name to be a bit different if you're also using the master or some other branch. Follow this syntax</p> <pre><code>pipenv install -e git+<your/target/git/repository/url.git>@branch#egg=package_name </code></pre> <p>So in my example I ne... | 16, 119, 128625 | git, pipenv, python | <h1>How to install a specific git branch with pipenv</h1>
<p>How can I install a specific git branch with pipenv? I know this command will install the bitcoinlib master branch</p>
<pre><code>pipenv install -e git+https://github.com/1200wd/bitcoinlib.git#egg=bitcoinlib
</code></pre>
<p>But how can I install a branch t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,907 | git | # How to install a specific git branch with pipenv
How can I install a specific git branch with pipenv? I know this command will install the bitcoinlib master branch
```
pipenv install -e git+https://github.com/1200wd/bitcoinlib.git#egg=bitcoinlib
```
But how can I install a branch that isn't master? | You need to simply use the @ symbol to specify branch and change the egg name to be a bit different if you're also using the master or some other branch. Follow this syntax
```
pipenv install -e git+<your/target/git/repository/url.git>@branch#egg=package_name
```
So in my example I needed to use the segwit-support br... |
37832988 | GIT: how to merge two branches without actually merging files (trivial merge) | 26 | 2016-06-15 10:35:22 | <p>Is there a way in git to merge two branches without merging file? In other words just to draw the merge arrow.</p>
<p>Let say I have branches A and B. I need to merge branch B to A, but no need all the changes in B, but rather only need to link to branches together.</p>
<pre><code>git checkout A
git merge B --no nee... | 9,133 | 2,334,422 | 2022-02-08 14:01:15 | 37,834,841 | 42 | 2016-06-15 11:59:09 | 1,248,008 | 2016-06-15 11:59:09 | https://stackoverflow.com/q/37832988 | https://stackoverflow.com/a/37834841 | <p>Use <code>git merge -s ours B</code> to perform a merge discarding any changes B would introduce. Still, the commits from <code>B</code> are now in <code>A</code>, however, the files are at the state of <code>A</code> before the merge.</p>
| <p>Use <code>git merge -s ours B</code> to perform a merge discarding any changes B would introduce. Still, the commits from <code>B</code> are now in <code>A</code>, however, the files are at the state of <code>A</code> before the merge.</p> | 119, 28897 | git, git-merge | <h1>GIT: how to merge two branches without actually merging files (trivial merge)</h1>
<p>Is there a way in git to merge two branches without merging file? In other words just to draw the merge arrow.</p>
<p>Let say I have branches A and B. I need to merge branch B to A, but no need all the changes in B, but rather onl... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,909 | git | # GIT: how to merge two branches without actually merging files (trivial merge)
Is there a way in git to merge two branches without merging file? In other words just to draw the merge arrow.
Let say I have branches A and B. I need to merge branch B to A, but no need all the changes in B, but rather only need to link ... | Use `git merge -s ours B` to perform a merge discarding any changes B would introduce. Still, the commits from `B` are now in `A`, however, the files are at the state of `A` before the merge. |
31595873 | Git stash with staged files. Does stash convert staged files to unstaged? | 26 | 2015-07-23 18:56:43 | <p>I was working on a large set of changes to a code base. Some of the changes had been staged, and some had not. I needed to switch to a different branch, but was not ready to make a commit, so I stashed my current state using <code>git stash</code>.</p>
<p>Later, I went to apply my stash with, <code>git stash apply<... | 11,356 | 300,526 | 2022-05-17 07:56:04 | 31,596,366 | 42 | 2015-07-23 19:24:37 | 1,256,452 | 2022-05-17 07:56:04 | https://stackoverflow.com/q/31595873 | https://stackoverflow.com/a/31596366 | <p>The answer to the question as asked ("does stash convert staged files to unstaged") is both yes and no.</p>
<p>If you've applied with <code>git stash apply</code> (vs <code>git stash pop</code>), you're in great shape because the stash is still present. But let's back up a bit and look at the underlying m... | <p>The answer to the question as asked ("does stash convert staged files to unstaged") is both yes and no.</p> <p>If you've applied with <code>git stash apply</code> (vs <code>git stash pop</code>), you're in great shape because the stash is still present. But let's back up a bit and look at the underlying m... | 119, 13091 | git, git-stash | <h1>Git stash with staged files. Does stash convert staged files to unstaged?</h1>
<p>I was working on a large set of changes to a code base. Some of the changes had been staged, and some had not. I needed to switch to a different branch, but was not ready to make a commit, so I stashed my current state using <code>git... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,910 | git | # Git stash with staged files. Does stash convert staged files to unstaged?
I was working on a large set of changes to a code base. Some of the changes had been staged, and some had not. I needed to switch to a different branch, but was not ready to make a commit, so I stashed my current state using `git stash`.
Late... | The answer to the question as asked ("does stash convert staged files to unstaged") is both yes and no.
If you've applied with `git stash apply` (vs `git stash pop`), you're in great shape because the stash is still present. But let's back up a bit and look at the underlying mechanism, since it matters here.
When you... |
21703565 | How can I untrack a file from a git repository in Intellij | 26 | 2014-02-11 13:43:30 | <p>I'm having a tracked file in git but now I don't want to track it anymore (I don't want it to show up from the next commit but I still want to have it inside the folder).</p>
<p>In the <code>Changes</code> tool window I have set that file as <code>ignored</code> in <code>Configured Ignored Files</code> but somehow ... | 32,031 | 1,950,295 | 2019-12-10 13:59:34 | 21,703,813 | 42 | 2014-02-11 13:54:34 | 2,842,568 | 2018-04-27 08:12:13 | https://stackoverflow.com/q/21703565 | https://stackoverflow.com/a/21703813 | <p>As of 2017.3.4, you cannot use the IDEA GUI to perform this command, it must be done from the command line or another tool.</p>
<p>From console:</p>
<pre><code>git rm --cached file
git commit -m'file removed'
echo 'file' >> .gitignore
</code></pre>
| <p>As of 2017.3.4, you cannot use the IDEA GUI to perform this command, it must be done from the command line or another tool.</p> <p>From console:</p> <pre><code>git rm --cached file git commit -m'file removed' echo 'file' >> .gitignore </code></pre> | 119, 8945 | git, intellij-idea | <h1>How can I untrack a file from a git repository in Intellij</h1>
<p>I'm having a tracked file in git but now I don't want to track it anymore (I don't want it to show up from the next commit but I still want to have it inside the folder).</p>
<p>In the <code>Changes</code> tool window I have set that file as <code>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,911 | git | # How can I untrack a file from a git repository in Intellij
I'm having a tracked file in git but now I don't want to track it anymore (I don't want it to show up from the next commit but I still want to have it inside the folder).
In the `Changes` tool window I have set that file as `ignored` in `Configured Ignored ... | As of 2017.3.4, you cannot use the IDEA GUI to perform this command, it must be done from the command line or another tool.
From console:
```
git rm --cached file
git commit -m'file removed'
echo 'file' >> .gitignore
``` |
6667244 | what does this message mean? more than one branch.<name>.remote | 26 | 2011-07-12 15:57:17 | <p>In the output from <code>git remote show origin</code>, I see this message:</p>
<pre><code>warning: more than one branch.main_int.remote
</code></pre>
<p>A more canonical example would be:</p>
<pre><code>warning: more than one branch.master.remote
</code></pre>
<p>What does this mean? Is it bad, and how do I fix... | 7,036 | 561,638 | 2024-05-04 14:15:15 | 6,667,773 | 42 | 2011-07-12 16:35:50 | 712,605 | 2013-07-05 03:46:45 | https://stackoverflow.com/q/6667244 | https://stackoverflow.com/a/6667773 | <p>You have more than one <code>remote = ...</code> setting in the <code>[branch "master"]</code> (or <code>[branch "main_int"]</code>) section of your config file(s). To see this, run:</p>
<pre><code>git config --get-all branch.master.remote
</code></pre>
<p>Chances are both lines are in the <code>.git/config</code... | <p>You have more than one <code>remote = ...</code> setting in the <code>[branch "master"]</code> (or <code>[branch "main_int"]</code>) section of your config file(s). To see this, run:</p> <pre><code>git config --get-all branch.master.remote </code></pre> <p>Chances are both lines are in the <code>.git/config</code... | 119, 76220 | git, git-branch | <h1>what does this message mean? more than one branch.<name>.remote</h1>
<p>In the output from <code>git remote show origin</code>, I see this message:</p>
<pre><code>warning: more than one branch.main_int.remote
</code></pre>
<p>A more canonical example would be:</p>
<pre><code>warning: more than one branch.master.... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,912 | git | # what does this message mean? more than one branch..remote
In the output from `git remote show origin`, I see this message:
```
warning: more than one branch.main_int.remote
```
A more canonical example would be:
```
warning: more than one branch.master.remote
```
What does this mean? Is it bad, and how do I fix ... | You have more than one `remote = ...` setting in the `[branch "master"]` (or `[branch "main_int"]`) section of your config file(s). To see this, run:
```
git config --get-all branch.master.remote
```
Chances are both lines are in the `.git/config` file. Delete one of the lines.
If you only see one `remote = ...` lin... |
61807600 | show current git branch using the 'git branch' command | 25 | 2020-05-14 21:20:48 | <p>I have a problem when working on too many branches, it takes a lot of time to find which is the current branch I am working on right now. Is there a way to list the current branch on top of the list that shows up when using the <code>git branch</code> command?</p>
| 53,219 | 8,997,597 | 2022-03-30 07:00:21 | 61,807,766 | 42 | 2020-05-14 21:31:58 | 1,126,841 | 2020-05-14 21:31:58 | https://stackoverflow.com/q/61807600 | https://stackoverflow.com/a/61807766 | <p>If you just want the checked-out branch, use <code>git branch --show-current</code>.</p>
| <p>If you just want the checked-out branch, use <code>git branch --show-current</code>.</p> | 119 | git | <h1>show current git branch using the 'git branch' command</h1>
<p>I have a problem when working on too many branches, it takes a lot of time to find which is the current branch I am working on right now. Is there a way to list the current branch on top of the list that shows up when using the <code>git branch</code> c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,913 | git | # show current git branch using the 'git branch' command
I have a problem when working on too many branches, it takes a lot of time to find which is the current branch I am working on right now. Is there a way to list the current branch on top of the list that shows up when using the `git branch` command? | If you just want the checked-out branch, use `git branch --show-current`. |
2557564 | how do i identify files/directories that were added or removed in a git commit? | 25 | 2010-04-01 01:10:11 | <p>I need to write a script that incrementally keeps track of files and directories added and removed from a git repo. </p>
<p>I have tried to use:</p>
<pre><code>git log -n1 --pretty="format:" --name-only
</code></pre>
<p>But that only tells me which files were committed. It does not specify if it was added or re... | 12,211 | 215,847 | 2018-07-06 08:11:27 | 2,557,655 | 42 | 2010-04-01 01:38:48 | 119,963 | 2010-04-01 01:44:15 | https://stackoverflow.com/q/2557564 | https://stackoverflow.com/a/2557655 | <p>The option you're looking for is <code>--name-status</code>. Like <code>--name-only</code> it's actually a git-diff option; git-log accepts those to determine how it'll display patches.</p>
<pre><code>git log -n 1 --pretty=oneline --name-status
</code></pre>
<p>Or equivalently (minus the log header):</p>
<pre><co... | <p>The option you're looking for is <code>--name-status</code>. Like <code>--name-only</code> it's actually a git-diff option; git-log accepts those to determine how it'll display patches.</p> <pre><code>git log -n 1 --pretty=oneline --name-status </code></pre> <p>Or equivalently (minus the log header):</p> <pre><co... | 119, 47913 | git, git-log | <h1>how do i identify files/directories that were added or removed in a git commit?</h1>
<p>I need to write a script that incrementally keeps track of files and directories added and removed from a git repo. </p>
<p>I have tried to use:</p>
<pre><code>git log -n1 --pretty="format:" --name-only
</code></pre>
<p>But ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,918 | git | # how do i identify files/directories that were added or removed in a git commit?
I need to write a script that incrementally keeps track of files and directories added and removed from a git repo.
I have tried to use:
```
git log -n1 --pretty="format:" --name-only
```
But that only tells me which files were commit... | The option you're looking for is `--name-status`. Like `--name-only` it's actually a git-diff option; git-log accepts those to determine how it'll display patches.
```
git log -n 1 --pretty=oneline --name-status
```
Or equivalently (minus the log header):
```
git diff --name-status HEAD^ HEAD
```
As isbadawi points... |
39378357 | gitignore, how to exclude a specific directory | 24 | 2016-09-07 20:19:19 | <p>I'm trying to utilize a <code>.gitignore</code> file to exclude a specific directory, but I'm having some trouble. I looked up how to do this previously on a few forums, including stackoverflow, and while I found it a bit confusing, I had thought I understood it, but it seems to not be working as I thought.</p>
<p>... | 29,930 | 4,200,910 | 2025-11-29 04:58:17 | 39,378,392 | 42 | 2016-09-07 20:22:25 | 860,034 | 2025-11-29 04:58:17 | https://stackoverflow.com/q/39378357 | https://stackoverflow.com/a/39378392 | <p>You want to set the root to / which will be <em><strong>relative to the location of your gitignore file</strong></em>.</p>
<p>So you want:</p>
<pre><code>/images
</code></pre>
<p>That will ignore any file OR directory named images in the same directory as the gitignore file you are using.</p>
<p>If you want to speci... | <p>You want to set the root to / which will be <em><strong>relative to the location of your gitignore file</strong></em>.</p> <p>So you want:</p> <pre><code>/images </code></pre> <p>That will ignore any file OR directory named images in the same directory as the gitignore file you are using.</p> <p>If you want to speci... | 119, 4333, 7330, 25056 | git, gitignore, ignore, repository | <h1>gitignore, how to exclude a specific directory</h1>
<p>I'm trying to utilize a <code>.gitignore</code> file to exclude a specific directory, but I'm having some trouble. I looked up how to do this previously on a few forums, including stackoverflow, and while I found it a bit confusing, I had thought I understood i... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,919 | git | # gitignore, how to exclude a specific directory
I'm trying to utilize a `.gitignore` file to exclude a specific directory, but I'm having some trouble. I looked up how to do this previously on a few forums, including stackoverflow, and while I found it a bit confusing, I had thought I understood it, but it seems to n... | You want to set the root to / which will be ***relative to the location of your gitignore file***.
So you want:
```
/images
```
That will ignore any file OR directory named images in the same directory as the gitignore file you are using.
If you want to specify that it should only match the images directory then ad... |
26871381 | Deploying a local django app using openshift | 24 | 2014-11-11 18:01:23 | <p>I've built a webapp using django. In order to host it I'm trying to use openshift but am having difficulty in getting anything working. There seems to be a lack of step by steps for this. So far I have git working fine, the app works on the local dev environment and I've successfully created an app on openshift.<... | 13,512 | 1,019,635 | 2016-07-25 17:50:44 | 26,874,375 | 42 | 2014-11-11 20:54:33 | 1,105,249 | 2016-07-25 17:50:44 | https://stackoverflow.com/q/26871381 | https://stackoverflow.com/a/26874375 | <p><strong>Edit</strong>: <em>Remember this is a platform-dependent answer and since the OpenShift platform serving Django may change, this answer could become invalid. As of Apr 1 2016, this answer remains valid at its whole extent.</em></p>
<p>Many times this happened to me and, since I had to mount at least 5 appli... | <p><strong>Edit</strong>: <em>Remember this is a platform-dependent answer and since the OpenShift platform serving Django may change, this answer could become invalid. As of Apr 1 2016, this answer remains valid at its whole extent.</em></p> <p>Many times this happened to me and, since I had to mount at least 5 appli... | 16, 119, 243, 77738 | django, git, openshift, python | <h1>Deploying a local django app using openshift</h1>
<p>I've built a webapp using django. In order to host it I'm trying to use openshift but am having difficulty in getting anything working. There seems to be a lack of step by steps for this. So far I have git working fine, the app works on the local dev environme... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,920 | git | # Deploying a local django app using openshift
I've built a webapp using django. In order to host it I'm trying to use openshift but am having difficulty in getting anything working. There seems to be a lack of step by steps for this. So far I have git working fine, the app works on the local dev environment and I've ... | **Edit**: *Remember this is a platform-dependent answer and since the OpenShift platform serving Django may change, this answer could become invalid. As of Apr 1 2016, this answer remains valid at its whole extent.*
Many times this happened to me and, since I had to mount at least 5 applications, I had to create my ow... |
58658954 | npm install returns syscall spawn git error | 23 | 2019-11-01 12:04:21 | <p>I've tried to run npm install and faced these issues below</p>
<p>I've tried to clear cache with force command, install git and update node but nothing worked</p>
<p>here is the error</p>
<pre><code>npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while... | 42,260 | 10,578,437 | 2023-05-05 09:17:11 | 58,659,670 | 42 | 2019-11-01 13:00:55 | 5,613,720 | 2021-04-04 17:20:50 | https://stackoverflow.com/q/58658954 | https://stackoverflow.com/a/58659670 | <p>Make sure you have the GIT installed on your device and accessible globally. Try to type <code>git --version</code> in the CMD. If it returned that the command is not recognized and GIT already installed, then you need to add it to the PATH environment variable and make sure to try the command using a new CMD sessio... | <p>Make sure you have the GIT installed on your device and accessible globally. Try to type <code>git --version</code> in the CMD. If it returned that the command is not recognized and GIT already installed, then you need to add it to the PATH environment variable and make sure to try the command using a new CMD sessio... | 119, 46426, 61387, 78230, 125866 | angular, git, node.js, node-modules, npm | <h1>npm install returns syscall spawn git error</h1>
<p>I've tried to run npm install and faced these issues below</p>
<p>I've tried to clear cache with force command, install git and update node but nothing worked</p>
<p>here is the error</p>
<pre><code>npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,923 | git | # npm install returns syscall spawn git error
I've tried to run npm install and faced these issues below
I've tried to clear cache with force command, install git and update node but nothing worked
here is the error
```
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR!... | Make sure you have the GIT installed on your device and accessible globally. Try to type `git --version` in the CMD. If it returned that the command is not recognized and GIT already installed, then you need to add it to the PATH environment variable and make sure to try the command using a new CMD session |
36185456 | .gitignored files still shown in RStudio | 22 | 2016-03-23 18:00:15 | <p>I added the folder <code>.Rproj.user</code> to <code>.gitignore</code>. However, some files contained in it still show up (see screenshot). Any ideas what can I do about it?</p>
<p><a href="https://i.sstatic.net/60gGO.png" rel="noreferrer"><img src="https://i.sstatic.net/60gGO.png" alt="enter image description here... | 7,295 | 536,198 | 2019-10-11 21:23:25 | 36,185,597 | 42 | 2016-03-23 18:07:18 | 1,755,598 | 2019-10-11 21:23:25 | https://stackoverflow.com/q/36185456 | https://stackoverflow.com/a/36185597 | <p>First of all your files are already committed so you have to remove it from the repo:</p>
<pre class="lang-sh prettyprint-override"><code># Once you add files to git, it will keep tracking them,
# so we have to delete them and commit your deletion
git rm -r --cached .Rproj.user/**
# Commit the deleted files
git c... | <p>First of all your files are already committed so you have to remove it from the repo:</p> <pre class="lang-sh prettyprint-override"><code># Once you add files to git, it will keep tracking them, # so we have to delete them and commit your deletion git rm -r --cached .Rproj.user/** # Commit the deleted files git c... | 119, 4452, 67746 | git, r, rstudio | <h1>.gitignored files still shown in RStudio</h1>
<p>I added the folder <code>.Rproj.user</code> to <code>.gitignore</code>. However, some files contained in it still show up (see screenshot). Any ideas what can I do about it?</p>
<p><a href="https://i.sstatic.net/60gGO.png" rel="noreferrer"><img src="https://i.sstati... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,926 | git | # .gitignored files still shown in RStudio
I added the folder `.Rproj.user` to `.gitignore`. However, some files contained in it still show up (see screenshot). Any ideas what can I do about it?
[](https://i.sstatic.net/60gGO.png)
**Update**
No changes... | First of all your files are already committed so you have to remove it from the repo:
```
# Once you add files to git, it will keep tracking them,
# so we have to delete them and commit your deletion
git rm -r --cached .Rproj.user/**
# Commit the deleted files
git commit -m "Removed files...."
# now add it to the ... |
42028437 | How to change git submodules url locally? | 20 | 2017-02-03 16:11:53 | <p>The original <code>.gitmodules</code> file uses the hard coded <code>https</code> urls but for some automated tests I clone from <code>ssh</code> and make the submodule urls relative as in <code>../ModuleName</code>. I don't want to push these changes back into the repo either.</p>
<pre><code># change the https://g... | 32,339 | 2,370,920 | 2022-03-15 10:49:49 | 42,035,018 | 42 | 2017-02-04 00:13:18 | 2,747,593 | 2017-02-04 04:45:01 | https://stackoverflow.com/q/42028437 | https://stackoverflow.com/a/42035018 | <p>If you want to modify the URL used for a submodule only for the local repo, then don't modify the <code>.gitmodules</code> file, that is only for changes that you want to push.</p>
<p>Instead, first initialize the local submodule config:</p>
<pre><code>git submodule init
</code></pre>
<p>Then modify the <code>.gi... | <p>If you want to modify the URL used for a submodule only for the local repo, then don't modify the <code>.gitmodules</code> file, that is only for changes that you want to push.</p> <p>Instead, first initialize the local submodule config:</p> <pre><code>git submodule init </code></pre> <p>Then modify the <code>.gi... | 119, 41612 | git, git-submodules | <h1>How to change git submodules url locally?</h1>
<p>The original <code>.gitmodules</code> file uses the hard coded <code>https</code> urls but for some automated tests I clone from <code>ssh</code> and make the submodule urls relative as in <code>../ModuleName</code>. I don't want to push these changes back into the ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,928 | git | # How to change git submodules url locally?
The original `.gitmodules` file uses the hard coded `https` urls but for some automated tests I clone from `ssh` and make the submodule urls relative as in `../ModuleName`. I don't want to push these changes back into the repo either.
```
# change the https://github.com/ wi... | If you want to modify the URL used for a submodule only for the local repo, then don't modify the `.gitmodules` file, that is only for changes that you want to push.
Instead, first initialize the local submodule config:
```
git submodule init
```
Then modify the `.git/config` file to change the submodule URL as usua... |
36058453 | Git - recover intermediate commits after squash | 19 | 2016-03-17 10:54:08 | <p>I have squashed several commits into one commit. One of the commits before the squash included debug prints and a later commit that was squashed together with it removed those prints.
Is there any way to recover them?</p>
| 10,988 | 4,492,809 | 2023-07-04 05:14:38 | 36,058,504 | 42 | 2016-03-17 10:56:10 | 391,161 | 2016-03-17 11:02:01 | https://stackoverflow.com/q/36058453 | https://stackoverflow.com/a/36058504 | <p>Yes. Use <code>git reflog</code> and then <code>git checkout</code> the commit hash right before the squash.</p>
<p>Here's an example sequence of events.</p>
<pre><code>git init .
touch Foo1 Foo2 Foo3
git add Foo1
git commit -m 'Adding Foo1'
git add Foo2
git commit -m 'Adding Foo2'
git add Foo3
git commit -m 'Addi... | <p>Yes. Use <code>git reflog</code> and then <code>git checkout</code> the commit hash right before the squash.</p> <p>Here's an example sequence of events.</p> <pre><code>git init . touch Foo1 Foo2 Foo3 git add Foo1 git commit -m 'Adding Foo1' git add Foo2 git commit -m 'Adding Foo2' git add Foo3 git commit -m 'Addi... | 119, 2200, 98455 | git, git-squash, recovery | <h1>Git - recover intermediate commits after squash</h1>
<p>I have squashed several commits into one commit. One of the commits before the squash included debug prints and a later commit that was squashed together with it removed those prints.
Is there any way to recover them?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,931 | git | # Git - recover intermediate commits after squash
I have squashed several commits into one commit. One of the commits before the squash included debug prints and a later commit that was squashed together with it removed those prints.
Is there any way to recover them? | Yes. Use `git reflog` and then `git checkout` the commit hash right before the squash.
Here's an example sequence of events.
```
git init .
touch Foo1 Foo2 Foo3
git add Foo1
git commit -m 'Adding Foo1'
git add Foo2
git commit -m 'Adding Foo2'
git add Foo3
git commit -m 'Adding Foo3'
git log # Observe all three commit... |
31543997 | Make GIT ignore/remove DLL,PDB and similar generated files | 17 | 2015-07-21 15:56:01 | <p>I have issues convicing GIT to ingore generated files</p>
<p>Here is an example of the files that I want to ignore</p>
<pre><code> modified: BLLTarifario/bin/Debug/BLLTarifario.dll
modified: BLLTarifario/bin/Debug/BLLTarifario.pdb
modified: BLLTarifario/bin/Debug/Corte.Library.dll
modified: ... | 37,517 | 1,461,862 | 2021-07-18 16:20:15 | 31,544,116 | 42 | 2015-07-21 16:02:53 | 93,306 | 2015-07-21 16:24:02 | https://stackoverflow.com/q/31543997 | https://stackoverflow.com/a/31544116 | <p>It looks like you had these files already committed before you added your rules to the <code>.gitignore</code> file. Git will continue to monitor files that are already being tracked.</p>
<p>You'll need to make a commit where you remove these files, then they should be ignored afterwards.</p>
<p><strong>Edit:</str... | <p>It looks like you had these files already committed before you added your rules to the <code>.gitignore</code> file. Git will continue to monitor files that are already being tracked.</p> <p>You'll need to make a commit where you remove these files, then they should be ignored afterwards.</p> <p><strong>Edit:</str... | 119, 33953 | git, visual-studio | <h1>Make GIT ignore/remove DLL,PDB and similar generated files</h1>
<p>I have issues convicing GIT to ingore generated files</p>
<p>Here is an example of the files that I want to ignore</p>
<pre><code> modified: BLLTarifario/bin/Debug/BLLTarifario.dll
modified: BLLTarifario/bin/Debug/BLLTarifario.pdb
m... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,934 | git | # Make GIT ignore/remove DLL,PDB and similar generated files
I have issues convicing GIT to ingore generated files
Here is an example of the files that I want to ignore
```
modified: BLLTarifario/bin/Debug/BLLTarifario.dll
modified: BLLTarifario/bin/Debug/BLLTarifario.pdb
modified: BLLTarifario/bin... | It looks like you had these files already committed before you added your rules to the `.gitignore` file. Git will continue to monitor files that are already being tracked.
You'll need to make a commit where you remove these files, then they should be ignored afterwards.
**Edit:** To remove a folder and it's contents... |
53209237 | How to solve merge conflict in a approved review in gerrit? | 16 | 2018-11-08 13:59:00 | <p>I made a change in gerrit which was code reviewed and after 7 revisions approved. But, now it cannot be merged and trying to rebase in gerrit website is not working due to merge conflict. How can I resolve this merge conflict and merge the same approved change and not create a new one.
(Full steps from cloning the ... | 40,238 | 10,319,826 | 2022-03-03 22:51:17 | 53,213,237 | 42 | 2018-11-08 17:34:12 | 4,653,675 | 2018-11-08 17:34:12 | https://stackoverflow.com/q/53209237 | https://stackoverflow.com/a/53213237 | <p>1) Clone the Gerrit repository</p>
<pre><code>git clone https://USER@GERRIT-SERVER/a/REPO-FULL-PATHNAME
</code></pre>
<p>2) Go to the change page on Gerrit and copy the checkout patch command</p>
<pre><code>git fetch https://USER@GERRIT-SERVER/a/REPO-FULL-PATHNAME refs/changes/XX/YYYYY/Z && git checkout F... | <p>1) Clone the Gerrit repository</p> <pre><code>git clone https://USER@GERRIT-SERVER/a/REPO-FULL-PATHNAME </code></pre> <p>2) Go to the change page on Gerrit and copy the checkout patch command</p> <pre><code>git fetch https://USER@GERRIT-SERVER/a/REPO-FULL-PATHNAME refs/changes/XX/YYYYY/Z && git checkout F... | 28897, 52272, 62599 | gerrit, git-merge, merge-conflict-resolution | <h1>How to solve merge conflict in a approved review in gerrit?</h1>
<p>I made a change in gerrit which was code reviewed and after 7 revisions approved. But, now it cannot be merged and trying to rebase in gerrit website is not working due to merge conflict. How can I resolve this merge conflict and merge the same app... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,935 | git | # How to solve merge conflict in a approved review in gerrit?
I made a change in gerrit which was code reviewed and after 7 revisions approved. But, now it cannot be merged and trying to rebase in gerrit website is not working due to merge conflict. How can I resolve this merge conflict and merge the same approved cha... | 1) Clone the Gerrit repository
```
git clone https://USER@GERRIT-SERVER/a/REPO-FULL-PATHNAME
```
2) Go to the change page on Gerrit and copy the checkout patch command
```
git fetch https://USER@GERRIT-SERVER/a/REPO-FULL-PATHNAME refs/changes/XX/YYYYY/Z && git checkout FETCH_HEAD
```
3) Rebase the change
```
git r... |
14609263 | Getting an error pushing to github - Updates were rejected because a pushed branch tip is behind its remote | 16 | 2013-01-30 16:49:07 | <p>I am having a problem pushing to a different heroku remote.</p>
<p>To check myself I renamed my entire project directory to _backup and then:</p>
<pre><code>git clone account/repo_name
git remote add repo2 git@heroku.com:repo2.git
git push repo2 branch_abc:master
</code></pre>
<p>But I am still getting </p>
<p... | 40,854 | 631,619 | 2020-08-25 07:00:01 | 14,609,377 | 42 | 2013-01-30 16:53:59 | 981,616 | 2014-04-28 21:26:47 | https://stackoverflow.com/q/14609263 | https://stackoverflow.com/a/14609377 | <p><strong>If you don't care about what's currently in repo2 and are confident that totally overwriting it is ok</strong> then you can use:</p>
<pre><code>$ git push -f git@heroku.com:<heroku repo name>.git
</code></pre>
<p>Remember though that <code>push -f</code> <strong>can wipe out other developers changes<... | <p><strong>If you don't care about what's currently in repo2 and are confident that totally overwriting it is ok</strong> then you can use:</p> <pre><code>$ git push -f git@heroku.com:<heroku repo name>.git </code></pre> <p>Remember though that <code>push -f</code> <strong>can wipe out other developers changes<... | 119, 8279 | git, heroku | <h1>Getting an error pushing to github - Updates were rejected because a pushed branch tip is behind its remote</h1>
<p>I am having a problem pushing to a different heroku remote.</p>
<p>To check myself I renamed my entire project directory to _backup and then:</p>
<pre><code>git clone account/repo_name
git remote a... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,936 | git | # Getting an error pushing to github - Updates were rejected because a pushed branch tip is behind its remote
I am having a problem pushing to a different heroku remote.
To check myself I renamed my entire project directory to _backup and then:
```
git clone account/repo_name
git remote add repo2 git@heroku.com:rep... | **If you don't care about what's currently in repo2 and are confident that totally overwriting it is ok** then you can use:
```
$ git push -f git@heroku.com:<heroku repo name>.git
```
Remember though that `push -f` **can wipe out other developers changes** if they were posted since you last pulled from the repo... so... |
52704791 | How to connect to the selected app with heroku CLI | 13 | 2018-10-08 14:46:08 | <p>I'm attempting to deploy my Java web app on Heroku. When I was making a tutorial I've created an app using <em>heroku create</em> command, lets say it wasy "name-app1". Then I removed it after the tutorial and create the new one to deploy it let it be: "new_app". However, when I attempt to do anything like upload my... | 22,334 | 7,189,801 | 2022-09-05 08:19:13 | 52,716,280 | 42 | 2018-10-09 08:13:09 | 6,790,990 | 2018-10-09 08:13:09 | https://stackoverflow.com/q/52704791 | https://stackoverflow.com/a/52716280 | <p>The way you try to set your remote for heroku is incorrect. That is why you get the above error.
To set your remote correctly use the below command</p>
<pre><code>heroku git:remote -a new_app
</code></pre>
<p>This will set your remote to newly crated app <strong>new_app</strong></p>
<p>To deploy the code use belo... | <p>The way you try to set your remote for heroku is incorrect. That is why you get the above error. To set your remote correctly use the below command</p> <pre><code>heroku git:remote -a new_app </code></pre> <p>This will set your remote to newly crated app <strong>new_app</strong></p> <p>To deploy the code use belo... | 119, 8279 | git, heroku | <h1>How to connect to the selected app with heroku CLI</h1>
<p>I'm attempting to deploy my Java web app on Heroku. When I was making a tutorial I've created an app using <em>heroku create</em> command, lets say it wasy "name-app1". Then I removed it after the tutorial and create the new one to deploy it let it be: "new... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,939 | git | # How to connect to the selected app with heroku CLI
I'm attempting to deploy my Java web app on Heroku. When I was making a tutorial I've created an app using *heroku create* command, lets say it wasy "name-app1". Then I removed it after the tutorial and create the new one to deploy it let it be: "new_app". However, ... | The way you try to set your remote for heroku is incorrect. That is why you get the above error.
To set your remote correctly use the below command
```
heroku git:remote -a new_app
```
This will set your remote to newly crated app **new_app**
To deploy the code use below command
```
git push heroku master
```
This... |
75395845 | How can I change when Git commit message length warning appears in VS Code? | 12 | 2023-02-09 08:14:48 | <p><a href="https://i.sstatic.net/rTgm4.png" rel="noreferrer"><img src="https://i.sstatic.net/rTgm4.png" alt="enter image description here" /></a></p>
<p>Is there a way to get VS Code to automatically adjust the commit line message to avoid this warning. Otherwise I need to pay attention and press enter when the messag... | 8,333 | 5,723,270 | 2025-01-03 19:25:29 | 75,395,887 | 42 | 2023-02-09 08:19:58 | 11,107,541 | 2025-01-03 19:25:29 | https://stackoverflow.com/q/75395845 | https://stackoverflow.com/a/75395887 | <p>If you want to just change the threshold for showing the warning, use <code>"git.inputValidationSubjectLength": <N></code> for the subject line (the first line) and <code>"git.inputValidationLength": <N></code> for subsequent lines.</p>
<p>If you want to turn the validation off entire... | <p>If you want to just change the threshold for showing the warning, use <code>"git.inputValidationSubjectLength": <N></code> for the subject line (the first line) and <code>"git.inputValidationLength": <N></code> for subsequent lines.</p> <p>If you want to turn the validation off entire... | 119, 111608 | git, visual-studio-code | <h1>How can I change when Git commit message length warning appears in VS Code?</h1>
<p><a href="https://i.sstatic.net/rTgm4.png" rel="noreferrer"><img src="https://i.sstatic.net/rTgm4.png" alt="enter image description here" /></a></p>
<p>Is there a way to get VS Code to automatically adjust the commit line message to ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,940 | git | # How can I change when Git commit message length warning appears in VS Code?
[](https://i.sstatic.net/rTgm4.png)
Is there a way to get VS Code to automatically adjust the commit line message to avoid this warning. Otherwise I need to pay attention and p... | If you want to just change the threshold for showing the warning, use `"git.inputValidationSubjectLength": <N>` for the subject line (the first line) and `"git.inputValidationLength": <N>` for subsequent lines.
If you want to turn the validation off entirely, use `"git.inputValidation": "off"`. Note that [in VS Code 1... |
38480098 | Failed to connect to bitbucket.org port 443: No route to host | 10 | 2016-07-20 11:30:58 | <p>I am getting error as <strong>Failed to connect to bitbucket.org port 443: No route to host</strong> when i try to pull or push.
The same repositories are available to pull push outside our network.
What could be the problem as it was working properly.</p>
| 26,920 | 1,987,693 | 2020-10-05 07:47:49 | 38,495,327 | 42 | 2016-07-21 05:11:18 | 4,635,388 | 2018-08-05 17:46:14 | https://stackoverflow.com/q/38480098 | https://stackoverflow.com/a/38495327 | <p>I also got same issue.</p>
<p>I tried to update git by ppa, Reset .gitconfig,i checked github repo is getting clone but not bitbucket, i unset http and https proxy, restarted my network services(type in terminal - 'my network services'), changed the network that my laptop was connected. But none of this work for me... | <p>I also got same issue.</p> <p>I tried to update git by ppa, Reset .gitconfig,i checked github repo is getting clone but not bitbucket, i unset http and https proxy, restarted my network services(type in terminal - 'my network services'), changed the network that my laptop was connected. But none of this work for me... | 119, 8337 | bitbucket, git | <h1>Failed to connect to bitbucket.org port 443: No route to host</h1>
<p>I am getting error as <strong>Failed to connect to bitbucket.org port 443: No route to host</strong> when i try to pull or push.
The same repositories are available to pull push outside our network.
What could be the problem as it was working pro... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,941 | git | # Failed to connect to bitbucket.org port 443: No route to host
I am getting error as **Failed to connect to bitbucket.org port 443: No route to host** when i try to pull or push.
The same repositories are available to pull push outside our network.
What could be the problem as it was working properly. | I also got same issue.
I tried to update git by ppa, Reset .gitconfig,i checked github repo is getting clone but not bitbucket, i unset http and https proxy, restarted my network services(type in terminal - 'my network services'), changed the network that my laptop was connected. But none of this work for me.
I **fix... |
4307728 | Git still showing deleted files after a commit | 82 | 2010-11-29 20:22:03 | <p>How can I remove deleted files from my Git repo?</p>
<p>I've deleted a folder of a JavaScript library, which contained many files. I then went to commit the changes like so:</p>
<pre><code>git add .
git commit "message"
git status
</code></pre>
<p>But it shows all those files as "deleted ....".</p>
<p>How can I ... | 120,797 | 126,749 | 2019-04-24 21:51:04 | 4,307,790 | 41 | 2010-11-29 20:27:51 | 501,250 | 2012-11-27 19:07:46 | https://stackoverflow.com/q/4307728 | https://stackoverflow.com/a/4307790 | <p>If it lists the files under the "to be committed" section, then just proceed with the commit; the files will remain deleted. (Git tracks deletions too, not just changes.)</p>
<p>If it lists the files under the "changed but not updated" section, then you have two options:</p>
<ol>
<li>Undelete them by restoring th... | <p>If it lists the files under the "to be committed" section, then just proceed with the commit; the files will remain deleted. (Git tracks deletions too, not just changes.)</p> <p>If it lists the files under the "changed but not updated" section, then you have two options:</p> <ol> <li>Undelete them by restoring th... | 119, 53850 | git, git-commit | <h1>Git still showing deleted files after a commit</h1>
<p>How can I remove deleted files from my Git repo?</p>
<p>I've deleted a folder of a JavaScript library, which contained many files. I then went to commit the changes like so:</p>
<pre><code>git add .
git commit "message"
git status
</code></pre>
<p>But it sho... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,943 | git | # Git still showing deleted files after a commit
How can I remove deleted files from my Git repo?
I've deleted a folder of a JavaScript library, which contained many files. I then went to commit the changes like so:
```
git add .
git commit "message"
git status
```
But it shows all those files as "deleted ....".
H... | If it lists the files under the "to be committed" section, then just proceed with the commit; the files will remain deleted. (Git tracks deletions too, not just changes.)
If it lists the files under the "changed but not updated" section, then you have two options:
1. Undelete them by restoring the version in the inde... |
2994612 | Is there a way to tell git-status to ignore the effects of .gitignore files? | 68 | 2010-06-08 03:29:02 | <p>I have configured numerous <code>.gitignore</code> files to filter out many different unwanted files from a set of about 6,000 untracked files. I want to do <code>git add .</code> when I've got my filtered list looking the way I want it.</p>
<p>But, then I want to disable the <code>.gitignore</code> filters tempora... | 35,592 | 143,397 | 2021-08-16 07:03:46 | 2,994,621 | 41 | 2010-06-08 03:32:35 | 230,575 | 2010-06-08 04:16:38 | https://stackoverflow.com/q/2994612 | https://stackoverflow.com/a/2994621 | <p>Try using <code>git ls-files --other</code> - it should list all files that git doesn't know about; i.e. those files that aren't in the repository and aren't ignored by <code>.gitignore</code>.</p>
<p>You can also use <code>git ls-files --ignored --exclude-standard</code> to see what files git is explicitly ignorin... | <p>Try using <code>git ls-files --other</code> - it should list all files that git doesn't know about; i.e. those files that aren't in the repository and aren't ignored by <code>.gitignore</code>.</p> <p>You can also use <code>git ls-files --ignored --exclude-standard</code> to see what files git is explicitly ignorin... | 119, 25056, 54839 | git, gitignore, git-status | <h1>Is there a way to tell git-status to ignore the effects of .gitignore files?</h1>
<p>I have configured numerous <code>.gitignore</code> files to filter out many different unwanted files from a set of about 6,000 untracked files. I want to do <code>git add .</code> when I've got my filtered list looking the way I wa... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,946 | git | # Is there a way to tell git-status to ignore the effects of .gitignore files?
I have configured numerous `.gitignore` files to filter out many different unwanted files from a set of about 6,000 untracked files. I want to do `git add .` when I've got my filtered list looking the way I want it.
But, then I want to dis... | Try using `git ls-files --other` - it should list all files that git doesn't know about; i.e. those files that aren't in the repository and aren't ignored by `.gitignore`.
You can also use `git ls-files --ignored --exclude-standard` to see what files git is explicitly ignoring. |
22718000 | Git push --force from IntelliJ IDEA | 61 | 2014-03-28 16:14:54 | <p>It seems that the force option was removed from the pushing dialog. I am currently using IntelliJ IDEA 13.1.1 and I cannot find any way how to push with force option. I tried to search the documentation and it seems that in version 10 the force option was still there. Do you maybe know how to push with force from In... | 34,234 | 550,859 | 2023-03-30 23:32:39 | 22,729,163 | 41 | 2014-03-29 09:14:12 | 6,309 | 2018-11-12 08:12:17 | https://stackoverflow.com/q/22718000 | https://stackoverflow.com/a/22729163 | <p>As far as <a href="http://youtrack.jetbrains.com/issue/IDEA-85773" rel="noreferrer">issue 85773</a> is concerned, that option shouldn't be in the GUI yet (for IDEA 11-12 or 13+).<br />
And it would be disabled when on the master branch.</p>
<p>That is why <a href="http://youtrack.jetbrains.com/issue/IDEA-76252" rel=... | <p>As far as <a href="http://youtrack.jetbrains.com/issue/IDEA-85773" rel="noreferrer">issue 85773</a> is concerned, that option shouldn't be in the GUI yet (for IDEA 11-12 or 13+).<br /> And it would be disabled when on the master branch.</p> <p>That is why <a href="http://youtrack.jetbrains.com/issue/IDEA-76252" rel=... | 119, 8945 | git, intellij-idea | <h1>Git push --force from IntelliJ IDEA</h1>
<p>It seems that the force option was removed from the pushing dialog. I am currently using IntelliJ IDEA 13.1.1 and I cannot find any way how to push with force option. I tried to search the documentation and it seems that in version 10 the force option was still there. Do ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,948 | git | # Git push --force from IntelliJ IDEA
It seems that the force option was removed from the pushing dialog. I am currently using IntelliJ IDEA 13.1.1 and I cannot find any way how to push with force option. I tried to search the documentation and it seems that in version 10 the force option was still there. Do you maybe... | As far as [issue 85773](http://youtrack.jetbrains.com/issue/IDEA-85773) is concerned, that option shouldn't be in the GUI yet (for IDEA 11-12 or 13+).
And it would be disabled when on the master branch.
That is why [issue 76252](http://youtrack.jetbrains.com/issue/IDEA-76252) advocates to be able to type git command... |
3076043 | Creating a SSH key with ssh-keygen does not create the .ssh folder | 54 | 2010-06-19 15:35:13 | <p>I am trying to create my public/private rsa key pair with msysgit</p>
<p>I run this command:</p>
<pre><code>ssh-keygen -C "email@email.com" -t rsa
</code></pre>
<p>Everything looks fine, I have the message </p>
<pre><code>Enter file in which to save the key (/c/Users/user/.ssh/id_rsa)
</code></pre>
<p>Then I ha... | 124,888 | 67,342 | 2023-07-21 14:51:36 | 3,076,214 | 41 | 2010-06-19 16:16:52 | 6,309 | 2023-07-21 14:51:36 | https://stackoverflow.com/q/3076043 | https://stackoverflow.com/a/3076214 | <p>You can start with creating the expected folder, and check you can access it:</p>
<pre class="lang-bash prettyprint-override"><code>mkdir "%USERPROFILE%\.ssh"
dir "%USERPROFILE%\.ssh"
cd "%USERPROFILE%\.ssh"
</code></pre>
<p>Make sure you do not have a Windows environment variable named... | <p>You can start with creating the expected folder, and check you can access it:</p> <pre class="lang-bash prettyprint-override"><code>mkdir "%USERPROFILE%\.ssh" dir "%USERPROFILE%\.ssh" cd "%USERPROFILE%\.ssh" </code></pre> <p>Make sure you do not have a Windows environment variable named... | 119, 386, 456, 4086, 14019 | git, mingw, ssh, unfuddle, version-control | <h1>Creating a SSH key with ssh-keygen does not create the .ssh folder</h1>
<p>I am trying to create my public/private rsa key pair with msysgit</p>
<p>I run this command:</p>
<pre><code>ssh-keygen -C "email@email.com" -t rsa
</code></pre>
<p>Everything looks fine, I have the message </p>
<pre><code>Enter file in w... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,950 | git | # Creating a SSH key with ssh-keygen does not create the .ssh folder
I am trying to create my public/private rsa key pair with msysgit
I run this command:
```
ssh-keygen -C "email@email.com" -t rsa
```
Everything looks fine, I have the message
```
Enter file in which to save the key (/c/Users/user/.ssh/id_rsa)
```... | You can start with creating the expected folder, and check you can access it:
```
mkdir "%USERPROFILE%\.ssh"
dir "%USERPROFILE%\.ssh"
cd "%USERPROFILE%\.ssh"
```
Make sure you do not have a Windows environment variable named `HOME`, which would take precedence when using `ssh.exe` or `ssh-keygen.exe` commands from a ... |
5854967 | git, msysgit, accents, utf-8, the definitive answers | 49 | 2011-05-02 08:24:13 | <p>I've read in some places that there are problems with git (or just msysgit?) and character encoding - I <em>believe</em> it's only a problem in file names.</p>
<p>What I'd like is some 'definitive' (or at least authoritative) information about:</p>
<ol>
<li>What exactly are the 'problems'? (The symptoms)</li>
<li>... | 20,724 | 11,410 | 2024-09-22 19:48:27 | 5,855,213 | 41 | 2011-05-02 08:52:41 | 6,309 | 2024-09-22 19:48:27 | https://stackoverflow.com/q/5854967 | https://stackoverflow.com/a/5855213 | <p>Update Sep. 2024: With Git 2.47 (Q4 2024), <a href="https://github.com/git/git/commit/94b60adee30619a05296cf5ed6addb0e6d4e25dc" rel="nofollow noreferrer">batch 19</a>, the display width table for Unicode characters has been updated for Unicode 16.</p>
<p>See <a href="https://github.com/git/git/commit/44dc6511321c950... | <p>Update Sep. 2024: With Git 2.47 (Q4 2024), <a href="https://github.com/git/git/commit/94b60adee30619a05296cf5ed6addb0e6d4e25dc" rel="nofollow noreferrer">batch 19</a>, the display width table for Unicode characters has been updated for Unicode 16.</p> <p>See <a href="https://github.com/git/git/commit/44dc6511321c950... | 119, 8944, 21628 | git, msysgit, utf-8 | <h1>git, msysgit, accents, utf-8, the definitive answers</h1>
<p>I've read in some places that there are problems with git (or just msysgit?) and character encoding - I <em>believe</em> it's only a problem in file names.</p>
<p>What I'd like is some 'definitive' (or at least authoritative) information about:</p>
<ol>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,951 | git | # git, msysgit, accents, utf-8, the definitive answers
I've read in some places that there are problems with git (or just msysgit?) and character encoding - I *believe* it's only a problem in file names.
What I'd like is some 'definitive' (or at least authoritative) information about:
1. What exactly are the 'proble... | Update Sep. 2024: With Git 2.47 (Q4 2024), [batch 19](https://github.com/git/git/commit/94b60adee30619a05296cf5ed6addb0e6d4e25dc), the display width table for Unicode characters has been updated for Unicode 16.
See [commit 44dc651](https://github.com/git/git/commit/44dc6511321c95027267d05e761cd9a43ed0425f) (12 Sep 202... |
3258638 | Apply git .gitignore rules to an existing repository | 49 | 2010-07-15 18:24:18 | <p>I started using git with an xcode project and have recently discovered that I can use .gitignore and .gitattributes files to ignore the noise from the compiler and system. <strong>Now that I have the .gitignore and .gitattributes files in place, how can I "apply" the new ignore rules and get rid of the crud from ve... | 45,657 | 393,085 | 2016-07-13 13:26:51 | 3,258,979 | 41 | 2010-07-15 19:01:34 | 256,324 | 2013-07-29 20:19:32 | https://stackoverflow.com/q/3258638 | https://stackoverflow.com/a/3258979 | <p>use <code>git rm --cached</code> for files and <code>git rm -r --cached</code> for the <code>build/</code> directory</p>
| <p>use <code>git rm --cached</code> for files and <code>git rm -r --cached</code> for the <code>build/</code> directory</p> | 119 | git | <h1>Apply git .gitignore rules to an existing repository</h1>
<p>I started using git with an xcode project and have recently discovered that I can use .gitignore and .gitattributes files to ignore the noise from the compiler and system. <strong>Now that I have the .gitignore and .gitattributes files in place, how can ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,952 | git | # Apply git .gitignore rules to an existing repository
I started using git with an xcode project and have recently discovered that I can use .gitignore and .gitattributes files to ignore the noise from the compiler and system. **Now that I have the .gitignore and .gitattributes files in place, how can I "apply" the ne... | use `git rm --cached` for files and `git rm -r --cached` for the `build/` directory |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.