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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
44223427 | .gitignore still including asp.net core wwwroot/lib directory | 22 | 2017-05-28 03:04:35 | <p>Before I even create my ASP.NET Core project I first create my git repository and select the initial gitignore template to be VisualStudio. I then added the line: </p>
<p>wwwroot/lib/</p>
<p>After committing and publishing this change I then created my ASP.NET Core Web Application project using the standard Web A... | 9,935 | 1,088,099 | 2017-11-22 00:20:41 | 44,223,496 | 49 | 2017-05-28 03:21:47 | 1,088,099 | 2017-11-22 00:20:41 | https://stackoverflow.com/q/44223427 | https://stackoverflow.com/a/44223496 | <p>Upon some more research, <code>**/wwwroot/lib</code> works as a <code>.gitignore</code> entry.</p>
| <p>Upon some more research, <code>**/wwwroot/lib</code> works as a <code>.gitignore</code> entry.</p> | 96, 119, 25056, 117274 | asp.net, asp.net-core, git, gitignore | <h1>.gitignore still including asp.net core wwwroot/lib directory</h1>
<p>Before I even create my ASP.NET Core project I first create my git repository and select the initial gitignore template to be VisualStudio. I then added the line: </p>
<p>wwwroot/lib/</p>
<p>After committing and publishing this change I then c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,507 | git | # .gitignore still including asp.net core wwwroot/lib directory
Before I even create my ASP.NET Core project I first create my git repository and select the initial gitignore template to be VisualStudio. I then added the line:
wwwroot/lib/
After committing and publishing this change I then created my ASP.NET Core We... | Upon some more research, `**/wwwroot/lib` works as a `.gitignore` entry. |
3557731 | How to get git to work through a proxy and IntelliJ Idea? | 21 | 2010-08-24 14:47:58 | <p>Where do I configure the proxy settings for GIT in IntelliJ Idea? I've gotten the proxy settings working for the plugins, but I just can't find it for GIT; and the help files only mention subversion.</p>
<p>Any help is appreciated.</p>
| 32,739 | 351,478 | 2022-01-26 10:27:50 | 3,557,766 | 49 | 2010-08-24 14:52:28 | 422,597 | 2022-01-25 19:13:30 | https://stackoverflow.com/q/3557731 | https://stackoverflow.com/a/3557766 | <p>You have to configure proxy for git and not for intelliJ, intelliJ will just call the git command line.</p>
<p><code>git config --global http.proxy yourProxy:port</code> should do it.</p>
| <p>You have to configure proxy for git and not for intelliJ, intelliJ will just call the git command line.</p> <p><code>git config --global http.proxy yourProxy:port</code> should do it.</p> | 119, 760, 8945 | git, intellij-idea, proxy | <h1>How to get git to work through a proxy and IntelliJ Idea?</h1>
<p>Where do I configure the proxy settings for GIT in IntelliJ Idea? I've gotten the proxy settings working for the plugins, but I just can't find it for GIT; and the help files only mention subversion.</p>
<p>Any help is appreciated.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,509 | git | # How to get git to work through a proxy and IntelliJ Idea?
Where do I configure the proxy settings for GIT in IntelliJ Idea? I've gotten the proxy settings working for the plugins, but I just can't find it for GIT; and the help files only mention subversion.
Any help is appreciated. | You have to configure proxy for git and not for intelliJ, intelliJ will just call the git command line.
`git config --global http.proxy yourProxy:port` should do it. |
18256921 | How do I open the Git GUI from a command window? | 20 | 2013-08-15 16:13:48 | <p>How do I open the Git GUI from a command window? I'm using Windows 7. I've tried running this:</p>
<pre><code>"C:\Apps\Git\libexec\git-core\git-gui"
</code></pre>
<p>but that's not a windows script. When I right-click on a folder, I see an option that says, "Git GUI Here". When I click on that, the Git GUI ope... | 33,629 | 2,023,861 | 2019-11-17 08:54:31 | 18,257,109 | 49 | 2013-08-15 16:24:44 | 93,884 | 2013-08-15 16:24:44 | https://stackoverflow.com/q/18256921 | https://stackoverflow.com/a/18257109 | <p>Simply entering</p>
<pre><code>git gui
</code></pre>
<p>works for me.</p>
| <p>Simply entering</p> <pre><code>git gui </code></pre> <p>works for me.</p> | 119, 1231, 33729, 34595 | command-line, git, git-gui, windows-7 | <h1>How do I open the Git GUI from a command window?</h1>
<p>How do I open the Git GUI from a command window? I'm using Windows 7. I've tried running this:</p>
<pre><code>"C:\Apps\Git\libexec\git-core\git-gui"
</code></pre>
<p>but that's not a windows script. When I right-click on a folder, I see an option that sa... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,510 | git | # How do I open the Git GUI from a command window?
How do I open the Git GUI from a command window? I'm using Windows 7. I've tried running this:
```
"C:\Apps\Git\libexec\git-core\git-gui"
```
but that's not a windows script. When I right-click on a folder, I see an option that says, "Git GUI Here". When I click on ... | Simply entering
```
git gui
```
works for me. |
15131864 | Git: Efficient steps to create a new branch and push to remote | 8 | 2013-02-28 09:26:56 | <p>I figured out the steps but seems cumbersome, take <code>bitbucket</code> for example, suppose i already have a project called <code>prj</code></p>
<ol>
<li>I branch a new project from server side(bitbucket.com), called <code>prj-bz</code></li>
<li>From local i add add a remote <code>git remote add prj-bz https://b... | 57,459 | 492,760 | 2022-09-03 20:25:18 | 15,230,327 | 49 | 2013-03-05 17:30:22 | 316,950 | 2013-03-05 17:30:22 | https://stackoverflow.com/q/15131864 | https://stackoverflow.com/a/15230327 | <p>Generally, people usually do one or the other <strong>Fork</strong> or <strong>Branch</strong>. It sounds like you are making a Fork of a repo, then making a branch in the fork with the same name. If you're using a Pull Request to put data back in to the main repo, you don't need to do both. Pick one of the two work... | <p>Generally, people usually do one or the other <strong>Fork</strong> or <strong>Branch</strong>. It sounds like you are making a Fork of a repo, then making a branch in the fork with the same name. If you're using a Pull Request to put data back in to the main repo, you don't need to do both. Pick one of the two work... | 119, 8337 | bitbucket, git | <h1>Git: Efficient steps to create a new branch and push to remote</h1>
<p>I figured out the steps but seems cumbersome, take <code>bitbucket</code> for example, suppose i already have a project called <code>prj</code></p>
<ol>
<li>I branch a new project from server side(bitbucket.com), called <code>prj-bz</code></li>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,511 | git | # Git: Efficient steps to create a new branch and push to remote
I figured out the steps but seems cumbersome, take `bitbucket` for example, suppose i already have a project called `prj`
1. I branch a new project from server side(bitbucket.com), called `prj-bz`
2. From local i add add a remote `git remote add prj-bz ... | Generally, people usually do one or the other **Fork** or **Branch**. It sounds like you are making a Fork of a repo, then making a branch in the fork with the same name. If you're using a Pull Request to put data back in to the main repo, you don't need to do both. Pick one of the two workflows:
- Fork the repo on Bi... |
6142437 | Make .git directory web inaccessible | 171 | 2011-05-26 17:13:51 | <p>I have a website that I use github (closed source) to track changes and update site. The only problem is, it appears the .git directory is accessible via the web. How can I stop this and still be able to use git?</p>
<p>Should I use .htaccess?
Should I change permissions of .git?</p>
| 80,193 | 627,473 | 2020-09-18 20:06:22 | 6,142,617 | 48 | 2011-05-26 17:27:17 | 298,479 | 2019-09-11 12:23:59 | https://stackoverflow.com/q/6142437 | https://stackoverflow.com/a/6142617 | <p>Create a <code>.htaccess</code> file in the <code>.git</code> folder and put the following in this file:</p>
<pre><code>Order allow,deny
Deny from all
</code></pre>
<p>But note, that it would be lost if you ever re-cloned the repository</p>
| <p>Create a <code>.htaccess</code> file in the <code>.git</code> folder and put the following in this file:</p> <pre><code>Order allow,deny Deny from all </code></pre> <p>But note, that it would be lost if you ever re-cloned the repository</p> | 119, 607, 5876 | .htaccess, apache2, git | <h1>Make .git directory web inaccessible</h1>
<p>I have a website that I use github (closed source) to track changes and update site. The only problem is, it appears the .git directory is accessible via the web. How can I stop this and still be able to use git?</p>
<p>Should I use .htaccess?
Should I change permission... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,512 | git | # Make .git directory web inaccessible
I have a website that I use github (closed source) to track changes and update site. The only problem is, it appears the .git directory is accessible via the web. How can I stop this and still be able to use git?
Should I use .htaccess?
Should I change permissions of .git? | Create a `.htaccess` file in the `.git` folder and put the following in this file:
```
Order allow,deny
Deny from all
```
But note, that it would be lost if you ever re-cloned the repository |
3207728 | Retaining file permissions with Git | 123 | 2010-07-08 20:30:41 | <p>I want to version control my web server as described in <a href="https://stackoverflow.com/questions/3154227/version-control-for-my-web-server">Version control for my web server</a>, by creating a git repo out of my <code>/var/www directory</code>. My hope was that I would then be able to push web content from our... | 143,844 | 165,673 | 2022-03-29 05:29:15 | 3,208,143 | 48 | 2010-07-08 21:28:31 | 6,309 | 2016-11-20 08:51:16 | https://stackoverflow.com/q/3207728 | https://stackoverflow.com/a/3208143 | <p>The <a href="http://web.archive.org/web/20150330001326/http://permalink.gmane.org/gmane.comp.version-control.git/105133" rel="noreferrer"><code>git-cache-meta</code></a> mentioned in SO question "<a href="https://stackoverflow.com/questions/2517339/git-how-to-recover-the-file-permissions-git-thinks-the-file-should-b... | <p>The <a href="http://web.archive.org/web/20150330001326/http://permalink.gmane.org/gmane.comp.version-control.git/105133" rel="noreferrer"><code>git-cache-meta</code></a> mentioned in SO question "<a href="https://stackoverflow.com/questions/2517339/git-how-to-recover-the-file-permissions-git-thinks-the-file-should-b... | 58, 119, 2120 | file-permissions, git, linux | <h1>Retaining file permissions with Git</h1>
<p>I want to version control my web server as described in <a href="https://stackoverflow.com/questions/3154227/version-control-for-my-web-server">Version control for my web server</a>, by creating a git repo out of my <code>/var/www directory</code>. My hope was that I wo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,514 | git | # Retaining file permissions with Git
I want to version control my web server as described in [Version control for my web server](https://stackoverflow.com/questions/3154227/version-control-for-my-web-server), by creating a git repo out of my `/var/www directory`. My hope was that I would then be able to push web cont... | The [`git-cache-meta`](http://web.archive.org/web/20150330001326/http://permalink.gmane.org/gmane.comp.version-control.git/105133) mentioned in SO question "[git - how to recover the file permissions git thinks the file should be?](https://stackoverflow.com/questions/2517339/git-how-to-recover-the-file-permissions-git-... |
21264738 | error: src refspec master does not match any | 87 | 2014-01-21 17:13:05 | <p>I have tried to follow the solutions suggested in <a href="https://stackoverflow.com/questions/4181861/src-refspec-master-does-not-match-any-when-pushing-commits-in-git">this</a> post but it didnt work and I am still getting: src refspec master does not match any. </p>
<p>Here is what I did:
Followed <a href="http... | 478,098 | 162,345 | 2024-10-30 18:04:11 | 21,267,338 | 48 | 2014-01-21 19:29:35 | 1,592,915 | 2014-01-21 19:29:35 | https://stackoverflow.com/q/21264738 | https://stackoverflow.com/a/21267338 | <p>From <code>git branch</code> it appears that somehow your local branch name is "origin".</p>
<p>You can rename the branch with <code>-mv</code> flag, like this: </p>
<p><code>git branch -mv origin master</code></p>
<p>After this <code>git branch</code> should show <code>master</code> :-)</p>
<p>Just to make sure... | <p>From <code>git branch</code> it appears that somehow your local branch name is "origin".</p> <p>You can rename the branch with <code>-mv</code> flag, like this: </p> <p><code>git branch -mv origin master</code></p> <p>After this <code>git branch</code> should show <code>master</code> :-)</p> <p>Just to make sure... | 119, 28898, 41346 | git, git-push, git-remote | <h1>error: src refspec master does not match any</h1>
<p>I have tried to follow the solutions suggested in <a href="https://stackoverflow.com/questions/4181861/src-refspec-master-does-not-match-any-when-pushing-commits-in-git">this</a> post but it didnt work and I am still getting: src refspec master does not match any... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,515 | git | # error: src refspec master does not match any
I have tried to follow the solutions suggested in [this](https://stackoverflow.com/questions/4181861/src-refspec-master-does-not-match-any-when-pushing-commits-in-git) post but it didnt work and I am still getting: src refspec master does not match any.
Here is what I di... | From `git branch` it appears that somehow your local branch name is "origin".
You can rename the branch with `-mv` flag, like this:
`git branch -mv origin master`
After this `git branch` should show `master` :-)
Just to make sure the name is indeed the only thing that went astray, you can run `git log` and look at ... |
4039416 | Installing Git with non-root user account | 68 | 2010-10-28 02:57:21 | <p>I've already set up a Git repository on GitHub and committed a few changes from my Windows machine.</p>
<p>But tomorrow I'll have to work in this repository from a machine running Ubuntu with limited privilege (i.e. no sudo).</p>
<p>Is there a portable version of Git for Linux? Or some source that allows me to com... | 75,454 | 252,218 | 2023-04-22 23:41:49 | 4,039,427 | 48 | 2010-10-28 03:01:04 | 350,837 | 2023-04-22 23:41:49 | https://stackoverflow.com/q/4039416 | https://stackoverflow.com/a/4039427 | <p>You can download the git source and do <code>make configure && ./configure --prefix=/home/user/myroot && make && make install</code> to install git to your home directory provided you have the build tools. If you don't have the build-essential package installed (<code>dpkg --list|grep build-... | <p>You can download the git source and do <code>make configure && ./configure --prefix=/home/user/myroot && make && make install</code> to install git to your home directory provided you have the build tools. If you don't have the build-essential package installed (<code>dpkg --list|grep build-... | 58, 119, 549 | git, linux, ubuntu | <h1>Installing Git with non-root user account</h1>
<p>I've already set up a Git repository on GitHub and committed a few changes from my Windows machine.</p>
<p>But tomorrow I'll have to work in this repository from a machine running Ubuntu with limited privilege (i.e. no sudo).</p>
<p>Is there a portable version of ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,517 | git | # Installing Git with non-root user account
I've already set up a Git repository on GitHub and committed a few changes from my Windows machine.
But tomorrow I'll have to work in this repository from a machine running Ubuntu with limited privilege (i.e. no sudo).
Is there a portable version of Git for Linux? Or some ... | You can download the git source and do `make configure && ./configure --prefix=/home/user/myroot && make && make install` to install git to your home directory provided you have the build tools. If you don't have the build-essential package installed (`dpkg --list|grep build-essential`), you will need to install those ... |
8227233 | There is nothing changed, but eclipse egit marks the file as changed | 66 | 2011-11-22 13:00:02 | <p>I'm using eclipse egit with github. I found something strange that I didn't change anything, but egit marked the file as "changed". See the images:</p>
<ol>
<li><p>the file "run.bat" is marked as "changed"</p>
<p><img src="https://i.sstatic.net/I5RtP.jpg" alt="enter image description he... | 44,213 | 342,235 | 2019-12-30 13:33:46 | 8,236,197 | 48 | 2011-11-23 01:18:49 | 1,864,976 | 2011-12-21 16:29:06 | https://stackoverflow.com/q/8227233 | https://stackoverflow.com/a/8236197 | <p>One of the first things I've had issues with in Git.</p>
<p>I've said this forever:</p>
<pre><code>git config --system core.autocrlf false
</code></pre>
<p>To get rid of CR highlighting in diff and patch views, use:</p>
<pre><code>git config --system core.whitespace cr-at-eol
</code></pre>
<p>If you share your ... | <p>One of the first things I've had issues with in Git.</p> <p>I've said this forever:</p> <pre><code>git config --system core.autocrlf false </code></pre> <p>To get rid of CR highlighting in diff and patch views, use:</p> <pre><code>git config --system core.whitespace cr-at-eol </code></pre> <p>If you share your ... | 119, 43702 | egit, git | <h1>There is nothing changed, but eclipse egit marks the file as changed</h1>
<p>I'm using eclipse egit with github. I found something strange that I didn't change anything, but egit marked the file as "changed". See the images:</p>
<ol>
<li><p>the file "run.bat" is marked as "changed"</p>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,518 | git | # There is nothing changed, but eclipse egit marks the file as changed
I'm using eclipse egit with github. I found something strange that I didn't change anything, but egit marked the file as "changed". See the images:
1. the file "run.bat" is marked as "changed"
</code> man page:</p>
<pre><code> <rev1>...<rev2>
Include commits that are reachable from either <rev1> or <rev2> but
exclude those that are reachable from both. When either <rev1> or
... | <p>This is a degenerate form of this syntax, described in the <code>gitrevisions(7)</code> man page:</p> <pre><code> <rev1>...<rev2> Include commits that are reachable from either <rev1> or <rev2> but exclude those that are reachable from both. When either <rev1> or ... | 119 | git | <h1>What does `git checkout ...` do?</h1>
<p>I occasionally accidentally write <code>git checkout ...</code>, which puts me into a detached head state. I was wondering why. Here's the "dot story":</p>
<pre><code>> git checkout .
# checks out current directory
> git checkout ..
# Checks out parent directory, if i... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,523 | git | # What does `git checkout ...` do?
I occasionally accidentally write `git checkout ...`, which puts me into a detached head state. I was wondering why. Here's the "dot story":
```
> git checkout .
# checks out current directory
> git checkout ..
# Checks out parent directory, if in repository.
> git checkout ...
# Pu... | This is a degenerate form of this syntax, described in the `gitrevisions(7)` man page:
```
<rev1>...<rev2>
Include commits that are reachable from either <rev1> or <rev2> but
exclude those that are reachable from both. When either <rev1> or
<rev2> is omitted, it defaults to HEAD.
```
Note that... |
73876703 | What are the 'pull.rebase false' and 'pull.ff true' differences? | 49 | 2022-09-28 05:49:42 | <p>Is there a difference in using the following?</p>
<pre class="lang-none prettyprint-override"><code>git config pull.rebase false # Merge (the default strategy)
</code></pre>
<p>and</p>
<pre class="lang-none prettyprint-override"><code>git config pull.ff true
</code></pre>
<p>Both commands fast-forwards if possib... | 168,883 | 19,793,331 | 2025-05-04 18:37:40 | 73,877,028 | 48 | 2022-09-28 06:24:57 | 86,072 | 2025-05-04 18:37:40 | https://stackoverflow.com/q/73876703 | https://stackoverflow.com/a/73877028 | <p>While both these settings act on how <code>git pull</code> should behave when Git, during a <code>git pull</code>, has to reconcile changes in your local branch with upstream changes, they don't turn the same knob.</p>
<ul>
<li><code>pull.ff</code> can be set to <code>false | true | only</code>.
It matches the CLI o... | <p>While both these settings act on how <code>git pull</code> should behave when Git, during a <code>git pull</code>, has to reconcile changes in your local branch with upstream changes, they don't turn the same knob.</p> <ul> <li><code>pull.ff</code> can be set to <code>false | true | only</code>. It matches the CLI o... | 119 | git | <h1>What are the 'pull.rebase false' and 'pull.ff true' differences?</h1>
<p>Is there a difference in using the following?</p>
<pre class="lang-none prettyprint-override"><code>git config pull.rebase false # Merge (the default strategy)
</code></pre>
<p>and</p>
<pre class="lang-none prettyprint-override"><code>git ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,524 | git | # What are the 'pull.rebase false' and 'pull.ff true' differences?
Is there a difference in using the following?
```
git config pull.rebase false # Merge (the default strategy)
```
and
```
git config pull.ff true
```
Both commands fast-forwards if possible, and if it's not merge.
Which configuration should I ... | While both these settings act on how `git pull` should behave when Git, during a `git pull`, has to reconcile changes in your local branch with upstream changes, they don't turn the same knob.
- `pull.ff` can be set to `false | true | only`.
It matches the CLI options: `--no-ff | --ff | --ff-only`, and if any of the... |
73086622 | Is a .gitattributes file really necessary for git? | 45 | 2022-07-22 22:27:31 | <p>I've recently been reading up a bit on .gitattributes and also found places like this one, <a href="https://github.com/alexkaratarakis/gitattributes" rel="noreferrer">https://github.com/alexkaratarakis/gitattributes</a>, where they try to maintain gitattributes for all file types. However in my mind, looking throug... | 43,070 | null | 2026-01-16 19:25:23 | 73,095,814 | 48 | 2022-07-24 04:38:58 | 6,309 | 2024-07-07 15:42:47 | https://stackoverflow.com/q/73086622 | https://stackoverflow.com/a/73095814 | <blockquote>
<p>is it really necessary to have this file?</p>
</blockquote>
<p>Yes, for any setting (eol, diff, merge filters, content filters, ...) related to Git you want any collaborator to the repository to follow.</p>
<p>This differs from <code>git config</code> which, for security reason, remains local (both beca... | <blockquote> <p>is it really necessary to have this file?</p> </blockquote> <p>Yes, for any setting (eol, diff, merge filters, content filters, ...) related to Git you want any collaborator to the repository to follow.</p> <p>This differs from <code>git config</code> which, for security reason, remains local (both beca... | 119 | git | <h1>Is a .gitattributes file really necessary for git?</h1>
<p>I've recently been reading up a bit on .gitattributes and also found places like this one, <a href="https://github.com/alexkaratarakis/gitattributes" rel="noreferrer">https://github.com/alexkaratarakis/gitattributes</a>, where they try to maintain gitattrib... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,525 | git | # Is a .gitattributes file really necessary for git?
I've recently been reading up a bit on .gitattributes and also found places like this one, <https://github.com/alexkaratarakis/gitattributes>, where they try to maintain gitattributes for all file types. However in my mind, looking through those files, I instinctive... | > is it really necessary to have this file?
Yes, for any setting (eol, diff, merge filters, content filters, ...) related to Git you want any collaborator to the repository to follow.
This differs from `git config` which, for security reason, remains local (both because it can include sensitive information, or danger... |
26239379 | What is a "merge bubble"? | 45 | 2014-10-07 15:15:02 | <p>I've heard of "merge bubbles" with regards to Git. I'm fairly well-versed in Git, but would not consider myself an expert. I've heard some negative things about merge bubbles; what is a "merge bubble" in Git, what's wrong with it, and how can I avoid it?</p>
| 7,906 | 5,620 | 2015-01-20 21:29:29 | 26,239,382 | 48 | 2014-10-07 15:15:14 | 5,620 | 2015-01-20 21:29:29 | https://stackoverflow.com/q/26239379 | https://stackoverflow.com/a/26239382 | <p>A <em>merge bubble</em> is a "trivial merge" in Git that did not require any conflicts to be resolved. The bubble occurs in the log where the merge is displayed when you use the <code>--graph</code> option. for example, if you ran <code>git log --graph</code> you might see something like this:</p>
<pre><code>| |
... | <p>A <em>merge bubble</em> is a "trivial merge" in Git that did not require any conflicts to be resolved. The bubble occurs in the log where the merge is displayed when you use the <code>--graph</code> option. for example, if you ran <code>git log --graph</code> you might see something like this:</p> <pre><code>| | ... | 119 | git | <h1>What is a "merge bubble"?</h1>
<p>I've heard of "merge bubbles" with regards to Git. I'm fairly well-versed in Git, but would not consider myself an expert. I've heard some negative things about merge bubbles; what is a "merge bubble" in Git, what's wrong with it, and how can I avoid it?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,527 | git | # What is a "merge bubble"?
I've heard of "merge bubbles" with regards to Git. I'm fairly well-versed in Git, but would not consider myself an expert. I've heard some negative things about merge bubbles; what is a "merge bubble" in Git, what's wrong with it, and how can I avoid it? | A *merge bubble* is a "trivial merge" in Git that did not require any conflicts to be resolved. The bubble occurs in the log where the merge is displayed when you use the `--graph` option. for example, if you ran `git log --graph` you might see something like this:
```
| |
* | commit d79f3c4e129356b055c659ee5be28081... |
28017249 | What does diff.mnemonicprefix do? | 42 | 2015-01-19 02:46:09 | <p>I've noticed that SourceTree performs git commands with this configuration option:</p>
<pre><code>git -c diff.mnemonicprefix=false
</code></pre>
<p>This is what the <a href="https://git-scm.com/docs/diff-config#Documentation/diff-config.txt-diffmnemonicPrefix" rel="nofollow noreferrer">git docs</a> say about this o... | 12,085 | 404,623 | 2024-03-14 11:16:10 | 28,017,534 | 48 | 2015-01-19 03:24:02 | 354,577 | 2015-01-19 03:24:02 | https://stackoverflow.com/q/28017249 | https://stackoverflow.com/a/28017534 | <p><code>git diff</code> shows some metadata about the files it is comparing. Ordinarily you might see something like this:</p>
<pre><code>diff --git a/foo/bar.txt b/foo/bar.txt <--
index abcd123..1234abc 100644
--- a/foo/bar.txt <--
+++ b/foo/bar.txt ... | <p><code>git diff</code> shows some metadata about the files it is comparing. Ordinarily you might see something like this:</p> <pre><code>diff --git a/foo/bar.txt b/foo/bar.txt <-- index abcd123..1234abc 100644 --- a/foo/bar.txt <-- +++ b/foo/bar.txt ... | 119 | git | <h1>What does diff.mnemonicprefix do?</h1>
<p>I've noticed that SourceTree performs git commands with this configuration option:</p>
<pre><code>git -c diff.mnemonicprefix=false
</code></pre>
<p>This is what the <a href="https://git-scm.com/docs/diff-config#Documentation/diff-config.txt-diffmnemonicPrefix" rel="nofollo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,528 | git | # What does diff.mnemonicprefix do?
I've noticed that SourceTree performs git commands with this configuration option:
```
git -c diff.mnemonicprefix=false
```
This is what the [git docs](https://git-scm.com/docs/diff-config#Documentation/diff-config.txt-diffmnemonicPrefix) say about this option:
> ## diff.mnemonic... | `git diff` shows some metadata about the files it is comparing. Ordinarily you might see something like this:
```
diff --git a/foo/bar.txt b/foo/bar.txt <--
index abcd123..1234abc 100644
--- a/foo/bar.txt <--
+++ b/foo/bar.txt <--
```
Note how the files a... |
16861982 | How to cherry-pick from stash in git? | 42 | 2013-05-31 16:36:21 | <p>I am wondering if cherry-picking from stash is possible.</p>
<pre><code>git stash save "test cherry-pick from stash"
git cherry-pick stash@{0} # --> Is this possible?
</code></pre>
<p>I am getting the following error when I tried above command:</p>
<pre><code>~/Documents$ git cherry-pick stash@{0}
erro... | 26,710 | 1,454,937 | 2023-11-16 17:54:47 | 16,862,384 | 48 | 2013-05-31 17:05:11 | 46,194 | 2013-06-01 07:04:43 | https://stackoverflow.com/q/16861982 | https://stackoverflow.com/a/16862384 | <p>The problem is that a stash consists of two or three commits. When stashing, the modified working tree is stored in one commit, the index in one commit, and (if using the <code>--include-untracked</code> flag) any untracked files in a third commit.</p>
<p>You can see this if you use <code>gitk --all</code> and do a... | <p>The problem is that a stash consists of two or three commits. When stashing, the modified working tree is stored in one commit, the index in one commit, and (if using the <code>--include-untracked</code> flag) any untracked files in a third commit.</p> <p>You can see this if you use <code>gitk --all</code> and do a... | 119, 36489 | cherry-pick, git | <h1>How to cherry-pick from stash in git?</h1>
<p>I am wondering if cherry-picking from stash is possible.</p>
<pre><code>git stash save "test cherry-pick from stash"
git cherry-pick stash@{0} # --> Is this possible?
</code></pre>
<p>I am getting the following error when I tried above command:</p>
<pre><c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,529 | git | # How to cherry-pick from stash in git?
I am wondering if cherry-picking from stash is possible.
```
git stash save "test cherry-pick from stash"
git cherry-pick stash@{0} # --> Is this possible?
```
I am getting the following error when I tried above command:
```
~/Documents$ git cherry-pick stash@{0}
error: Comm... | The problem is that a stash consists of two or three commits. When stashing, the modified working tree is stored in one commit, the index in one commit, and (if using the `--include-untracked` flag) any untracked files in a third commit.
You can see this if you use `gitk --all` and do a stash.
![enter image descripti... |
26941144 | How do you customize the color of the diff header in git diff? | 41 | 2014-11-15 00:36:25 | <p>When I run <code>git diff</code>, the header part of each diff comes out in white text. Since I'm using a light background it is hard to read, so I want to change it.</p>
<p>I have found that I can change other colors in the diff output like this (in <code>.gitconfig</code>):</p>
<pre><code>[color "diff"]
old ... | 18,464 | 708,333 | 2021-07-09 02:06:05 | 26,941,235 | 48 | 2014-11-15 00:47:50 | 354,577 | 2014-11-15 00:56:09 | https://stackoverflow.com/q/26941144 | https://stackoverflow.com/a/26941235 | <p>Try setting <code>color.diff.meta</code>, e.g.</p>
<pre><code>git config --global color.diff.meta blue
</code></pre>
<p>or by manually editing the configuration file</p>
<pre><code>[color "diff"]
meta = blue
</code></pre>
<p>You can look through the various <code>color.</code> settings <a href="http://git-sc... | <p>Try setting <code>color.diff.meta</code>, e.g.</p> <pre><code>git config --global color.diff.meta blue </code></pre> <p>or by manually editing the configuration file</p> <pre><code>[color "diff"] meta = blue </code></pre> <p>You can look through the various <code>color.</code> settings <a href="http://git-sc... | 119 | git | <h1>How do you customize the color of the diff header in git diff?</h1>
<p>When I run <code>git diff</code>, the header part of each diff comes out in white text. Since I'm using a light background it is hard to read, so I want to change it.</p>
<p>I have found that I can change other colors in the diff output like th... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,530 | git | # How do you customize the color of the diff header in git diff?
When I run `git diff`, the header part of each diff comes out in white text. Since I'm using a light background it is hard to read, so I want to change it.
I have found that I can change other colors in the diff output like this (in `.gitconfig`):
```
... | Try setting `color.diff.meta`, e.g.
```
git config --global color.diff.meta blue
```
or by manually editing the configuration file
```
[color "diff"]
meta = blue
```
You can look through the various `color.` settings [in the `git-config` reference](http://git-scm.com/docs/git-config) for more possible settings.... |
1054044 | Unable to remove files recursively from Git | 40 | 2009-06-28 02:03:00 | <p>I want to remove all files from Git at ~/bin/.</p>
<p>I run</p>
<pre><code>git rm -r --cached ~/.vim/* # Thanks to Pate in finding --cached!
</code></pre>
<p>I get</p>
<pre><code>fatal: pathspec '.vim/colors' did not match any files
</code></pre>
<p>This error messsage suggests me to use th... | 53,563 | 54,964 | 2012-08-18 17:05:34 | 1,054,933 | 48 | 2009-06-28 13:25:25 | 6,309 | 2009-06-28 13:25:25 | https://stackoverflow.com/q/1054044 | https://stackoverflow.com/a/1054933 | <pre><code> git rm -r --cached ~/.vim/*
fatal: pathspec '.vim/colors' did not match any files
</code></pre>
<p>1/ You do not need the '<code>*</code>': </p>
<pre><code> git rm -r --cached ~/.vim
</code></pre>
<p>will take care of any tracked sub-files.</p>
<p>2/ <code>fatal: pathspec '.vim/colors' did not match... | <pre><code> git rm -r --cached ~/.vim/* fatal: pathspec '.vim/colors' did not match any files </code></pre> <p>1/ You do not need the '<code>*</code>': </p> <pre><code> git rm -r --cached ~/.vim </code></pre> <p>will take care of any tracked sub-files.</p> <p>2/ <code>fatal: pathspec '.vim/colors' did not match... | 119, 5610 | git, rm | <h1>Unable to remove files recursively from Git</h1>
<p>I want to remove all files from Git at ~/bin/.</p>
<p>I run</p>
<pre><code>git rm -r --cached ~/.vim/* # Thanks to Pate in finding --cached!
</code></pre>
<p>I get</p>
<pre><code>fatal: pathspec '.vim/colors' did not match any files
</code... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,531 | git | # Unable to remove files recursively from Git
I want to remove all files from Git at ~/bin/.
I run
```
git rm -r --cached ~/.vim/* # Thanks to Pate in finding --cached!
```
I get
```
fatal: pathspec '.vim/colors' did not match any files
```
This error messsage suggests me to use the following... | ```
git rm -r --cached ~/.vim/*
fatal: pathspec '.vim/colors' did not match any files
```
1/ You do not need the '`*`':
```
git rm -r --cached ~/.vim
```
will take care of any tracked sub-files.
2/ `fatal: pathspec '.vim/colors' did not match any files` simply means one of your commands you tried before the o... |
47617552 | How can I specify a custom Git branch in my Pipfile? | 36 | 2017-12-03 10:39:15 | <p>It is possible to specify in <code>Pipfile</code> packages from custom Git repository.
But I cannot find comprehensive documentation on how to specify the concrete branch or a commit to be used for installation.</p>
<p>Is there a complete reference on how to use Git URLs for python packages in the <code>Pipfile</cod... | 17,163 | 7,598,113 | 2023-01-23 18:43:03 | 53,783,019 | 48 | 2018-12-14 15:54:42 | 1,399,491 | 2023-01-23 14:28:19 | https://stackoverflow.com/q/47617552 | https://stackoverflow.com/a/53783019 | <p>Here is <a href="https://github.com/pypa/pipenv/blob/master/docs/basics.rst#-a-note-about-vcs-dependencies" rel="noreferrer">some documentation</a> on the GitHub repo for pipenv:</p>
<blockquote>
<p>You can install packages with pipenv from git and other version
control systems using URLs formatted according to the ... | <p>Here is <a href="https://github.com/pypa/pipenv/blob/master/docs/basics.rst#-a-note-about-vcs-dependencies" rel="noreferrer">some documentation</a> on the GitHub repo for pipenv:</p> <blockquote> <p>You can install packages with pipenv from git and other version control systems using URLs formatted according to the ... | 16, 119, 14529, 128625 | git, pipenv, python, virtualenv | <h1>How can I specify a custom Git branch in my Pipfile?</h1>
<p>It is possible to specify in <code>Pipfile</code> packages from custom Git repository.
But I cannot find comprehensive documentation on how to specify the concrete branch or a commit to be used for installation.</p>
<p>Is there a complete reference on how... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,534 | git | # How can I specify a custom Git branch in my Pipfile?
It is possible to specify in `Pipfile` packages from custom Git repository.
But I cannot find comprehensive documentation on how to specify the concrete branch or a commit to be used for installation.
Is there a complete reference on how to use Git URLs for pytho... | Here is [some documentation](https://github.com/pypa/pipenv/blob/master/docs/basics.rst#-a-note-about-vcs-dependencies) on the GitHub repo for pipenv:
> You can install packages with pipenv from git and other version
> control systems using URLs formatted according to the following rule:
>
> ```
> <vcs_type>+<scheme>:... |
23003118 | Any difference between git add . and git add --all? | 36 | 2014-04-11 03:47:43 | <p>Is there any difference between:</p>
<pre><code>git add .
</code></pre>
<p>and</p>
<pre><code>git add --all
</code></pre>
<p>?</p>
| 18,328 | 1,133,318 | 2020-05-25 18:32:22 | 23,003,165 | 48 | 2014-04-11 03:52:56 | 762,073 | 2014-04-11 04:00:28 | https://stackoverflow.com/q/23003118 | https://stackoverflow.com/a/23003165 | <p><code>git add --all</code> will add the deleted file too (<em>removing files from index that are no longer in the working tree</em>), while <code>git add .</code> does not.</p>
<p>For new files and files already tracked in current working tree:</p>
<pre><code>git add .
</code></pre>
<p>For only files already trac... | <p><code>git add --all</code> will add the deleted file too (<em>removing files from index that are no longer in the working tree</em>), while <code>git add .</code> does not.</p> <p>For new files and files already tracked in current working tree:</p> <pre><code>git add . </code></pre> <p>For only files already trac... | 119, 34792 | git, git-add | <h1>Any difference between git add . and git add --all?</h1>
<p>Is there any difference between:</p>
<pre><code>git add .
</code></pre>
<p>and</p>
<pre><code>git add --all
</code></pre>
<p>?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,535 | git | # Any difference between git add . and git add --all?
Is there any difference between:
```
git add .
```
and
```
git add --all
```
? | `git add --all` will add the deleted file too (*removing files from index that are no longer in the working tree*), while `git add .` does not.
For new files and files already tracked in current working tree:
```
git add .
```
For only files already tracked in current working tree:
```
git add -u
```
For new files... |
32847697 | Windows-specific Git configuration settings; where are they set? | 35 | 2015-09-29 15:14:04 | <p>I've read the Git documentation and <a href="https://stackoverflow.com/questions/17756753/where-do-the-settings-in-my-git-configuration-come-from">Where do the settings in my Git configuration come from?</a> and yet I still can't make sense of some of my settings. </p>
<p>I'm on Git 2.5.3 on Windows 10. Here's th... | 22,147 | 3,279 | 2019-01-30 16:22:27 | 32,849,199 | 48 | 2015-09-29 16:28:21 | 5,032,339 | 2018-08-18 09:55:55 | https://stackoverflow.com/q/32847697 | https://stackoverflow.com/a/32849199 | <p>As <a href="https://github.com/git-for-windows/git/commit/153328ba92ca6cf921d2272fa7e355603cbf71b7" rel="noreferrer">this commit</a> explains, they've added another config location only for Windows, which is applied even before the <code>--system</code>:</p>
<blockquote>
<p>The file <code>/etc/gitconfig</code> ca... | <p>As <a href="https://github.com/git-for-windows/git/commit/153328ba92ca6cf921d2272fa7e355603cbf71b7" rel="noreferrer">this commit</a> explains, they've added another config location only for Windows, which is applied even before the <code>--system</code>:</p> <blockquote> <p>The file <code>/etc/gitconfig</code> ca... | 64, 119, 32868 | git, git-config, windows | <h1>Windows-specific Git configuration settings; where are they set?</h1>
<p>I've read the Git documentation and <a href="https://stackoverflow.com/questions/17756753/where-do-the-settings-in-my-git-configuration-come-from">Where do the settings in my Git configuration come from?</a> and yet I still can't make sense of... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,536 | git | # Windows-specific Git configuration settings; where are they set?
I've read the Git documentation and [Where do the settings in my Git configuration come from?](https://stackoverflow.com/questions/17756753/where-do-the-settings-in-my-git-configuration-come-from) and yet I still can't make sense of some of my settings... | As [this commit](https://github.com/git-for-windows/git/commit/153328ba92ca6cf921d2272fa7e355603cbf71b7) explains, they've added another config location only for Windows, which is applied even before the `--system`:
> The file `/etc/gitconfig` can be used to store a system-wide default
> configuration. On Windows, con... |
34585865 | What are .rej files which are created during merge | 34 | 2016-01-04 06:35:39 | <p>I was merging master branch into new branch, there are some .rej files are created. </p>
<p>I took a pool of master branch into new branch I got conflicts which I've resolved but there are some .rej files.</p>
<p>Can you please help me to know about the .rej files and what am I suppose to do with those files.</p>
| 47,176 | 4,412,564 | 2021-05-19 12:43:24 | 34,586,059 | 48 | 2016-01-04 06:52:15 | 1,755,598 | 2021-05-19 12:43:24 | https://stackoverflow.com/q/34585865 | https://stackoverflow.com/a/34586059 | <p><code>.rej</code> files are rejected files (usually hunks patches but not only).</p>
<p>When ever you get those files after merge you will manually have to edit them, fix them and then apply them back.</p>
<p>You can read <a href="https://web.archive.org/web/20130706020737/http://devblog.4teamwork.ch/blog/2013/06/05... | <p><code>.rej</code> files are rejected files (usually hunks patches but not only).</p> <p>When ever you get those files after merge you will manually have to edit them, fix them and then apply them back.</p> <p>You can read <a href="https://web.archive.org/web/20130706020737/http://devblog.4teamwork.ch/blog/2013/06/05... | 119, 53847 | branching-and-merging, git | <h1>What are .rej files which are created during merge</h1>
<p>I was merging master branch into new branch, there are some .rej files are created. </p>
<p>I took a pool of master branch into new branch I got conflicts which I've resolved but there are some .rej files.</p>
<p>Can you please help me to know about the .... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,537 | git | # What are .rej files which are created during merge
I was merging master branch into new branch, there are some .rej files are created.
I took a pool of master branch into new branch I got conflicts which I've resolved but there are some .rej files.
Can you please help me to know about the .rej files and what am I ... | `.rej` files are rejected files (usually hunks patches but not only).
When ever you get those files after merge you will manually have to edit them, fix them and then apply them back.
You can read [here](https://web.archive.org/web/20130706020737/http://devblog.4teamwork.ch/blog/2013/06/05/git-partially-applying-a-pa... |
29706086 | How to stage a rename without subsequent edits in git? | 34 | 2015-04-17 17:44:10 | <p>I have a file that I've renamed and then edited. I would like to tell Git to stage the rename, but not the content modifications. That is, I wish to stage the deletion of the old file name, and the addition of the old file contents with the new file name.</p>
<p>So I have this:</p>
<pre><code>Changes not staged fo... | 8,322 | 202,130 | 2022-01-30 03:15:37 | 29,707,465 | 48 | 2015-04-17 19:04:36 | 1,256,452 | 2015-04-19 02:40:44 | https://stackoverflow.com/q/29706086 | https://stackoverflow.com/a/29707465 | <p>Git doesn't really do renames. They're <em>all</em> computed in an "after the fact" fashion: git compares one commit with another and, <em>at compare time</em>, decides if there was a rename. This means that whether git considers something "a rename" changes dynamically. I know you're asking about a commit you ha... | <p>Git doesn't really do renames. They're <em>all</em> computed in an "after the fact" fashion: git compares one commit with another and, <em>at compare time</em>, decides if there was a rename. This means that whether git considers something "a rename" changes dynamically. I know you're asking about a commit you ha... | 119, 12895, 34792 | file-rename, git, git-add | <h1>How to stage a rename without subsequent edits in git?</h1>
<p>I have a file that I've renamed and then edited. I would like to tell Git to stage the rename, but not the content modifications. That is, I wish to stage the deletion of the old file name, and the addition of the old file contents with the new file nam... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,538 | git | # How to stage a rename without subsequent edits in git?
I have a file that I've renamed and then edited. I would like to tell Git to stage the rename, but not the content modifications. That is, I wish to stage the deletion of the old file name, and the addition of the old file contents with the new file name.
So I ... | Git doesn't really do renames. They're *all* computed in an "after the fact" fashion: git compares one commit with another and, *at compare time*, decides if there was a rename. This means that whether git considers something "a rename" changes dynamically. I know you're asking about a commit you haven't even made yet,... |
66235592 | Rebasing into feature branch | 33 | 2021-02-17 04:02:58 | <p>If I'm working on a feature branch for a long period of time (weeks) and I want to regularly rebase master into my branch, should I always switch to master, pull latest, then switch back to the feature branch and rebase master?</p>
| 74,413 | 3,393,030 | 2021-02-17 19:08:30 | 66,238,401 | 48 | 2021-02-17 08:39:20 | 6,309 | 2021-02-17 19:08:30 | https://stackoverflow.com/q/66235592 | https://stackoverflow.com/a/66238401 | <p>I would simply do, assuming I am already on the feature branch:</p>
<pre><code>git fetch && git rebase origin/master
</code></pre>
<p>You could, as commented, fetch only <code>master</code> with <code>git fetch origin master:master</code>, but I prefer fetching everything to have a complete local representat... | <p>I would simply do, assuming I am already on the feature branch:</p> <pre><code>git fetch && git rebase origin/master </code></pre> <p>You could, as commented, fetch only <code>master</code> with <code>git fetch origin master:master</code>, but I prefer fetching everything to have a complete local representat... | 119 | git | <h1>Rebasing into feature branch</h1>
<p>If I'm working on a feature branch for a long period of time (weeks) and I want to regularly rebase master into my branch, should I always switch to master, pull latest, then switch back to the feature branch and rebase master?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,539 | git | # Rebasing into feature branch
If I'm working on a feature branch for a long period of time (weeks) and I want to regularly rebase master into my branch, should I always switch to master, pull latest, then switch back to the feature branch and rebase master? | I would simply do, assuming I am already on the feature branch:
```
git fetch && git rebase origin/master
```
You could, as commented, fetch only `master` with `git fetch origin master:master`, but I prefer fetching everything to have a complete local representation of the remote repository.
And since you are not wo... |
12983282 | Did i just destroy my work by incorrectly using git rebase | 32 | 2012-10-19 22:26:47 | <p>I executed the following line:</p>
<pre><code>git rebase -i dev --onto master
</code></pre>
<p>I figured this would cut my dev branch and paste it on top of my master branch. And the -i would let me collapse the changesets.</p>
<p>But when it brought up the editor, I did not see any of the changesets. All I saw ... | 4,196 | 195,486 | 2019-01-06 16:12:51 | 12,983,352 | 48 | 2012-10-19 22:33:07 | 288,703 | 2019-01-06 16:12:51 | https://stackoverflow.com/q/12983282 | https://stackoverflow.com/a/12983352 | <p>Git makes it hard to lose work.</p>
<p>Run:</p>
<pre><code>git reflog
</code></pre>
<p>Than look for the commit that was just before the rebase</p>
<p>Then check it out</p>
<pre><code>git checkout <sha>
</code></pre>
<p>Look around, is it the version you wanted to recover? </p>
<p>If so, create a branch... | <p>Git makes it hard to lose work.</p> <p>Run:</p> <pre><code>git reflog </code></pre> <p>Than look for the commit that was just before the rebase</p> <p>Then check it out</p> <pre><code>git checkout <sha> </code></pre> <p>Look around, is it the version you wanted to recover? </p> <p>If so, create a branch... | 119, 456, 8974, 29934 | git, git-rebase, rebase, version-control | <h1>Did i just destroy my work by incorrectly using git rebase</h1>
<p>I executed the following line:</p>
<pre><code>git rebase -i dev --onto master
</code></pre>
<p>I figured this would cut my dev branch and paste it on top of my master branch. And the -i would let me collapse the changesets.</p>
<p>But when it br... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,543 | git | # Did i just destroy my work by incorrectly using git rebase
I executed the following line:
```
git rebase -i dev --onto master
```
I figured this would cut my dev branch and paste it on top of my master branch. And the -i would let me collapse the changesets.
But when it brought up the editor, I did not see any of... | Git makes it hard to lose work.
Run:
```
git reflog
```
Than look for the commit that was just before the rebase
Then check it out
```
git checkout <sha>
```
Look around, is it the version you wanted to recover?
If so, create a branch here
```
git checkout -b mybranch
``` |
32826960 | List all tracked files | 30 | 2015-09-28 15:48:19 | <p>is there a possibility in Git to show all tracked files in a repository when I am in a Subfolder? I tried: git ls-files --> but it lists just the files in the current foder and the subfolders - but not in the folders above.</p>
| 19,686 | 5,385,377 | 2024-12-12 02:57:12 | 32,827,149 | 48 | 2015-09-28 15:58:17 | 1,916,917 | 2015-09-28 15:58:17 | https://stackoverflow.com/q/32826960 | https://stackoverflow.com/a/32827149 | <p>Based on the question linked by Kristjan but with extra arguments to match output of <code>ls-files</code>:</p>
<pre><code>git ls-tree --full-tree -r --name-only HEAD
</code></pre>
| <p>Based on the question linked by Kristjan but with extra arguments to match output of <code>ls-files</code>:</p> <pre><code>git ls-tree --full-tree -r --name-only HEAD </code></pre> | 119 | git | <h1>List all tracked files</h1>
<p>is there a possibility in Git to show all tracked files in a repository when I am in a Subfolder? I tried: git ls-files --> but it lists just the files in the current foder and the subfolders - but not in the folders above.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,546 | git | # List all tracked files
is there a possibility in Git to show all tracked files in a repository when I am in a Subfolder? I tried: git ls-files --> but it lists just the files in the current foder and the subfolders - but not in the folders above. | Based on the question linked by Kristjan but with extra arguments to match output of `ls-files`:
```
git ls-tree --full-tree -r --name-only HEAD
``` |
11093080 | What is origin mapped to, how to find out | 30 | 2012-06-19 01:00:06 | <p>Say you </p>
<pre><code>git remote add origin git@git.assembla.com:myRepo.git
</code></pre>
<p>And then .. you know .. you forget what exactly <code>origin</code> is mapped to :(</p>
<p>How can you find out?</p>
| 24,900 | 359,862 | 2012-06-19 01:02:40 | 11,093,090 | 48 | 2012-06-19 01:01:45 | 499,609 | 2012-06-19 01:01:45 | https://stackoverflow.com/q/11093080 | https://stackoverflow.com/a/11093090 | <pre><code>git remote -v
</code></pre>
<p>will list them. The source for this information can be seen by inspecting <code>.git/config</code>:</p>
<pre><code>cat .git/config
</code></pre>
<p>The <code>config</code> file in the <code>.git</code> directory at the base of your repository contains all the configuration i... | <pre><code>git remote -v </code></pre> <p>will list them. The source for this information can be seen by inspecting <code>.git/config</code>:</p> <pre><code>cat .git/config </code></pre> <p>The <code>config</code> file in the <code>.git</code> directory at the base of your repository contains all the configuration i... | 119 | git | <h1>What is origin mapped to, how to find out</h1>
<p>Say you </p>
<pre><code>git remote add origin git@git.assembla.com:myRepo.git
</code></pre>
<p>And then .. you know .. you forget what exactly <code>origin</code> is mapped to :(</p>
<p>How can you find out?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,547 | git | # What is origin mapped to, how to find out
Say you
```
git remote add origin git@git.assembla.com:myRepo.git
```
And then .. you know .. you forget what exactly `origin` is mapped to :(
How can you find out? | ```
git remote -v
```
will list them. The source for this information can be seen by inspecting `.git/config`:
```
cat .git/config
```
The `config` file in the `.git` directory at the base of your repository contains all the configuration in a plain-text format.
You'll see something like this:
```
[remote "origin"... |
7360214 | alternative source for installing git. brew install git; kernel.org Down for maintenance | 28 | 2011-09-09 10:20:50 | <p>i just noticed that kernel.org is Down for maintenance. is there a different formula which uses a different mirror ? or could i add a different source (like bundler?) to homebrew?</p>
<p>thx for help!</p>
| 13,709 | 571,111 | 2015-10-27 20:51:23 | 7,370,964 | 48 | 2011-09-10 10:00:35 | 401,546 | 2011-09-22 19:52:38 | https://stackoverflow.com/q/7360214 | https://stackoverflow.com/a/7370964 | <p>Quick workaround:
Perform
<code>brew edit git</code></p>
<p><strong>And put</strong> </p>
<p><code>url 'https://github.com/git/git/tarball/v1.7.6.1'</code></p>
<p><code>md5 'ab731cf9b99529f3f8d126aa15d9a1cd'</code></p>
<p><strong>Instead of</strong></p>
<p><code>url 'http://kernel.org/pub/software/scm/git/git-... | <p>Quick workaround: Perform <code>brew edit git</code></p> <p><strong>And put</strong> </p> <p><code>url 'https://github.com/git/git/tarball/v1.7.6.1'</code></p> <p><code>md5 'ab731cf9b99529f3f8d126aa15d9a1cd'</code></p> <p><strong>Instead of</strong></p> <p><code>url 'http://kernel.org/pub/software/scm/git/git-... | 119, 1067 | git, homebrew | <h1>alternative source for installing git. brew install git; kernel.org Down for maintenance</h1>
<p>i just noticed that kernel.org is Down for maintenance. is there a different formula which uses a different mirror ? or could i add a different source (like bundler?) to homebrew?</p>
<p>thx for help!</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,549 | git | # alternative source for installing git. brew install git; kernel.org Down for maintenance
i just noticed that kernel.org is Down for maintenance. is there a different formula which uses a different mirror ? or could i add a different source (like bundler?) to homebrew?
thx for help! | Quick workaround:
Perform
`brew edit git`
**And put**
`url 'https://github.com/git/git/tarball/v1.7.6.1'`
`md5 'ab731cf9b99529f3f8d126aa15d9a1cd'`
**Instead of**
`url 'http://kernel.org/pub/software/scm/git/git-1.7.6.1.tar.bz2'`
`md5 'd1e00772cc9dc6c571999feb9e8771ab'`
**Also put**
`url 'http://ftp.uk.freesbie.... |
39128477 | git, How to push local branch into the specific remote | 27 | 2016-08-24 16:22:35 | <p>Could you explain how to push a local branch to a specific remote branch?</p>
<pre><code>$ git branch -vv
dev 4d46c96 [origin/dev] Merge branch '1783' into dev
dev_3_feature 226b914 second commit in dev_3_feature
dev_second_feature 6b5f10f second commit in dev_2_feature
master baf5fc0 [origin/master: ahead 1] maste... | 41,155 | 2,519,875 | 2021-12-10 02:07:16 | 39,128,754 | 48 | 2016-08-24 16:37:25 | 3,498,931 | 2021-12-10 02:07:16 | https://stackoverflow.com/q/39128477 | https://stackoverflow.com/a/39128754 | <p>Update :</p>
<p>So, generally when you work with Remote, First of all you need to pull the repository or branch.</p>
<p>If its repository then</p>
<pre><code>git pull origin
</code></pre>
<p>if its branch then</p>
<pre><code>git pull origin <yourRemoteBranchName>
</code></pre>
<p>after you pulled it, it will b... | <p>Update :</p> <p>So, generally when you work with Remote, First of all you need to pull the repository or branch.</p> <p>If its repository then</p> <pre><code>git pull origin </code></pre> <p>if its branch then</p> <pre><code>git pull origin <yourRemoteBranchName> </code></pre> <p>after you pulled it, it will b... | 119, 41346, 76220 | git, git-branch, git-remote | <h1>git, How to push local branch into the specific remote</h1>
<p>Could you explain how to push a local branch to a specific remote branch?</p>
<pre><code>$ git branch -vv
dev 4d46c96 [origin/dev] Merge branch '1783' into dev
dev_3_feature 226b914 second commit in dev_3_feature
dev_second_feature 6b5f10f second commi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,550 | git | # git, How to push local branch into the specific remote
Could you explain how to push a local branch to a specific remote branch?
```
$ git branch -vv
dev 4d46c96 [origin/dev] Merge branch '1783' into dev
dev_3_feature 226b914 second commit in dev_3_feature
dev_second_feature 6b5f10f second commit in dev_2_feature
... | Update :
So, generally when you work with Remote, First of all you need to pull the repository or branch.
If its repository then
```
git pull origin
```
if its branch then
```
git pull origin <yourRemoteBranchName>
```
after you pulled it, it will be on your machine. Now your current branch is `yourRemoteBranchNa... |
38468700 | How to merge branches in 2 different repositories? | 27 | 2016-07-19 21:17:24 | <p><a href="https://i.sstatic.net/FjjQD.png" rel="noreferrer"><img src="https://i.sstatic.net/FjjQD.png" alt="enter image description here"></a></p>
<p>I am new to git and I would like to know how to merge <strong>Master</strong> branch from <strong>Sample Project 2</strong> TO <strong>UAT</strong> branch in <strong>S... | 39,374 | 3,528,213 | 2016-07-19 22:22:38 | 38,469,476 | 48 | 2016-07-19 22:22:38 | 1,406,321 | 2016-07-19 22:22:38 | https://stackoverflow.com/q/38468700 | https://stackoverflow.com/a/38469476 | <p>I would suggest you to create a local clone of the Staging/Support repository. Then you add the project repositories as further remote repositories, which allows you to interact with them in your local repository. Do the merges locally and push the result to the Staging repository.</p>
<p>This can be achieved using... | <p>I would suggest you to create a local clone of the Staging/Support repository. Then you add the project repositories as further remote repositories, which allows you to interact with them in your local repository. Do the merges locally and push the result to the Staging repository.</p> <p>This can be achieved using... | 119, 456 | git, version-control | <h1>How to merge branches in 2 different repositories?</h1>
<p><a href="https://i.sstatic.net/FjjQD.png" rel="noreferrer"><img src="https://i.sstatic.net/FjjQD.png" alt="enter image description here"></a></p>
<p>I am new to git and I would like to know how to merge <strong>Master</strong> branch from <strong>Sample Pr... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,551 | git | # How to merge branches in 2 different repositories?
[](https://i.sstatic.net/FjjQD.png)
I am new to git and I would like to know how to merge **Master** branch from **Sample Project 2** TO **UAT** branch in **Staging/Support**. I know its possible to me... | I would suggest you to create a local clone of the Staging/Support repository. Then you add the project repositories as further remote repositories, which allows you to interact with them in your local repository. Do the merges locally and push the result to the Staging repository.
This can be achieved using the follo... |
19954485 | extract multiple directories using git-filter-branch | 26 | 2013-11-13 12:59:31 | <p>I have a big repository which currently contains multiple projects in top level subfolders, say <code>/a</code>, <code>/b</code>, <code>/c</code>, and <code>/d</code>.</p>
<p>Now I want to split up that repository into two different repositories: one containing <code>/a</code> and <code>/b</code> and the other cont... | 12,726 | 1,870,481 | 2020-09-08 13:18:40 | 19,957,874 | 48 | 2013-11-13 15:33:46 | 1,870,481 | 2013-11-14 17:28:52 | https://stackoverflow.com/q/19954485 | https://stackoverflow.com/a/19957874 | <p>Use</p>
<pre><code>git filter-branch -f --prune-empty --tree-filter 'bash preserve-only.sh a b' -- --all
</code></pre>
<p>where <code>preserve-only.sh</code> is:</p>
<pre><code>IFS=':'
GLOBIGNORE="$*"
rm -rf *
</code></pre>
<p>This should remove everything but <code>a</code> and <code>b</code> from all commits o... | <p>Use</p> <pre><code>git filter-branch -f --prune-empty --tree-filter 'bash preserve-only.sh a b' -- --all </code></pre> <p>where <code>preserve-only.sh</code> is:</p> <pre><code>IFS=':' GLOBIGNORE="$*" rm -rf * </code></pre> <p>This should remove everything but <code>a</code> and <code>b</code> from all commits o... | 119, 6452, 29934, 46509 | git, git-filter-branch, git-rebase, git-svn | <h1>extract multiple directories using git-filter-branch</h1>
<p>I have a big repository which currently contains multiple projects in top level subfolders, say <code>/a</code>, <code>/b</code>, <code>/c</code>, and <code>/d</code>.</p>
<p>Now I want to split up that repository into two different repositories: one con... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,552 | git | # extract multiple directories using git-filter-branch
I have a big repository which currently contains multiple projects in top level subfolders, say `/a`, `/b`, `/c`, and `/d`.
Now I want to split up that repository into two different repositories: one containing `/a` and `/b` and the other containing `/c` and `/d`... | Use
```
git filter-branch -f --prune-empty --tree-filter 'bash preserve-only.sh a b' -- --all
```
where `preserve-only.sh` is:
```
IFS=':'
GLOBIGNORE="$*"
rm -rf *
```
This should remove everything but `a` and `b` from all commits of all branches, which should be the same as extracting exactly the given directories... |
30023405 | How to git compare the working copy, staged copy, and committed copy of a file? | 25 | 2015-05-04 05:53:50 | <p>Assume for a moment I have a file in a repository called LICENSE.txt. The contents looks as follows:</p>
<pre><code>Copyright 2014 MyCompany. All Rights Reserved.
</code></pre>
<p>Since its 2015 I changed the year so its 2015:</p>
<pre><code>Copyright 2015 MyCompany. All Rights Reserved.
</code></pre>
<p>And the... | 18,555 | 715,978 | 2024-08-26 05:45:52 | 30,023,448 | 48 | 2015-05-04 05:57:41 | 6,309 | 2015-05-04 06:33:46 | https://stackoverflow.com/q/30023405 | https://stackoverflow.com/a/30023448 | <blockquote>
<p>How do I compare the staged copy (the one with the year change) with working copy.<br>
[...] I had the need to compare what I have staged with changes I subsequently made to the file</p>
</blockquote>
<p>That would still be <code>git diff</code>.</p>
<p>(edit by OP: How do I compare the <em>commit... | <blockquote> <p>How do I compare the staged copy (the one with the year change) with working copy.<br> [...] I had the need to compare what I have staged with changes I subsequently made to the file</p> </blockquote> <p>That would still be <code>git diff</code>.</p> <p>(edit by OP: How do I compare the <em>commit... | 119, 9033 | git, git-diff | <h1>How to git compare the working copy, staged copy, and committed copy of a file?</h1>
<p>Assume for a moment I have a file in a repository called LICENSE.txt. The contents looks as follows:</p>
<pre><code>Copyright 2014 MyCompany. All Rights Reserved.
</code></pre>
<p>Since its 2015 I changed the year so its 2015:... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,553 | git | # How to git compare the working copy, staged copy, and committed copy of a file?
Assume for a moment I have a file in a repository called LICENSE.txt. The contents looks as follows:
```
Copyright 2014 MyCompany. All Rights Reserved.
```
Since its 2015 I changed the year so its 2015:
```
Copyright 2015 MyCompany. A... | > How do I compare the staged copy (the one with the year change) with working copy.
> [...] I had the need to compare what I have staged with changes I subsequently made to the file
That would still be `git diff`.
(edit by OP: How do I compare the *committed* copy (the one with the year change) with working copy
... |
28990596 | SourceTree - remove waiting pushes | 25 | 2015-03-11 15:22:30 | <p>How do I remove commits, waiting to be pushed to remote?</p>
<p><img src="https://i.sstatic.net/86KO4.png" alt="2 pushes waiting"></p>
<p>My situation is, that those queued commits (changes) been already pushed (more bellow) and now the server refuses to accept those as they are behind the HEAD.</p>
<p>I tried re... | 46,445 | 896,405 | 2015-03-11 18:08:29 | 28,994,088 | 48 | 2015-03-11 18:01:38 | 164,966 | 2015-03-11 18:08:29 | https://stackoverflow.com/q/28990596 | https://stackoverflow.com/a/28994088 | <p>Git commits form a commit graph. Branches are just named pointers to commits in that graph.</p>
<p>Given that, your question can be restated as</p>
<blockquote>
<p>My local <em>master</em> branch is pointing to a different commit than the remote <em>master</em> branch. How do I make my local <em>master</em> br... | <p>Git commits form a commit graph. Branches are just named pointers to commits in that graph.</p> <p>Given that, your question can be restated as</p> <blockquote> <p>My local <em>master</em> branch is pointing to a different commit than the remote <em>master</em> branch. How do I make my local <em>master</em> br... | 119, 4236, 5597, 53850, 90056 | atlassian-sourcetree, commit, git, git-commit, push | <h1>SourceTree - remove waiting pushes</h1>
<p>How do I remove commits, waiting to be pushed to remote?</p>
<p><img src="https://i.sstatic.net/86KO4.png" alt="2 pushes waiting"></p>
<p>My situation is, that those queued commits (changes) been already pushed (more bellow) and now the server refuses to accept those as ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,554 | git | # SourceTree - remove waiting pushes
How do I remove commits, waiting to be pushed to remote?

My situation is, that those queued commits (changes) been already pushed (more bellow) and now the server refuses to accept those as they are behind the HEAD.
I tried re... | Git commits form a commit graph. Branches are just named pointers to commits in that graph.
Given that, your question can be restated as
> My local *master* branch is pointing to a different commit than the remote *master* branch. How do I make my local *master* branch point to the same commit as the remote *master* ... |
6345786 | Python: reading a pkcs12 certificate with pyOpenSSL.crypto | 24 | 2011-06-14 15:09:35 | <p>I have a valid certificate issued by the spanish authority (FNMT) and I want to play with it to learn more about it.
The file has extension .p12</p>
<p>I would like to read the information in it (first and last name) and check if the certificate is valid. Is it possible to do that with pyOpenSSL? I guess I have to ... | 64,255 | 462,707 | 2021-01-12 15:11:06 | 6,346,268 | 48 | 2011-06-14 15:43:38 | null | 2016-06-02 12:51:37 | https://stackoverflow.com/q/6345786 | https://stackoverflow.com/a/6346268 | <p>It's fairly straight-forward to use. This isn't tested, but should work:</p>
<pre><code># load OpenSSL.crypto
from OpenSSL import crypto
# open it, using password. Supply/read your own from stdin.
p12 = crypto.load_pkcs12(open("/path/to/cert.p12", 'rb').read(), passwd)
# get various properties of said file.
# not... | <p>It's fairly straight-forward to use. This isn't tested, but should work:</p> <pre><code># load OpenSSL.crypto from OpenSSL import crypto # open it, using password. Supply/read your own from stdin. p12 = crypto.load_pkcs12(open("/path/to/cert.p12", 'rb').read(), passwd) # get various properties of said file. # not... | 16, 1999, 2387, 7014, 8502 | cryptography, digital-certificate, openssl, pyopenssl, python | <h1>Python: reading a pkcs12 certificate with pyOpenSSL.crypto</h1>
<p>I have a valid certificate issued by the spanish authority (FNMT) and I want to play with it to learn more about it.
The file has extension .p12</p>
<p>I would like to read the information in it (first and last name) and check if the certificate is... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,555 | git | # Python: reading a pkcs12 certificate with pyOpenSSL.crypto
I have a valid certificate issued by the spanish authority (FNMT) and I want to play with it to learn more about it.
The file has extension .p12
I would like to read the information in it (first and last name) and check if the certificate is valid. Is it po... | It's fairly straight-forward to use. This isn't tested, but should work:
```
# load OpenSSL.crypto
from OpenSSL import crypto
# open it, using password. Supply/read your own from stdin.
p12 = crypto.load_pkcs12(open("/path/to/cert.p12", 'rb').read(), passwd)
# get various properties of said file.
# note these are Py... |
48850682 | Doing a git bisect and one of the commits doesn't build | 21 | 2018-02-18 10:35:07 | <p>I'm trying to find a problem in the app I'm working on and I started to do a git bisect. There are 9 steps to the bisect so 256+ commits that could potentially cause this issue.</p>
<p>However, one of the git bisect steps checked out a commit that wouldn't build. Because it was committed before being run and not fi... | 2,047 | 421,018 | 2018-02-18 10:37:55 | 48,850,696 | 48 | 2018-02-18 10:37:04 | 4,323 | 2018-02-18 10:37:55 | https://stackoverflow.com/q/48850682 | https://stackoverflow.com/a/48850696 | <p>Just say <code>git bisect skip</code> to "skip" the commit you can't build. It knows what to do, and will choose another commit to try.</p>
| <p>Just say <code>git bisect skip</code> to "skip" the commit you can't build. It knows what to do, and will choose another commit to try.</p> | 119, 47326 | git, git-bisect | <h1>Doing a git bisect and one of the commits doesn't build</h1>
<p>I'm trying to find a problem in the app I'm working on and I started to do a git bisect. There are 9 steps to the bisect so 256+ commits that could potentially cause this issue.</p>
<p>However, one of the git bisect steps checked out a commit that wou... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,558 | git | # Doing a git bisect and one of the commits doesn't build
I'm trying to find a problem in the app I'm working on and I started to do a git bisect. There are 9 steps to the bisect so 256+ commits that could potentially cause this issue.
However, one of the git bisect steps checked out a commit that wouldn't build. Bec... | Just say `git bisect skip` to "skip" the commit you can't build. It knows what to do, and will choose another commit to try. |
16337498 | Understanding git gc --auto | 18 | 2013-05-02 11:57:17 | <p>I'm experimenting with fairly aggressive auto gc in Git, mainly for packing purposes. In my repos if I do <code>git config --list</code> I have setup</p>
<pre><code>...
gc.auto=250
gc.autopacklimit=30
...
</code></pre>
<p>If I do <code>git count-objects -v</code> I get</p>
<pre><code>count: 376
size: 1251
in-pack... | 12,545 | 826,840 | 2024-09-16 19:57:05 | 16,342,938 | 48 | 2013-05-02 16:17:03 | 758,345 | 2018-11-09 17:22:20 | https://stackoverflow.com/q/16337498 | https://stackoverflow.com/a/16342938 | <p>One of the main points of <code>gc --auto</code> is that it should be very quick, so other commands can frequently call it “just in case”. To achieve that, the object count is only guessed. As <code>git help config</code> says under <code>gc.auto</code>:</p>
<blockquote>
<p>When there are <strong>approximately</s... | <p>One of the main points of <code>gc --auto</code> is that it should be very quick, so other commands can frequently call it “just in case”. To achieve that, the object count is only guessed. As <code>git help config</code> says under <code>gc.auto</code>:</p> <blockquote> <p>When there are <strong>approximately</s... | 119, 1850 | garbage-collection, git | <h1>Understanding git gc --auto</h1>
<p>I'm experimenting with fairly aggressive auto gc in Git, mainly for packing purposes. In my repos if I do <code>git config --list</code> I have setup</p>
<pre><code>...
gc.auto=250
gc.autopacklimit=30
...
</code></pre>
<p>If I do <code>git count-objects -v</code> I get</p>
<pr... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,560 | git | # Understanding git gc --auto
I'm experimenting with fairly aggressive auto gc in Git, mainly for packing purposes. In my repos if I do `git config --list` I have setup
```
...
gc.auto=250
gc.autopacklimit=30
...
```
If I do `git count-objects -v` I get
```
count: 376
size: 1251
in-pack: 2776
packs: 1
size-pack: 26... | One of the main points of `gc --auto` is that it should be very quick, so other commands can frequently call it “just in case”. To achieve that, the object count is only guessed. As `git help config` says under `gc.auto`:
> When there are **approximately** more than this many loose objects in the repository […]
Looki... |
36517118 | How do I checkout an old git commit in Android Studio? | 12 | 2016-04-09 13:01:35 | <p>I would like to look at an old commit of my app in Android Studio in order to compile and run it. I don’t want to reset back to the previous commit or change my commit history or anything like that. When I’m done, I want to go back to the latest version.</p>
<p>On the command line, this would be a simple </p>
<pre... | 15,251 | 1,785,730 | 2020-11-20 06:36:42 | 36,517,330 | 48 | 2016-04-09 13:21:19 | 396,033 | 2016-04-09 13:21:19 | https://stackoverflow.com/q/36517118 | https://stackoverflow.com/a/36517330 | <p>If you want to checkout commit using Android Studio (or other IntelliJ IDEA based IDE) just go to<code>Version Control</code> view (alt+9) and click the <code>Log</code> tab. Type your commit hash in <code>Filter</code> input, right-click on the commit entry and click the <code>Checkout Revision</code> option. </p>
... | <p>If you want to checkout commit using Android Studio (or other IntelliJ IDEA based IDE) just go to<code>Version Control</code> view (alt+9) and click the <code>Log</code> tab. Type your commit hash in <code>Filter</code> input, right-click on the commit entry and click the <code>Checkout Revision</code> option. </p> ... | 119, 91905 | android-studio, git | <h1>How do I checkout an old git commit in Android Studio?</h1>
<p>I would like to look at an old commit of my app in Android Studio in order to compile and run it. I don’t want to reset back to the previous commit or change my commit history or anything like that. When I’m done, I want to go back to the latest version... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,562 | git | # How do I checkout an old git commit in Android Studio?
I would like to look at an old commit of my app in Android Studio in order to compile and run it. I don’t want to reset back to the previous commit or change my commit history or anything like that. When I’m done, I want to go back to the latest version.
On the... | If you want to checkout commit using Android Studio (or other IntelliJ IDEA based IDE) just go to`Version Control` view (alt+9) and click the `Log` tab. Type your commit hash in `Filter` input, right-click on the commit entry and click the `Checkout Revision` option.
What's more, if you want to work with a command lin... |
86402 | How can I get Git to follow symlinks? | 283 | 2008-09-17 18:57:36 | <p>Is my best be going to be a shell script which replaces symlinks with copies, or is there another way of telling Git to follow symlinks?</p>
<p>PS: I know it's not very secure, but I only want to do it in a few specific cases.</p>
| 133,354 | 15,368 | 2025-06-23 01:43:04 | 86,459 | 47 | 2008-09-17 19:03:00 | 15,614 | 2018-10-27 10:07:29 | https://stackoverflow.com/q/86402 | https://stackoverflow.com/a/86459 | <p><strong>NOTE:</strong> This advice is now out-dated as per comment since Git 1.6.1. Git used to behave this way, and no longer does.</p>
<hr>
<p>Git by default attempts to store symlinks instead of following them (for compactness, and it's generally what people want).</p>
<p>However, I accidentally managed to get... | <p><strong>NOTE:</strong> This advice is now out-dated as per comment since Git 1.6.1. Git used to behave this way, and no longer does.</p> <hr> <p>Git by default attempts to store symlinks instead of following them (for compactness, and it's generally what people want).</p> <p>However, I accidentally managed to get... | 119, 1122 | git, symlink | <h1>How can I get Git to follow symlinks?</h1>
<p>Is my best be going to be a shell script which replaces symlinks with copies, or is there another way of telling Git to follow symlinks?</p>
<p>PS: I know it's not very secure, but I only want to do it in a few specific cases.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,563 | git | # How can I get Git to follow symlinks?
Is my best be going to be a shell script which replaces symlinks with copies, or is there another way of telling Git to follow symlinks?
PS: I know it's not very secure, but I only want to do it in a few specific cases. | **NOTE:** This advice is now out-dated as per comment since Git 1.6.1. Git used to behave this way, and no longer does.
---
Git by default attempts to store symlinks instead of following them (for compactness, and it's generally what people want).
However, I accidentally managed to get it to add files beyond the sym... |
5551269 | Ignore .pyc files in git repository | 165 | 2011-04-05 11:45:31 | <p>How can I ignore <code>.pyc</code> files in git?</p>
<p>If I put it in <code>.gitignore</code> it doesn't work. I need them to be untracked and not checked for commits.</p>
| 222,633 | 312,251 | 2023-01-12 05:56:22 | 5,551,327 | 47 | 2011-04-05 11:50:04 | 20,862 | 2015-06-02 08:23:14 | https://stackoverflow.com/q/5551269 | https://stackoverflow.com/a/5551327 | <p>Put it in <code>.gitignore</code>. But from the <code>gitignore(5)</code> man page:</p>
<blockquote>
<pre><code> · If the pattern does not contain a slash /, git treats it as a shell
glob pattern and checks for a match against the pathname relative
to the location of the .gitignore file (relative t... | <p>Put it in <code>.gitignore</code>. But from the <code>gitignore(5)</code> man page:</p> <blockquote> <pre><code> · If the pattern does not contain a slash /, git treats it as a shell glob pattern and checks for a match against the pathname relative to the location of the .gitignore file (relative t... | 16, 119 | git, python | <h1>Ignore .pyc files in git repository</h1>
<p>How can I ignore <code>.pyc</code> files in git?</p>
<p>If I put it in <code>.gitignore</code> it doesn't work. I need them to be untracked and not checked for commits.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,565 | git | # Ignore .pyc files in git repository
How can I ignore `.pyc` files in git?
If I put it in `.gitignore` it doesn't work. I need them to be untracked and not checked for commits. | Put it in `.gitignore`. But from the `gitignore(5)` man page:
> ```
> · If the pattern does not contain a slash /, git treats it as a shell
> glob pattern and checks for a match against the pathname relative
> to the location of the .gitignore file (relative to the toplevel of
> the work tree ... |
26024586 | How can I merge a branch into master but continue working on the branch? | 73 | 2014-09-24 19:07:28 | <p>I created a branch to try a different approach and it worked, so I would like to merge the "Farmcrops" branch into "Master" to keep those changes but continue the "Farmcrops" branch to explore another possibility. That way, if this latest change doesn't work, I can revert back to "Master" which would now include the... | 41,637 | 494,139 | 2021-09-18 10:16:58 | 26,024,861 | 47 | 2014-09-24 19:24:24 | 3,975,214 | 2014-09-24 19:31:02 | https://stackoverflow.com/q/26024586 | https://stackoverflow.com/a/26024861 | <p>Here is the process you are looking for:</p>
<ol>
<li><code>git checkout master</code></li>
<li><code>git merge Farmcrops</code></li>
<li><code>git push origin master</code></li>
<li><code>git branch -d Farmcrops</code></li>
<li><code>git checkout master</code></li>
<li><code>git checkout -b Farmcrops</code></li>
<... | <p>Here is the process you are looking for:</p> <ol> <li><code>git checkout master</code></li> <li><code>git merge Farmcrops</code></li> <li><code>git push origin master</code></li> <li><code>git branch -d Farmcrops</code></li> <li><code>git checkout master</code></li> <li><code>git checkout -b Farmcrops</code></li> <... | 119, 1879 | branch, git | <h1>How can I merge a branch into master but continue working on the branch?</h1>
<p>I created a branch to try a different approach and it worked, so I would like to merge the "Farmcrops" branch into "Master" to keep those changes but continue the "Farmcrops" branch to explore another possibility. That way, if this lat... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,568 | git | # How can I merge a branch into master but continue working on the branch?
I created a branch to try a different approach and it worked, so I would like to merge the "Farmcrops" branch into "Master" to keep those changes but continue the "Farmcrops" branch to explore another possibility. That way, if this latest chang... | Here is the process you are looking for:
1. `git checkout master`
2. `git merge Farmcrops`
3. `git push origin master`
4. `git branch -d Farmcrops`
5. `git checkout master`
6. `git checkout -b Farmcrops`
7. continue your commits on the branch `Farmcrops`...
Branches are just pointers, it's very easy to create/delete ... |
4750845 | How do you annotate a branch? | 71 | 2011-01-20 18:13:34 | <p>Is there any way to annotate a branch? It would be nice to be able to do something like:</p>
<pre>
$ git notes add branch-name -m 'This branch is for whatever'
</pre>
<p>but that of course is not terribly helpful, since the note applies to the current head of the branch rather than the branch itself. </p>
<p>An ... | 18,558 | 140,750 | 2019-02-10 13:12:09 | 4,755,244 | 47 | 2011-01-21 04:01:11 | 7,230 | 2018-12-19 20:19:51 | https://stackoverflow.com/q/4750845 | https://stackoverflow.com/a/4755244 | <p>This would be a totally different approach than <code>git note</code> but you could use <code>git config</code> for this functionality.</p>
<pre><code>$ git config branch.<branch-name>.note 'This is what this branch is for'
</code></pre>
<p>This can be aliased to make the interface simpler (I'm guessing this... | <p>This would be a totally different approach than <code>git note</code> but you could use <code>git config</code> for this functionality.</p> <pre><code>$ git config branch.<branch-name>.note 'This is what this branch is for' </code></pre> <p>This can be aliased to make the interface simpler (I'm guessing this... | 119 | git | <h1>How do you annotate a branch?</h1>
<p>Is there any way to annotate a branch? It would be nice to be able to do something like:</p>
<pre>
$ git notes add branch-name -m 'This branch is for whatever'
</pre>
<p>but that of course is not terribly helpful, since the note applies to the current head of the branch rath... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,569 | git | # How do you annotate a branch?
Is there any way to annotate a branch? It would be nice to be able to do something like:
```
$ git notes add branch-name -m 'This branch is for whatever'
```
but that of course is not terribly helpful, since the note applies to the current head of the branch rather than the branch its... | This would be a totally different approach than `git note` but you could use `git config` for this functionality.
```
$ git config branch.<branch-name>.note 'This is what this branch is for'
```
This can be aliased to make the interface simpler (I'm guessing this can be improved but this is what I use):
```
$ git co... |
7775881 | Using Git for writing thesis | 60 | 2011-10-15 05:07:13 | <p>I am planning to use Git for writing my thesis with Latex. As Git is specifically designed for software development, would it be feasible for my requirements? If it is a good choice for me, then what special and unique features are available in Git which are ideal for writing a thesis. Also I want to know what preca... | 24,813 | 498,309 | 2018-12-19 09:12:35 | 7,780,326 | 47 | 2011-10-15 20:07:04 | 278,878 | 2013-04-05 18:22:27 | https://stackoverflow.com/q/7775881 | https://stackoverflow.com/a/7780326 | <p>There are some technical considerations and best practices. I am going for the second one, specifically for writing your thesis and/or papers. For the technical ones, you can check any git tutorial.</p>
<ol>
<li><p>Define the directory structure for your thesis. You can change it
later, and use git for tracking ... | <p>There are some technical considerations and best practices. I am going for the second one, specifically for writing your thesis and/or papers. For the technical ones, you can check any git tutorial.</p> <ol> <li><p>Define the directory structure for your thesis. You can change it later, and use git for tracking ... | 119, 456 | git, version-control | <h1>Using Git for writing thesis</h1>
<p>I am planning to use Git for writing my thesis with Latex. As Git is specifically designed for software development, would it be feasible for my requirements? If it is a good choice for me, then what special and unique features are available in Git which are ideal for writing a ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,572 | git | # Using Git for writing thesis
I am planning to use Git for writing my thesis with Latex. As Git is specifically designed for software development, would it be feasible for my requirements? If it is a good choice for me, then what special and unique features are available in Git which are ideal for writing a thesis. A... | There are some technical considerations and best practices. I am going for the second one, specifically for writing your thesis and/or papers. For the technical ones, you can check any git tutorial.
1. Define the directory structure for your thesis. You can change it
later, and use git for tracking the changes. Hav... |
3516823 | What's the difference between the index, cached, and staged in git? | 55 | 2010-08-18 21:23:01 | <p>Are these the same thing? If so, why are there so many terms?!</p>
<p>Also, I know there is this thing called git stash, which is a place where you can temporarily store changes to your working copy without committing them to the repo. I find this tool really useful, but again, the name is very similar to a bunch o... | 11,138 | 62,163 | 2022-11-13 05:22:39 | 3,516,845 | 47 | 2010-08-18 21:25:59 | 12,711 | 2017-01-12 13:21:30 | https://stackoverflow.com/q/3516823 | https://stackoverflow.com/a/3516845 | <p>The index/stage/cache are the same thing - as for why so many terms, I think that index was the 'original' term, but people found it confusing, so the other terms were introduced. And I agree that it makes things a bit confusing sometimes at first.</p>
<p>The <code>stash</code> facility of git is a way to store 'in... | <p>The index/stage/cache are the same thing - as for why so many terms, I think that index was the 'original' term, but people found it confusing, so the other terms were introduced. And I agree that it makes things a bit confusing sometimes at first.</p> <p>The <code>stash</code> facility of git is a way to store 'in... | 119 | git | <h1>What's the difference between the index, cached, and staged in git?</h1>
<p>Are these the same thing? If so, why are there so many terms?!</p>
<p>Also, I know there is this thing called git stash, which is a place where you can temporarily store changes to your working copy without committing them to the repo. I f... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,573 | git | # What's the difference between the index, cached, and staged in git?
Are these the same thing? If so, why are there so many terms?!
Also, I know there is this thing called git stash, which is a place where you can temporarily store changes to your working copy without committing them to the repo. I find this tool re... | The index/stage/cache are the same thing - as for why so many terms, I think that index was the 'original' term, but people found it confusing, so the other terms were introduced. And I agree that it makes things a bit confusing sometimes at first.
The `stash` facility of git is a way to store 'in-progress' work that ... |
61037557 | Should I commit .lock file changes separately? What should I write for the commit message? | 54 | 2020-04-05 03:13:35 | <p>I'm using <a href="https://python-poetry.org/" rel="noreferrer">poetry</a> for my Python package manager but I believe this would apply to any programming practices. </p>
<p>I've been doing this without knowing exactly what I'm doing, or how I should be doing. </p>
<p>When you use a package manager and install a n... | 38,565 | 8,491,363 | 2024-04-18 09:11:00 | 61,076,546 | 47 | 2020-04-07 09:13:22 | 962,190 | 2023-10-26 15:45:33 | https://stackoverflow.com/q/61037557 | https://stackoverflow.com/a/61076546 | <p><strong>Disclaimer</strong></p>
<p>Please refer to <a href="https://stackoverflow.com/a/74045098/962190">this answer</a> for the official stance and justification on the topic, which should be the top post in this thread. Below is my original answer, which I'll leave as it was.</p>
<hr />
<p>The <a href="https://pyt... | <p><strong>Disclaimer</strong></p> <p>Please refer to <a href="https://stackoverflow.com/a/74045098/962190">this answer</a> for the official stance and justification on the topic, which should be the top post in this thread. Below is my original answer, which I'll leave as it was.</p> <hr /> <p>The <a href="https://pyt... | 16, 119, 136975 | git, python, python-poetry | <h1>Should I commit .lock file changes separately? What should I write for the commit message?</h1>
<p>I'm using <a href="https://python-poetry.org/" rel="noreferrer">poetry</a> for my Python package manager but I believe this would apply to any programming practices. </p>
<p>I've been doing this without knowing exact... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,574 | git | # Should I commit .lock file changes separately? What should I write for the commit message?
I'm using [poetry](https://python-poetry.org/) for my Python package manager but I believe this would apply to any programming practices.
I've been doing this without knowing exactly what I'm doing, or how I should be doing.
... | **Disclaimer**
Please refer to [this answer](https://stackoverflow.com/a/74045098/962190) for the official stance and justification on the topic, which should be the top post in this thread. Below is my original answer, which I'll leave as it was.
---
The [official recommendation of the poetry maintainers](https://p... |
13263902 | git merge, keep both | 47 | 2012-11-07 05:53:20 | <p>For merging I use this to "keep mine"</p>
<pre><code>git merge -X ours foo
</code></pre>
<p>and this for "keep theirs"</p>
<pre><code>git merge -X theirs foo
</code></pre>
<p>However on my latest merge it looks best to keep both sides. Does Git have a "strategy" for this, to avoid manually editing the file?</p>
| 34,163 | 1,002,260 | 2023-04-08 09:06:36 | 13,264,117 | 47 | 2012-11-07 06:14:39 | 2,667 | 2012-11-07 06:14:39 | https://stackoverflow.com/q/13263902 | https://stackoverflow.com/a/13264117 | <p>There is no 'merge strategy' for resolving these conflicts.</p>
<p>However, if you truly want a conflict like:</p>
<pre><code><<<< ours
Foo
=========
Bar
>>>> theirs
</code></pre>
<p>to resolve to</p>
<pre><code>Foo
Bar
</code></pre>
<p>then you can configure the 'merge driver'. From t... | <p>There is no 'merge strategy' for resolving these conflicts.</p> <p>However, if you truly want a conflict like:</p> <pre><code><<<< ours Foo ========= Bar >>>> theirs </code></pre> <p>to resolve to</p> <pre><code>Foo Bar </code></pre> <p>then you can configure the 'merge driver'. From t... | 119, 28897 | git, git-merge | <h1>git merge, keep both</h1>
<p>For merging I use this to "keep mine"</p>
<pre><code>git merge -X ours foo
</code></pre>
<p>and this for "keep theirs"</p>
<pre><code>git merge -X theirs foo
</code></pre>
<p>However on my latest merge it looks best to keep both sides. Does Git have a "strategy" for this, to avoid m... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,575 | git | # git merge, keep both
For merging I use this to "keep mine"
```
git merge -X ours foo
```
and this for "keep theirs"
```
git merge -X theirs foo
```
However on my latest merge it looks best to keep both sides. Does Git have a "strategy" for this, to avoid manually editing the file? | There is no 'merge strategy' for resolving these conflicts.
However, if you truly want a conflict like:
```
<<<< ours
Foo
=========
Bar
>>>> theirs
```
to resolve to
```
Foo
Bar
```
then you can configure the 'merge driver'. From the [gitattributes](http://kernel.org/pub/software/scm/git/docs/gitattributes.html) ... |
32840872 | Convert merge into rebase without having to perform the merge again | 45 | 2015-09-29 09:49:01 | <p>I made a mistake: I should have used <code>git pull --rebase</code>, but I issued a simple <code>git pull</code>, merged everything and now have a merge commit at the HEAD of my branch. </p>
<p>I want to get rid of that merge commit and I thought I'd just issue a <code>git rebase -i HEAD~3</code>, move my last loca... | 16,639 | 16,784 | 2015-09-29 19:59:53 | 32,842,174 | 47 | 2015-09-29 10:59:47 | 26,396 | 2015-09-29 19:59:53 | https://stackoverflow.com/q/32840872 | https://stackoverflow.com/a/32842174 | <h3>tl;dr</h3>
<p>Even if you can include merge commits in a rebase, you can't squash merge commits. Git will let you know by saying:</p>
<blockquote>
<p>Refusing to squash a merge: <SHA-1></p>
</blockquote>
<p>What you <em>can</em> do in order to keep the changes made during the merge is to <em>convert the ... | <h3>tl;dr</h3> <p>Even if you can include merge commits in a rebase, you can't squash merge commits. Git will let you know by saying:</p> <blockquote> <p>Refusing to squash a merge: <SHA-1></p> </blockquote> <p>What you <em>can</em> do in order to keep the changes made during the merge is to <em>convert the ... | 119, 28896, 28897, 29934 | git, git-merge, git-pull, git-rebase | <h1>Convert merge into rebase without having to perform the merge again</h1>
<p>I made a mistake: I should have used <code>git pull --rebase</code>, but I issued a simple <code>git pull</code>, merged everything and now have a merge commit at the HEAD of my branch. </p>
<p>I want to get rid of that merge commit and I ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,576 | git | # Convert merge into rebase without having to perform the merge again
I made a mistake: I should have used `git pull --rebase`, but I issued a simple `git pull`, merged everything and now have a merge commit at the HEAD of my branch.
I want to get rid of that merge commit and I thought I'd just issue a `git rebase -i... | ### tl;dr
Even if you can include merge commits in a rebase, you can't squash merge commits. Git will let you know by saying:
> Refusing to squash a merge: <SHA-1>
What you *can* do in order to keep the changes made during the merge is to *convert the merge commit into a normal commit*. At that point you can squash ... |
27428441 | How to disambiguate an ambiguous abbreviated sha1 in git | 45 | 2014-12-11 17:04:11 | <p>I was intrigued by <a href="http://blog.cuviper.com/2013/11/10/how-short-can-git-abbreviate/">Josh Stone's analysis of sha1 abbreviation collisions</a>.</p>
<p>Let's say somebody wrote down an abbreviated commit id, <code>8b82547e33</code>, at a time when it was unambiguous. But since then other objects have been ... | 6,600 | 47,552 | 2022-02-26 22:41:03 | 27,428,930 | 47 | 2014-12-11 17:31:54 | 1,126,841 | 2014-12-11 17:41:28 | https://stackoverflow.com/q/27428441 | https://stackoverflow.com/a/27428930 | <p>You can use <code>git rev-parse</code>, assuming you have at least a 4-digit prefix of the full hash.</p>
<pre><code>git rev-parse --disambiguate=8b82547e33
</code></pre>
| <p>You can use <code>git rev-parse</code>, assuming you have at least a 4-digit prefix of the full hash.</p> <pre><code>git rev-parse --disambiguate=8b82547e33 </code></pre> | 119 | git | <h1>How to disambiguate an ambiguous abbreviated sha1 in git</h1>
<p>I was intrigued by <a href="http://blog.cuviper.com/2013/11/10/how-short-can-git-abbreviate/">Josh Stone's analysis of sha1 abbreviation collisions</a>.</p>
<p>Let's say somebody wrote down an abbreviated commit id, <code>8b82547e33</code>, at a time... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,577 | git | # How to disambiguate an ambiguous abbreviated sha1 in git
I was intrigued by [Josh Stone's analysis of sha1 abbreviation collisions](http://blog.cuviper.com/2013/11/10/how-short-can-git-abbreviate/).
Let's say somebody wrote down an abbreviated commit id, `8b82547e33`, at a time when it was unambiguous. But since th... | You can use `git rev-parse`, assuming you have at least a 4-digit prefix of the full hash.
```
git rev-parse --disambiguate=8b82547e33
``` |
15551409 | How to change git ssh user for a remote push temporarily? | 40 | 2013-03-21 15:17:36 | <p>Is it possible to change the ssh user temporarly for a "git push remote master" without messing up with .git/config or "git remote", or using the whole remote url? </p>
<pre><code>[root@host gitrepo]# git push otheruser@remote master # this does not work, but how great it would be
[root@host gitrepo]# USER=otheruse... | 114,942 | 773,306 | 2018-12-08 08:08:06 | 19,298,322 | 47 | 2013-10-10 14:17:30 | 1,342,413 | 2013-10-10 14:17:30 | https://stackoverflow.com/q/15551409 | https://stackoverflow.com/a/19298322 | <p>Have you tried using the whole remote URL? </p>
<pre><code>git push ssh://<temp_user>@<host>/<repo_path> <local_branch>:<remote_branch>
</code></pre>
<p>and you will be prompted to provide the password</p>
| <p>Have you tried using the whole remote URL? </p> <pre><code>git push ssh://<temp_user>@<host>/<repo_path> <local_branch>:<remote_branch> </code></pre> <p>and you will be prompted to provide the password</p> | 119, 386, 4236 | git, push, ssh | <h1>How to change git ssh user for a remote push temporarily?</h1>
<p>Is it possible to change the ssh user temporarly for a "git push remote master" without messing up with .git/config or "git remote", or using the whole remote url? </p>
<pre><code>[root@host gitrepo]# git push otheruser@remote master # this does not... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,578 | git | # How to change git ssh user for a remote push temporarily?
Is it possible to change the ssh user temporarly for a "git push remote master" without messing up with .git/config or "git remote", or using the whole remote url?
```
[root@host gitrepo]# git push otheruser@remote master # this does not work, but how great ... | Have you tried using the whole remote URL?
```
git push ssh://<temp_user>@<host>/<repo_path> <local_branch>:<remote_branch>
```
and you will be prompted to provide the password |
13235473 | Change branch parent | 39 | 2012-11-05 15:43:53 | <p>Have following branches structure:</p>
<pre><code> master
/ \
BranchA BranchB
</code></pre>
<p>But it should be:</p>
<pre><code> master
/
BranchA
/
BranchB... | 26,458 | 907,912 | 2018-08-15 21:13:28 | 13,235,534 | 47 | 2012-11-05 15:47:25 | 124,538 | 2012-11-05 15:47:25 | https://stackoverflow.com/q/13235473 | https://stackoverflow.com/a/13235534 | <p>You want to use <a href="http://git-scm.com/book/en/Git-Branching-Rebasing">rebase</a>. With BranchB checked-out, do</p>
<pre><code>git rebase BranchA
</code></pre>
| <p>You want to use <a href="http://git-scm.com/book/en/Git-Branching-Rebasing">rebase</a>. With BranchB checked-out, do</p> <pre><code>git rebase BranchA </code></pre> | 119 | git | <h1>Change branch parent</h1>
<p>Have following branches structure:</p>
<pre><code> master
/ \
BranchA BranchB
</code></pre>
<p>But it should be:</p>
<pre><code> master
/
BranchA
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,580 | git | # Change branch parent
Have following branches structure:
```
master
/ \
BranchA BranchB
```
But it should be:
```
master
/
BranchA
/
BranchB
```
Could an... | You want to use [rebase](http://git-scm.com/book/en/Git-Branching-Rebasing). With BranchB checked-out, do
```
git rebase BranchA
``` |
614229 | Can I move the .git directory for a repo to it's parent directory? | 39 | 2009-03-05 10:20:50 | <p>I have two sub-directories each with a repo, thus :</p>
<pre><code>PPP/
|--ABC/
| |--.git/
| |--AAA/
| | BBB/
| | CCC/
|
|--DEF/
| |--.git/
| |--DDD/
| |--EEE/
</code></pre>
<p>And would like to combine them into one repo, so, I would assume the directory structure would be like thi... | 13,816 | 74,159 | 2022-07-16 05:33:00 | 614,254 | 47 | 2009-03-05 10:28:34 | 38,626 | 2015-10-10 01:34:51 | https://stackoverflow.com/q/614229 | https://stackoverflow.com/a/614254 | <p>You can do what you are describing like this:</p>
<ol>
<li><p>Move the content of <code>ABC</code> to an <code>ABC/</code> subdirectory, and fix the history so that it looks like it has always been there:</p>
<pre><code>$ cd /path/to/ABC
$ git filter-branch --index-filter \
'git ls-files -s | sed "s-\t-&AB... | <p>You can do what you are describing like this:</p> <ol> <li><p>Move the content of <code>ABC</code> to an <code>ABC/</code> subdirectory, and fix the history so that it looks like it has always been there:</p> <pre><code>$ cd /path/to/ABC $ git filter-branch --index-filter \ 'git ls-files -s | sed "s-\t-&AB... | 119, 218, 717, 34708 | directory, git, merge, subdirectory | <h1>Can I move the .git directory for a repo to it's parent directory?</h1>
<p>I have two sub-directories each with a repo, thus :</p>
<pre><code>PPP/
|--ABC/
| |--.git/
| |--AAA/
| | BBB/
| | CCC/
|
|--DEF/
| |--.git/
| |--DDD/
| |--EEE/
</code></pre>
<p>And would like to combine them... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,581 | git | # Can I move the .git directory for a repo to it's parent directory?
I have two sub-directories each with a repo, thus :
```
PPP/
|--ABC/
| |--.git/
| |--AAA/
| | BBB/
| | CCC/
|
|--DEF/
| |--.git/
| |--DDD/
| |--EEE/
```
And would like to combine them into one repo, so, I would assum... | You can do what you are describing like this:
1. Move the content of `ABC` to an `ABC/` subdirectory, and fix the history so that it looks like it has always been there:
```
$ cd /path/to/ABC
$ git filter-branch --index-filter \
'git ls-files -s | sed "s-\t-&ABC/-" |
GIT_INDEX_FILE=$GIT_INDEX_... |
46174085 | Should changes in a package.json file be commited to a repository as well? | 35 | 2017-09-12 10:30:56 | <p>I am not sure that if it is correct to commit and push the changes in the package.JSON file into a repository. as far as I understood, the others in the git can install new dependencies by executing this command: npm install and accordingly, their package.JSON will be updated too.OR, this files actually says what ar... | 39,246 | 4,462,399 | 2023-01-26 08:12:50 | 46,174,137 | 47 | 2017-09-12 10:33:30 | 1,555,615 | 2023-01-26 08:12:50 | https://stackoverflow.com/q/46174085 | https://stackoverflow.com/a/46174137 | <p>You need to commit <code>package.json</code>. All other developers, after pulling the code, will just need to perform <code>npm install</code> to get the latest dependencies required for the project.</p>
<p>Whenever you or someone else wants to add new dependencies to the project you perform <code>npm install <de... | <p>You need to commit <code>package.json</code>. All other developers, after pulling the code, will just need to perform <code>npm install</code> to get the latest dependencies required for the project.</p> <p>Whenever you or someone else wants to add new dependencies to the project you perform <code>npm install <de... | 1281, 7330, 53850, 61387, 108901 | dependencies, git-commit, npm, package.json, repository | <h1>Should changes in a package.json file be commited to a repository as well?</h1>
<p>I am not sure that if it is correct to commit and push the changes in the package.JSON file into a repository. as far as I understood, the others in the git can install new dependencies by executing this command: npm install and acco... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,583 | git | # Should changes in a package.json file be commited to a repository as well?
I am not sure that if it is correct to commit and push the changes in the package.JSON file into a repository. as far as I understood, the others in the git can install new dependencies by executing this command: npm install and accordingly, ... | You need to commit `package.json`. All other developers, after pulling the code, will just need to perform `npm install` to get the latest dependencies required for the project.
Whenever you or someone else wants to add new dependencies to the project you perform `npm install <dependencyName>` or `npm install --save-d... |
14078820 | how to undo git add before commit | 35 | 2012-12-29 04:55:35 | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/348170/undo-git-add-before-commit">Undo git add before commit</a> </p>
</blockquote>
<p>When i was working on my project I accidently added files using the following command</p>
<pre><code>git add file
</code>... | 20,122 | 1,831,329 | 2012-12-29 05:11:59 | 14,078,881 | 47 | 2012-12-29 05:11:32 | 390,363 | 2012-12-29 05:11:32 | https://stackoverflow.com/q/14078820 | https://stackoverflow.com/a/14078881 | <p><code>git reset</code> is a literally "undo" of <code>git add</code> - it removes the changes from staged area.</p>
| <p><code>git reset</code> is a literally "undo" of <code>git add</code> - it removes the changes from staged area.</p> | 119, 456 | git, version-control | <h1>how to undo git add before commit</h1>
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/348170/undo-git-add-before-commit">Undo git add before commit</a> </p>
</blockquote>
<p>When i was working on my project I accidently added files using the following c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,584 | git | # how to undo git add before commit
> **Possible Duplicate:**
> [Undo git add before commit](https://stackoverflow.com/questions/348170/undo-git-add-before-commit)
When i was working on my project I accidently added files using the following command
```
git add file
```
I haven't yet run
```
git commit.
```
How... | `git reset` is a literally "undo" of `git add` - it removes the changes from staged area. |
49834016 | Where is `git add` in Visual Studio Code? | 34 | 2018-04-14 17:05:03 | <p>In Visual Studio Code, <code>Cmd-Shift-P</code> gives me the command palette. There are many Git commands listed in the palette, but the only result for "add" is "Add file to .gitignore". This is not what I want. I want the equivalent of <code>git add $CURRENT_FILE</code>. Such a command is provided, for example, by... | 31,074 | 229,792 | 2025-01-12 04:33:51 | 49,834,123 | 47 | 2018-04-14 17:17:11 | 229,792 | 2018-04-19 08:53:37 | https://stackoverflow.com/q/49834016 | https://stackoverflow.com/a/49834123 | <p>I eventually found it: the command is called <code>Git: Stage Changes</code>. Visual Studio confusingly deviates from Git terminology here. There is <a href="https://github.com/Microsoft/vscode/issues/47876" rel="noreferrer">a (sadly closed) GitHub issue regarding this problem</a>.</p>
| <p>I eventually found it: the command is called <code>Git: Stage Changes</code>. Visual Studio confusingly deviates from Git terminology here. There is <a href="https://github.com/Microsoft/vscode/issues/47876" rel="noreferrer">a (sadly closed) GitHub issue regarding this problem</a>.</p> | 119, 111608 | git, visual-studio-code | <h1>Where is `git add` in Visual Studio Code?</h1>
<p>In Visual Studio Code, <code>Cmd-Shift-P</code> gives me the command palette. There are many Git commands listed in the palette, but the only result for "add" is "Add file to .gitignore". This is not what I want. I want the equivalent of <code>git add $CURRENT_FILE<... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,585 | git | # Where is `git add` in Visual Studio Code?
In Visual Studio Code, `Cmd-Shift-P` gives me the command palette. There are many Git commands listed in the palette, but the only result for "add" is "Add file to .gitignore". This is not what I want. I want the equivalent of `git add $CURRENT_FILE`. Such a command is provi... | I eventually found it: the command is called `Git: Stage Changes`. Visual Studio confusingly deviates from Git terminology here. There is [a (sadly closed) GitHub issue regarding this problem](https://github.com/Microsoft/vscode/issues/47876). |
5165825 | Committing partial Hunks in Git | 30 | 2011-03-02 09:57:31 | <p>If I made two logical changes, which is continuous in code. Git shows it as one single hunk while adding interactively.</p>
<p>Is there a way to specifically add only few lines in a hunk, during <code>add --patch</code>?</p>
| 12,084 | 537,591 | 2011-05-02 20:15:47 | 5,165,939 | 47 | 2011-03-02 10:10:34 | 6,309 | 2011-05-02 20:15:47 | https://stackoverflow.com/q/5165825 | https://stackoverflow.com/a/5165939 | <p>The <a href="http://nuclearsquid.com/writings/git-add.html" rel="noreferrer"><code>git add --patch</code> mode</a> has option for splitting an individual hunk or editing an individual hunk.</p>
<p><a href="http://www.kernel.org/pub/software/scm/git/docs/git-add.html" rel="noreferrer"><code>git add --patch</code></a... | <p>The <a href="http://nuclearsquid.com/writings/git-add.html" rel="noreferrer"><code>git add --patch</code> mode</a> has option for splitting an individual hunk or editing an individual hunk.</p> <p><a href="http://www.kernel.org/pub/software/scm/git/docs/git-add.html" rel="noreferrer"><code>git add --patch</code></a... | 119, 21628 | git, msysgit | <h1>Committing partial Hunks in Git</h1>
<p>If I made two logical changes, which is continuous in code. Git shows it as one single hunk while adding interactively.</p>
<p>Is there a way to specifically add only few lines in a hunk, during <code>add --patch</code>?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,589 | git | # Committing partial Hunks in Git
If I made two logical changes, which is continuous in code. Git shows it as one single hunk while adding interactively.
Is there a way to specifically add only few lines in a hunk, during `add --patch`? | The [`git add --patch` mode](http://nuclearsquid.com/writings/git-add.html) has option for splitting an individual hunk or editing an individual hunk.
[`git add --patch`](http://www.kernel.org/pub/software/scm/git/docs/git-add.html):
```
s - split the current hunk into smaller hunks
e - manually edit the current hunk... |
1830701 | How do I check if a repository is bare? | 27 | 2009-12-02 04:45:18 | <p>I'm getting the warning</p>
<pre><code>warning: You did not specify any refspecs to push, and the current remote
warning: has not configured any push refspecs. The default action in this
warning: case is to push all matching refspecs, that is, all branches
warning: that exist both locally and remotely will be updat... | 19,053 | 38,765 | 2017-11-22 16:59:44 | 1,830,712 | 47 | 2009-12-02 04:49:33 | 6,309 | 2014-06-23 08:40:54 | https://stackoverflow.com/q/1830701 | https://stackoverflow.com/a/1830712 | <p>How do I check that it is bare?</p>
<p>As mentioned in the <a href="https://stackoverflow.com/a/14734826/6309">answer below</a> (upvoted) by <a href="https://stackoverflow.com/users/176841/jberryman">jberryman</a>, if you have access to the remote repo, you can run in it:</p>
<pre><code>git rev-parse --is-bare-rep... | <p>How do I check that it is bare?</p> <p>As mentioned in the <a href="https://stackoverflow.com/a/14734826/6309">answer below</a> (upvoted) by <a href="https://stackoverflow.com/users/176841/jberryman">jberryman</a>, if you have access to the remote repo, you can run in it:</p> <pre><code>git rev-parse --is-bare-rep... | 119 | git | <h1>How do I check if a repository is bare?</h1>
<p>I'm getting the warning</p>
<pre><code>warning: You did not specify any refspecs to push, and the current remote
warning: has not configured any push refspecs. The default action in this
warning: case is to push all matching refspecs, that is, all branches
warning: t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,591 | git | # How do I check if a repository is bare?
I'm getting the warning
```
warning: You did not specify any refspecs to push, and the current remote
warning: has not configured any push refspecs. The default action in this
warning: case is to push all matching refspecs, that is, all branches
warning: that exist both local... | How do I check that it is bare?
As mentioned in the [answer below](https://stackoverflow.com/a/14734826/6309) (upvoted) by [jberryman](https://stackoverflow.com/users/176841/jberryman), if you have access to the remote repo, you can run in it:
```
git rev-parse --is-bare-repository
```
It was introduced as early as ... |
29760651 | Rename a branch in git flow | 25 | 2015-04-21 00:13:46 | <p>Is it possible to rename a feature branch using git-flow?</p>
<p>I tried looking up <code>git flow help</code> and <code>git flow feature help</code>, and also the <a href="http://danielkummer.github.io/git-flow-cheatsheet/" rel="noreferrer">git-flow cheatsheet</a>, but couldn't anything.</p>
<p>Alternatively, is ... | 27,753 | 38,765 | 2021-06-26 19:44:37 | 29,761,737 | 47 | 2015-04-21 02:18:13 | 1,755,598 | 2021-06-26 19:44:37 | https://stackoverflow.com/q/29760651 | https://stackoverflow.com/a/29761737 | <p>Yep.</p>
<p>You can do it but if you pushed your branch and someone is using it you will need to update them about the change.</p>
<p><a href="https://github.com/nvie/gitflow" rel="noreferrer">gitflow</a> branches are no different then any other branch.</p>
<h2><em><strong><code>Rename local branch</code></strong></... | <p>Yep.</p> <p>You can do it but if you pushed your branch and someone is using it you will need to update them about the change.</p> <p><a href="https://github.com/nvie/gitflow" rel="noreferrer">gitflow</a> branches are no different then any other branch.</p> <h2><em><strong><code>Rename local branch</code></strong></... | 119, 1879, 64339 | branch, git, git-flow | <h1>Rename a branch in git flow</h1>
<p>Is it possible to rename a feature branch using git-flow?</p>
<p>I tried looking up <code>git flow help</code> and <code>git flow feature help</code>, and also the <a href="http://danielkummer.github.io/git-flow-cheatsheet/" rel="noreferrer">git-flow cheatsheet</a>, but couldn't... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,594 | git | # Rename a branch in git flow
Is it possible to rename a feature branch using git-flow?
I tried looking up `git flow help` and `git flow feature help`, and also the [git-flow cheatsheet](http://danielkummer.github.io/git-flow-cheatsheet/), but couldn't anything.
Alternatively, is it safe to just use `git branch -m f... | Yep.
You can do it but if you pushed your branch and someone is using it you will need to update them about the change.
[gitflow](https://github.com/nvie/gitflow) branches are no different then any other branch.
## ***`Rename local branch`***
*Git beginner* (Normal way)
```
#Checkout new branch and delete the old ... |
7022890 | How to display the tag name and branch name using git log --graph | 22 | 2011-08-11 08:25:08 | <p>I am using gitk --all to view the git log. gitk does not display the sha hash for each commit. you need to manually click on the commit to view the sha hash. I want to see the sha hash and the branch name in a single view.</p>
<p>How to display the tag-names and branch names using the git log command.</p>
| 30,629 | 579,689 | 2014-11-29 21:30:30 | 7,023,272 | 47 | 2011-08-11 08:56:55 | 6,309 | 2014-11-29 21:30:30 | https://stackoverflow.com/q/7022890 | https://stackoverflow.com/a/7023272 | <p>With <code>git log</code> (so, not gitk), you can use the decorate option (<code>%d</code>) in a pretty format, for displaying the branch name (but only for commits which are the HEAD of said branches):</p>
<pre><code>alias.lgb=log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold... | <p>With <code>git log</code> (so, not gitk), you can use the decorate option (<code>%d</code>) in a pretty format, for displaying the branch name (but only for commits which are the HEAD of said branches):</p> <pre><code>alias.lgb=log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold... | 119 | git | <h1>How to display the tag name and branch name using git log --graph</h1>
<p>I am using gitk --all to view the git log. gitk does not display the sha hash for each commit. you need to manually click on the commit to view the sha hash. I want to see the sha hash and the branch name in a single view.</p>
<p>How to disp... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,597 | git | # How to display the tag name and branch name using git log --graph
I am using gitk --all to view the git log. gitk does not display the sha hash for each commit. you need to manually click on the commit to view the sha hash. I want to see the sha hash and the branch name in a single view.
How to display the tag-name... | With `git log` (so, not gitk), you can use the decorate option (`%d`) in a pretty format, for displaying the branch name (but only for commits which are the HEAD of said branches):
```
alias.lgb=log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset%n' --abbrev-commi... |
31854476 | How to copy local changes from one pc to another using git | 21 | 2015-08-06 11:23:08 | <p>I'm using Git and sometimes i start my work on my local desktop and i want to copy these open works to my laptop to finish it at home. </p>
<p>To keep my repository clean, i don't want to push these changes to some branch because my work may be unfinished, untested an so on...</p>
| 13,309 | 1,957,580 | 2024-04-02 08:36:59 | 31,854,676 | 47 | 2015-08-06 11:32:35 | 1,957,580 | 2024-04-02 08:36:59 | https://stackoverflow.com/q/31854476 | https://stackoverflow.com/a/31854676 | <p>This is my workflow to copy my changes from one PC to another:</p>
<p>Stash your changes with:</p>
<pre><code>git stash save myWork
</code></pre>
<p>Save stash to file with:</p>
<pre><code>git stash show -p > myWork.txt
</code></pre>
<p>Move (using email etc) generated file (myWork.txt) to other PC. Patch new PC... | <p>This is my workflow to copy my changes from one PC to another:</p> <p>Stash your changes with:</p> <pre><code>git stash save myWork </code></pre> <p>Save stash to file with:</p> <pre><code>git stash show -p > myWork.txt </code></pre> <p>Move (using email etc) generated file (myWork.txt) to other PC. Patch new PC... | 119 | git | <h1>How to copy local changes from one pc to another using git</h1>
<p>I'm using Git and sometimes i start my work on my local desktop and i want to copy these open works to my laptop to finish it at home. </p>
<p>To keep my repository clean, i don't want to push these changes to some branch because my work may be unf... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,599 | git | # How to copy local changes from one pc to another using git
I'm using Git and sometimes i start my work on my local desktop and i want to copy these open works to my laptop to finish it at home.
To keep my repository clean, i don't want to push these changes to some branch because my work may be unfinished, untested... | This is my workflow to copy my changes from one PC to another:
Stash your changes with:
```
git stash save myWork
```
Save stash to file with:
```
git stash show -p > myWork.txt
```
Move (using email etc) generated file (myWork.txt) to other PC. Patch new PC with:
```
git apply myWork.txt
```
Clear all Stash on... |
30983500 | How to save changes when in detached-head state? | 20 | 2015-06-22 15:08:07 | <p>Working with Git, I had to go back to a specific commit. I made some changes and I now want to commit them. What is a proper way of doing this? </p>
<p>My project is now in detached-HEAD state. Will my changes be saved if I make a commit with</p>
<pre><code>git commit
</code></pre>
<p>? Otherwise, what should I d... | 14,944 | 2,659,898 | 2020-02-24 00:45:26 | 30,984,337 | 47 | 2015-06-22 15:47:33 | 28,411 | 2017-12-05 10:28:42 | https://stackoverflow.com/q/30983500 | https://stackoverflow.com/a/30984337 | <p><i>Disclaimer: git isn't complicated, it's just versatile. Don't be scared off just because I've rambled into a long answer :)</i></p>
<p>You had:<br>
<code>master: a-b-c-d-e-f</code></p>
<p>and wanted to change <code>c</code>. You did:<br>
* <code>git checkout c</code> (avoid checking out commits in future. Mov... | <p><i>Disclaimer: git isn't complicated, it's just versatile. Don't be scared off just because I've rambled into a long answer :)</i></p> <p>You had:<br> <code>master: a-b-c-d-e-f</code></p> <p>and wanted to change <code>c</code>. You did:<br> * <code>git checkout c</code> (avoid checking out commits in future. Mov... | 119, 53850, 98582 | git, git-commit, git-detached-head | <h1>How to save changes when in detached-head state?</h1>
<p>Working with Git, I had to go back to a specific commit. I made some changes and I now want to commit them. What is a proper way of doing this? </p>
<p>My project is now in detached-HEAD state. Will my changes be saved if I make a commit with</p>
<pre><code... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,600 | git | # How to save changes when in detached-head state?
Working with Git, I had to go back to a specific commit. I made some changes and I now want to commit them. What is a proper way of doing this?
My project is now in detached-HEAD state. Will my changes be saved if I make a commit with
```
git commit
```
? Otherwise... | *Disclaimer: git isn't complicated, it's just versatile. Don't be scared off just because I've rambled into a long answer :)*
You had:
`master: a-b-c-d-e-f`
and wanted to change `c`. You did:
* `git checkout c` (avoid checking out commits in future. Move the branch head instead)
* *changed some files*
You are ... |
50302430 | How to squash 7 pushed commits into one in to 1 in git? | 14 | 2018-05-12 02:51:58 | <p>I have tried multiple ways to squash my remote repo commits but didnt get it right. I want to squash them all and make it one . Below is the list of commits. Below is the summary of my pull request to upstream (which lists 7 commits). I want to list only one instead of 7.</p>
<p><a href="https://i.sstatic.net/eqcyI... | 34,826 | 7,134,739 | 2018-05-12 05:17:43 | 50,302,458 | 47 | 2018-05-12 03:00:07 | 5,958,455 | 2018-05-12 03:05:27 | https://stackoverflow.com/q/50302430 | https://stackoverflow.com/a/50302458 | <pre><code>git reset --soft HEAD~7
git add --all
git commit
git push --force
</code></pre>
<p>First, reset git index to before the commits you want to squash. Use <code>--soft</code> so that git only resets the index and doesn't touch your working directory. Then create a commit as usual.</p>
| <pre><code>git reset --soft HEAD~7 git add --all git commit git push --force </code></pre> <p>First, reset git index to before the commits you want to squash. Use <code>--soft</code> so that git only resets the index and doesn't touch your working directory. Then create a commit as usual.</p> | 119, 29934, 98455 | git, git-rebase, git-squash | <h1>How to squash 7 pushed commits into one in to 1 in git?</h1>
<p>I have tried multiple ways to squash my remote repo commits but didnt get it right. I want to squash them all and make it one . Below is the list of commits. Below is the summary of my pull request to upstream (which lists 7 commits). I want to list on... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,601 | git | # How to squash 7 pushed commits into one in to 1 in git?
I have tried multiple ways to squash my remote repo commits but didnt get it right. I want to squash them all and make it one . Below is the list of commits. Below is the summary of my pull request to upstream (which lists 7 commits). I want to list only one in... | ```
git reset --soft HEAD~7
git add --all
git commit
git push --force
```
First, reset git index to before the commits you want to squash. Use `--soft` so that git only resets the index and doesn't touch your working directory. Then create a commit as usual. |
38658458 | Git ignore doesn't ignore the specified folders/files | 14 | 2016-07-29 12:07:40 | <p>I want my .gitignore to ignore certain folders and files so I came up with the following:</p>
<pre><code>*.class
# usual java ignores
bin/
.metadata
# Maven
*/target/*
target/*
/target/
*/deploy/*
deploy/*
# src-gen folder is populated by the command of protobuf, these files should not be pushed
src-gen/*
# ecl... | 18,451 | 6,533,075 | 2022-07-13 12:26:57 | 38,658,666 | 47 | 2016-07-29 12:18:02 | 4,265,352 | 2016-07-29 12:18:02 | https://stackoverflow.com/q/38658458 | https://stackoverflow.com/a/38658666 | <p><em>"I cannot see anything to be deleted"</em> -- you just told <code>git</code> to ignore some files; now you expect it to delete them?</p>
<p><code>.gitignore</code> is used only for files that are not already tracked (i.e when new files are added to the repository). If the file is already in the repository and y... | <p><em>"I cannot see anything to be deleted"</em> -- you just told <code>git</code> to ignore some files; now you expect it to delete them?</p> <p><code>.gitignore</code> is used only for files that are not already tracked (i.e when new files are added to the repository). If the file is already in the repository and y... | 119, 25056 | git, gitignore | <h1>Git ignore doesn't ignore the specified folders/files</h1>
<p>I want my .gitignore to ignore certain folders and files so I came up with the following:</p>
<pre><code>*.class
# usual java ignores
bin/
.metadata
# Maven
*/target/*
target/*
/target/
*/deploy/*
deploy/*
# src-gen folder is populated by the command... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,602 | git | # Git ignore doesn't ignore the specified folders/files
I want my .gitignore to ignore certain folders and files so I came up with the following:
```
*.class
# usual java ignores
bin/
.metadata
# Maven
*/target/*
target/*
/target/
*/deploy/*
deploy/*
# src-gen folder is populated by the command of protobuf, these ... | *"I cannot see anything to be deleted"* -- you just told `git` to ignore some files; now you expect it to delete them?
`.gitignore` is used only for files that are not already tracked (i.e when new files are added to the repository). If the file is already in the repository and you want `git` to ignore it then you hav... |
36479201 | Stuck at fetch due to authentication issue | 8 | 2016-04-07 14:26:04 | <p>I have a Jenkins (2.0 Beta-2) server running on Windows 2012 R2 x64, with a new build configured to get source files from TFS GIT (2013). I have already installed the Git for Windows version provided by Microsoft - the one that claims to solve the authentication issue between GIT CLI and TFS GIT.</p>
<p>My .gitconf... | 24,340 | 1,348,349 | 2018-02-14 05:37:34 | 37,753,202 | 47 | 2016-06-10 16:36:00 | 466,874 | 2016-06-10 16:36:00 | https://stackoverflow.com/q/36479201 | https://stackoverflow.com/a/37753202 | <p>For us, unsetting the "credential.helper" git config variable entirely was the answer. Our jobs were hanging at the exact same spot after upgrading from Git 2.5.0 to 2.8.4, and our Jenkins service is running as Local System, so doing the following unset the variable:</p>
<pre><code>git config --global --unset crede... | <p>For us, unsetting the "credential.helper" git config variable entirely was the answer. Our jobs were hanging at the exact same spot after upgrading from Git 2.5.0 to 2.8.4, and our Jenkins service is running as Local System, so doing the following unset the variable:</p> <pre><code>git config --global --unset crede... | 119, 733, 64999 | git, jenkins, tfs | <h1>Stuck at fetch due to authentication issue</h1>
<p>I have a Jenkins (2.0 Beta-2) server running on Windows 2012 R2 x64, with a new build configured to get source files from TFS GIT (2013). I have already installed the Git for Windows version provided by Microsoft - the one that claims to solve the authentication is... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,603 | git | # Stuck at fetch due to authentication issue
I have a Jenkins (2.0 Beta-2) server running on Windows 2012 R2 x64, with a new build configured to get source files from TFS GIT (2013). I have already installed the Git for Windows version provided by Microsoft - the one that claims to solve the authentication issue betwe... | For us, unsetting the "credential.helper" git config variable entirely was the answer. Our jobs were hanging at the exact same spot after upgrading from Git 2.5.0 to 2.8.4, and our Jenkins service is running as Local System, so doing the following unset the variable:
```
git config --global --unset credential.helper
g... |
5600659 | Rebasing a branch including all its children | 101 | 2011-04-08 20:52:33 | <p>I have the following Git repository topology:</p>
<pre><code>A-B-F (master)
\ D (feature-a)
\ /
C (feature)
\
E (feature-b)
</code></pre>
<p>By rebasing <code>feature</code> branch I expected to rebase the whole subtree (including child branches):</p>
<pre><code>$ git rebase feature mas... | 15,407 | 605,744 | 2021-09-30 17:39:52 | 5,632,027 | 46 | 2011-04-12 07:52:03 | 1,864,976 | 2020-11-24 21:55:37 | https://stackoverflow.com/q/5600659 | https://stackoverflow.com/a/5632027 | <pre><code>git branch --format='%(refname:short)' --contains C | \
xargs -n 1 \
git rebase --committer-date-is-author-date --onto F C^
</code></pre>
| <pre><code>git branch --format='%(refname:short)' --contains C | \ xargs -n 1 \ git rebase --committer-date-is-author-date --onto F C^ </code></pre> | 119, 456, 1879, 8974, 29934 | branch, git, git-rebase, rebase, version-control | <h1>Rebasing a branch including all its children</h1>
<p>I have the following Git repository topology:</p>
<pre><code>A-B-F (master)
\ D (feature-a)
\ /
C (feature)
\
E (feature-b)
</code></pre>
<p>By rebasing <code>feature</code> branch I expected to rebase the whole subtree (including chi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,604 | git | # Rebasing a branch including all its children
I have the following Git repository topology:
```
A-B-F (master)
\ D (feature-a)
\ /
C (feature)
\
E (feature-b)
```
By rebasing `feature` branch I expected to rebase the whole subtree (including child branches):
```
$ git rebase feature mast... | ```
git branch --format='%(refname:short)' --contains C | \
xargs -n 1 \
git rebase --committer-date-is-author-date --onto F C^
``` |
28551556 | Git: remove leading plus/minus from lines in diff | 84 | 2015-02-16 22:33:03 | <p>I'd like to remove the leading plus/minus symbols from each line in <code>git diff</code>. My reasons:</p>
<ol>
<li>Lines that are exactly 80 chars will overflow by a single character, which just looks plain awkward</li>
<li>The coloring is enough for me to distinguish between additions/deletions</li>
<li>I'd prefer... | 22,889 | 560,642 | 2025-09-17 16:47:28 | 28,551,750 | 46 | 2015-02-16 22:52:50 | 1,062,250 | 2015-02-16 23:16:01 | https://stackoverflow.com/q/28551556 | https://stackoverflow.com/a/28551750 | <p>One option is to use <code>sed</code> to remove the undesired character from diff, while preserving the color:</p>
<pre><code>git diff --color | sed -r "s/^([^-+ ]*)[-+ ]/\\1/" | less -r
</code></pre>
<p>(Note that you need to remove the leading space as well, as it is emitted by diff.)</p>
| <p>One option is to use <code>sed</code> to remove the undesired character from diff, while preserving the color:</p> <pre><code>git diff --color | sed -r "s/^([^-+ ]*)[-+ ]/\\1/" | less -r </code></pre> <p>(Note that you need to remove the leading space as well, as it is emitted by diff.)</p> | 119, 9033 | git, git-diff | <h1>Git: remove leading plus/minus from lines in diff</h1>
<p>I'd like to remove the leading plus/minus symbols from each line in <code>git diff</code>. My reasons:</p>
<ol>
<li>Lines that are exactly 80 chars will overflow by a single character, which just looks plain awkward</li>
<li>The coloring is enough for me to ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,605 | git | # Git: remove leading plus/minus from lines in diff
I'd like to remove the leading plus/minus symbols from each line in `git diff`. My reasons:
1. Lines that are exactly 80 chars will overflow by a single character, which just looks plain awkward
2. The coloring is enough for me to distinguish between additions/delet... | One option is to use `sed` to remove the undesired character from diff, while preserving the color:
```
git diff --color | sed -r "s/^([^-+ ]*)[-+ ]/\\1/" | less -r
```
(Note that you need to remove the leading space as well, as it is emitted by diff.) |
48075169 | Semantic commit type when remove something | 61 | 2018-01-03 10:05:18 | <p>What semantic commit type is better to use, when I remove a feature: <code>feat</code>, <code>refactor</code> or something else?</p>
| 36,611 | 1,156,518 | 2024-12-25 09:02:40 | 50,558,904 | 46 | 2018-05-28 03:55:43 | 2,227,031 | 2018-05-28 03:55:43 | https://stackoverflow.com/q/48075169 | https://stackoverflow.com/a/50558904 | <p>you should use <code>refactor</code>, </p>
<ul>
<li>feat: introduces a new feature to the codebase</li>
<li>fix: patches a bug in your codebase</li>
<li>refactor: A code change that neither fixes a bug nor adds a feature</li>
</ul>
<p>you can refer to <a href="https://github.com/angular/angular/blob/master/CONTRIB... | <p>you should use <code>refactor</code>, </p> <ul> <li>feat: introduces a new feature to the codebase</li> <li>fix: patches a bug in your codebase</li> <li>refactor: A code change that neither fixes a bug nor adds a feature</li> </ul> <p>you can refer to <a href="https://github.com/angular/angular/blob/master/CONTRIB... | 5597, 53850, 143939 | commit, conventional-commits, git-commit | <h1>Semantic commit type when remove something</h1>
<p>What semantic commit type is better to use, when I remove a feature: <code>feat</code>, <code>refactor</code> or something else?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,608 | git | # Semantic commit type when remove something
What semantic commit type is better to use, when I remove a feature: `feat`, `refactor` or something else? | you should use `refactor`,
- feat: introduces a new feature to the codebase
- fix: patches a bug in your codebase
- refactor: A code change that neither fixes a bug nor adds a feature
you can refer to [angular/CONTRIBUTING Commit Message Guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#type) |
5002555 | Can a lightweight tag be converted to an annotated tag? | 57 | 2011-02-15 10:34:25 | <p>I've tagged a commit with a lightweight tag, and pushed that tag to a remote repo, shared with other developers. I have now realised I should have annotated it so that it appears in <code>git describe</code>.</p>
<p>Is there a way to convert it/re-tag the commit without breaking things?</p>
| 13,842 | 100,172 | 2017-04-18 18:40:40 | 5,002,886 | 46 | 2011-02-15 11:11:35 | 19,563 | 2016-05-20 23:46:53 | https://stackoverflow.com/q/5002555 | https://stackoverflow.com/a/5002886 | <p>A lightweight tag is just a 'ref' that points at that commit. You can force-create a new annotated tag on top of the old tag:</p>
<pre><code>git tag -a -f <tagname> <tagname>
</code></pre>
<p>As of Git v1.8.2, you need to use <code>--force</code> to replace any tags on a remote with <code>git push</cod... | <p>A lightweight tag is just a 'ref' that points at that commit. You can force-create a new annotated tag on top of the old tag:</p> <pre><code>git tag -a -f <tagname> <tagname> </code></pre> <p>As of Git v1.8.2, you need to use <code>--force</code> to replace any tags on a remote with <code>git push</cod... | 115, 119, 60718 | git, git-tag, tags | <h1>Can a lightweight tag be converted to an annotated tag?</h1>
<p>I've tagged a commit with a lightweight tag, and pushed that tag to a remote repo, shared with other developers. I have now realised I should have annotated it so that it appears in <code>git describe</code>.</p>
<p>Is there a way to convert it/re-tag... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,609 | git | # Can a lightweight tag be converted to an annotated tag?
I've tagged a commit with a lightweight tag, and pushed that tag to a remote repo, shared with other developers. I have now realised I should have annotated it so that it appears in `git describe`.
Is there a way to convert it/re-tag the commit without breakin... | A lightweight tag is just a 'ref' that points at that commit. You can force-create a new annotated tag on top of the old tag:
```
git tag -a -f <tagname> <tagname>
```
As of Git v1.8.2, you need to use `--force` to replace any tags on a remote with `git push`, even if you are replacing a lightweight tag with somethin... |
43027919 | Bitbucket repository started returning "remote: Too many invalid password attempts. Try logging in through the website." (403) since yesterday | 56 | 2017-03-26 11:04:35 | <p>Since yesterday, bitbucket repository started returning this on any request:</p>
<pre><code>remote: Too many invalid password attempts. Try logging in through the website.
fatal: unable to access 'https://xxxxxxxxx@bitbucket.org/xxxxxxxxxx/xxxxxxxxxxx.git/': The requested URL returned error: 403
</code></pre>
<p>T... | 32,514 | 3,699,126 | 2022-07-23 10:15:41 | 43,073,251 | 46 | 2017-03-28 15:08:25 | 3,251,800 | 2017-12-12 12:32:43 | https://stackoverflow.com/q/43027919 | https://stackoverflow.com/a/43073251 | <p>The reason for getting the above error is due to <strong>Atlassion account lock</strong> & not related with <strong>App passwords</strong>.</p>
<p>So I have reset my Atlassian account(as per Atlassian's servicedesk suggession ) using below url</p>
<p><a href="https://id.atlassian.com/login/resetpassword" rel="... | <p>The reason for getting the above error is due to <strong>Atlassion account lock</strong> & not related with <strong>App passwords</strong>.</p> <p>So I have reset my Atlassian account(as per Atlassian's servicedesk suggession ) using below url</p> <p><a href="https://id.atlassian.com/login/resetpassword" rel="... | 119, 8337, 90056 | atlassian-sourcetree, bitbucket, git | <h1>Bitbucket repository started returning "remote: Too many invalid password attempts. Try logging in through the website." (403) since yesterday</h1>
<p>Since yesterday, bitbucket repository started returning this on any request:</p>
<pre><code>remote: Too many invalid password attempts. Try logging in through the we... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,610 | git | # Bitbucket repository started returning "remote: Too many invalid password attempts. Try logging in through the website." (403) since yesterday
Since yesterday, bitbucket repository started returning this on any request:
```
remote: Too many invalid password attempts. Try logging in through the website.
fatal: una... | The reason for getting the above error is due to **Atlassion account lock** & not related with **App passwords**.
So I have reset my Atlassian account(as per Atlassian's servicedesk suggession ) using below url
[https://id.atlassian.com/](https://id.atlassian.com/login/resetpassword)
So now `git fetch` is working fi... |
1974181 | Can't add git submodule when specified as a relative path | 50 | 2009-12-29 11:33:07 | <p>I'm trying to add a submodule to my git repo, and I'm getting this error in return: </p>
<pre><code>remote origin does not have a url defined in .git/config
</code></pre>
<p>any ideas about what this might be? I tried googling for it but only one vague link comes up.</p>
<p>I'm doing this: </p>
<pre><code>git ... | 55,892 | 51,923 | 2023-06-22 19:53:29 | 1,974,381 | 46 | 2009-12-29 12:23:35 | 6,309 | 2023-06-22 19:53:29 | https://stackoverflow.com/q/1974181 | https://stackoverflow.com/a/1974381 | <p>Does <code>../extern/Lib1</code> refer to a Git repository?<br />
If it does not, Git wouldn't know how to have the Git repo URL to its <code>.gitmodule</code><br />
Also, try:</p>
<ul>
<li>with the destination <code>lib</code> <em>not</em> already existing (even empty)</li>
<li>with an absolute path instead of a re... | <p>Does <code>../extern/Lib1</code> refer to a Git repository?<br /> If it does not, Git wouldn't know how to have the Git repo URL to its <code>.gitmodule</code><br /> Also, try:</p> <ul> <li>with the destination <code>lib</code> <em>not</em> already existing (even empty)</li> <li>with an absolute path instead of a re... | 119, 41612 | git, git-submodules | <h1>Can't add git submodule when specified as a relative path</h1>
<p>I'm trying to add a submodule to my git repo, and I'm getting this error in return: </p>
<pre><code>remote origin does not have a url defined in .git/config
</code></pre>
<p>any ideas about what this might be? I tried googling for it but only one ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,612 | git | # Can't add git submodule when specified as a relative path
I'm trying to add a submodule to my git repo, and I'm getting this error in return:
```
remote origin does not have a url defined in .git/config
```
any ideas about what this might be? I tried googling for it but only one vague link comes up.
I'm doing thi... | Does `../extern/Lib1` refer to a Git repository?
If it does not, Git wouldn't know how to have the Git repo URL to its `.gitmodule`
Also, try:
- with the destination `lib` *not* already existing (even empty)
- with an absolute path instead of a relative path (you can use a relative one, but just in case, it is wor... |
59061816 | git forces refresh index after switching between Windows and Linux | 48 | 2019-11-27 01:38:43 | <p>I have a disk partition (format: NTFS) shared by Windows and Linux. It contains a git repository (about 6.7 GB).
If I <strong>only use Windows</strong> or <strong>only use Linux</strong> to manipulate the git repository everything is okay.
But everytime I switch the system, the <code>git status</code> command will r... | 24,559 | 3,601,654 | 2024-04-22 11:28:26 | 59,061,985 | 46 | 2019-11-27 02:03:05 | 1,256,452 | 2019-11-27 02:03:05 | https://stackoverflow.com/q/59061816 | https://stackoverflow.com/a/59061985 | <p>You are completely correct here:</p>
<ul>
<li><p>The thing you're using here, which Git variously calls the <em>index</em>, the <em>staging area</em>, or the <em>cache</em>, does in fact contain cache data.</p></li>
<li><p>The cache data that it contains is the result of system calls.</p></li>
<li><p>The system cal... | <p>You are completely correct here:</p> <ul> <li><p>The thing you're using here, which Git variously calls the <em>index</em>, the <em>staging area</em>, or the <em>cache</em>, does in fact contain cache data.</p></li> <li><p>The cache data that it contains is the result of system calls.</p></li> <li><p>The system cal... | 58, 64, 119, 1592, 68400 | git, git-index, interop, linux, windows | <h1>git forces refresh index after switching between Windows and Linux</h1>
<p>I have a disk partition (format: NTFS) shared by Windows and Linux. It contains a git repository (about 6.7 GB).
If I <strong>only use Windows</strong> or <strong>only use Linux</strong> to manipulate the git repository everything is okay.
B... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,613 | git | # git forces refresh index after switching between Windows and Linux
I have a disk partition (format: NTFS) shared by Windows and Linux. It contains a git repository (about 6.7 GB).
If I **only use Windows** or **only use Linux** to manipulate the git repository everything is okay.
But everytime I switch the system, t... | You are completely correct here:
- The thing you're using here, which Git variously calls the *index*, the *staging area*, or the *cache*, does in fact contain cache data.
- The cache data that it contains is the result of system calls.
- The system call data returned by a Linux system is *different* from the system c... |
12742263 | git svn - Can I use git and svn at the same time? no need interaction between git and svn | 44 | 2012-10-05 08:19:06 | <p>I am doing a development project.</p>
<p>The company is using <code>SVN</code>, so for main <code>commit</code> and <code>checkout</code> should be done via <code>SVN</code>.</p>
<p>However, I don't like <code>SVN</code> and am a <code>git</code> user. Since only when I think my code is good I will commit to the c... | 13,183 | 759,076 | 2012-10-05 14:00:01 | 12,742,386 | 46 | 2012-10-05 08:27:41 | 229,602 | 2012-10-05 14:00:01 | https://stackoverflow.com/q/12742263 | https://stackoverflow.com/a/12742386 | <p>You can clone a subversion repository to your machine using <code>git svn clone <SVN repo URL></code>. The code will be available as a git repository. You can do your work there and make local commits as you please. There is a command line option to get a "shallow" checkout rather than the entire repository wh... | <p>You can clone a subversion repository to your machine using <code>git svn clone <SVN repo URL></code>. The code will be available as a git repository. You can do your work there and make local commits as you please. There is a command line option to get a "shallow" checkout rather than the entire repository wh... | 63, 119 | git, svn | <h1>git svn - Can I use git and svn at the same time? no need interaction between git and svn</h1>
<p>I am doing a development project.</p>
<p>The company is using <code>SVN</code>, so for main <code>commit</code> and <code>checkout</code> should be done via <code>SVN</code>.</p>
<p>However, I don't like <code>SVN</c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,615 | git | # git svn - Can I use git and svn at the same time? no need interaction between git and svn
I am doing a development project.
The company is using `SVN`, so for main `commit` and `checkout` should be done via `SVN`.
However, I don't like `SVN` and am a `git` user. Since only when I think my code is good I will commi... | You can clone a subversion repository to your machine using `git svn clone <SVN repo URL>`. The code will be available as a git repository. You can do your work there and make local commits as you please. There is a command line option to get a "shallow" checkout rather than the entire repository which is often useful.... |
10022722 | Difference between git-log and git-whatchanged? | 43 | 2012-04-05 04:31:53 | <ol>
<li>Given <a href="https://stackoverflow.com/a/280140/10608">this answer</a> to another question, and</li>
<li>given that the man pages for both <a href="http://linux.die.net/man/1/git-log" rel="noreferrer">git-log</a> and <a href="http://linux.die.net/man/1/git-whatchanged" rel="noreferrer">git-whatchanged</a> sa... | 18,626 | 10,608 | 2025-09-01 10:00:48 | 18,585,297 | 46 | 2013-09-03 06:11:33 | 6,309 | 2020-06-12 15:05:21 | https://stackoverflow.com/q/10022722 | https://stackoverflow.com/a/18585297 | <p>The <a href="https://github.com/git/git/commit/52f425e1a9ab8b0ae572d06fe2a1b428f741ef4a" rel="noreferrer">commit 52f425e1</a> (August, 30th 2013) mentions:</p>
<blockquote>
<p><strong>Encourage new users to use '<code>log</code>' instead. These days, these commands are unified and just have different defaults</s... | <p>The <a href="https://github.com/git/git/commit/52f425e1a9ab8b0ae572d06fe2a1b428f741ef4a" rel="noreferrer">commit 52f425e1</a> (August, 30th 2013) mentions:</p> <blockquote> <p><strong>Encourage new users to use '<code>log</code>' instead. These days, these commands are unified and just have different defaults</s... | 119, 47913 | git, git-log | <h1>Difference between git-log and git-whatchanged?</h1>
<ol>
<li>Given <a href="https://stackoverflow.com/a/280140/10608">this answer</a> to another question, and</li>
<li>given that the man pages for both <a href="http://linux.die.net/man/1/git-log" rel="noreferrer">git-log</a> and <a href="http://linux.die.net/man/1... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,616 | git | # Difference between git-log and git-whatchanged?
1. Given [this answer](https://stackoverflow.com/a/280140/10608) to another question, and
2. given that the man pages for both [git-log](http://linux.die.net/man/1/git-log) and [git-whatchanged](http://linux.die.net/man/1/git-whatchanged) say they pull from [git-rev-li... | The [commit 52f425e1](https://github.com/git/git/commit/52f425e1a9ab8b0ae572d06fe2a1b428f741ef4a) (August, 30th 2013) mentions:
> **Encourage new users to use '`log`' instead. These days, these commands are unified and just have different defaults**.
>
> '`git log`' only allowed you to view the log messages and no dif... |
7541040 | Is "refs/heads/master" same as "refs/remotes/origin/master" in Git? | 43 | 2011-09-24 18:30:13 | <p>The question is simple: is <code>refs/heads/master</code> the same thing as <code>refs/remotes/origin/master</code>? If it is not in some cases, how can I know when it is not and what it is then?</p>
| 51,543 | 283,055 | 2022-09-16 10:45:09 | 7,541,076 | 46 | 2011-09-24 18:36:04 | 479,989 | 2011-09-24 18:36:04 | https://stackoverflow.com/q/7541040 | https://stackoverflow.com/a/7541076 | <p>They are two different symbolic names that can point to different things. <code>refs/heads/master</code> is a branch in your working copy named <code>master</code>. Frequently that is a tracking branch of <code>refs/remotes/origin/master</code> because <code>origin</code> is the default name for the remote created... | <p>They are two different symbolic names that can point to different things. <code>refs/heads/master</code> is a branch in your working copy named <code>master</code>. Frequently that is a tracking branch of <code>refs/remotes/origin/master</code> because <code>origin</code> is the default name for the remote created... | 119 | git | <h1>Is "refs/heads/master" same as "refs/remotes/origin/master" in Git?</h1>
<p>The question is simple: is <code>refs/heads/master</code> the same thing as <code>refs/remotes/origin/master</code>? If it is not in some cases, how can I know when it is not and what it is then?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,617 | git | # Is "refs/heads/master" same as "refs/remotes/origin/master" in Git?
The question is simple: is `refs/heads/master` the same thing as `refs/remotes/origin/master`? If it is not in some cases, how can I know when it is not and what it is then? | They are two different symbolic names that can point to different things. `refs/heads/master` is a branch in your working copy named `master`. Frequently that is a tracking branch of `refs/remotes/origin/master` because `origin` is the default name for the remote created by `git clone` and its primary branch is usually... |
20815006 | Retrieve lost HEAD branch in git | 42 | 2013-12-28 13:17:26 | <p>I have a really simple Git project, with just a Master branch and no origins.</p>
<p>Somewhere along the line I accidentally created a detached HEAD in my project, and then after making a bunch of commits on that detached <code>HEAD</code>, tried to merge it back into my <code>Master</code> branch. I was doing this... | 19,926 | 914,543 | 2024-01-11 16:33:25 | 20,815,310 | 46 | 2013-12-28 13:50:23 | 6,309 | 2013-12-28 13:50:23 | https://stackoverflow.com/q/20815006 | https://stackoverflow.com/a/20815310 | <blockquote>
<p>I can't find it anywhere in SourceTree</p>
</blockquote>
<p>Go back to the command-line interface and do a <a href="http://git-scm.com/docs/git-reflog" rel="noreferrer">git reflog</a>.<br />
You should be able to find back the SHA1 of your HEAD in that log.</p>
<p>Note that you wouldn't have needed to &... | <blockquote> <p>I can't find it anywhere in SourceTree</p> </blockquote> <p>Go back to the command-line interface and do a <a href="http://git-scm.com/docs/git-reflog" rel="noreferrer">git reflog</a>.<br /> You should be able to find back the SHA1 of your HEAD in that log.</p> <p>Note that you wouldn't have needed to &... | 119, 456, 717 | git, merge, version-control | <h1>Retrieve lost HEAD branch in git</h1>
<p>I have a really simple Git project, with just a Master branch and no origins.</p>
<p>Somewhere along the line I accidentally created a detached HEAD in my project, and then after making a bunch of commits on that detached <code>HEAD</code>, tried to merge it back into my <c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,618 | git | # Retrieve lost HEAD branch in git
I have a really simple Git project, with just a Master branch and no origins.
Somewhere along the line I accidentally created a detached HEAD in my project, and then after making a bunch of commits on that detached `HEAD`, tried to merge it back into my `Master` branch. I was doing ... | > I can't find it anywhere in SourceTree
Go back to the command-line interface and do a [git reflog](http://git-scm.com/docs/git-reflog).
You should be able to find back the SHA1 of your HEAD in that log.
Note that you wouldn't have needed to "merge" your detached HEAD branch back to master.
You simply could have ... |
4142936 | git clone from local to remote | 41 | 2010-11-10 09:27:48 | <p>We're in the process of migrating from Mercurial to Git for our workflow and I have two minor issues.</p>
<p>First, is it possible to "clone" a local repository directly into an empty remote (ssh) dir?</p>
<p>Currently when we create a new website we basically clone our CMS locally, configure it and then we clone ... | 55,800 | 396,682 | 2016-07-22 11:35:13 | 4,143,042 | 46 | 2010-11-10 09:40:15 | 501,250 | 2016-01-07 16:11:08 | https://stackoverflow.com/q/4142936 | https://stackoverflow.com/a/4143042 | <p>To answer your first question, yes, you can. Suppose the remote directory is <code>ssh://user@host/home/user/repo</code>. This must be a git repository, create that with <code>git init --bare</code> or <code>scp</code> your local <code>repo.git</code> (can be created with <code>git clone</code>) directory to remote... | <p>To answer your first question, yes, you can. Suppose the remote directory is <code>ssh://user@host/home/user/repo</code>. This must be a git repository, create that with <code>git init --bare</code> or <code>scp</code> your local <code>repo.git</code> (can be created with <code>git clone</code>) directory to remote... | 119, 190, 386, 18556 | deployment, git, remote-server, ssh | <h1>git clone from local to remote</h1>
<p>We're in the process of migrating from Mercurial to Git for our workflow and I have two minor issues.</p>
<p>First, is it possible to "clone" a local repository directly into an empty remote (ssh) dir?</p>
<p>Currently when we create a new website we basically clone our CMS ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,619 | git | # git clone from local to remote
We're in the process of migrating from Mercurial to Git for our workflow and I have two minor issues.
First, is it possible to "clone" a local repository directly into an empty remote (ssh) dir?
Currently when we create a new website we basically clone our CMS locally, configure it a... | To answer your first question, yes, you can. Suppose the remote directory is `ssh://user@host/home/user/repo`. This must be a git repository, create that with `git init --bare` or `scp` your local `repo.git` (can be created with `git clone`) directory to remote. Then do:
```
git remote add origin ssh://user@host/home/... |
42568138 | Git rebase with renamed files | 40 | 2017-03-02 23:49:46 | <p>I've got a branch that renames many files, and I'm trying to rebase it onto <code>master</code> where the original files have been modified (preferably without this devolving into a manual conflict-resolution nightmare).</p>
<h2>Situation</h2>
<ol>
<li><p>I've been porting a JavaScript project to TypeScript, in my... | 23,239 | 1,033,426 | 2020-08-30 17:34:47 | 42,568,589 | 46 | 2017-03-03 00:38:10 | 1,033,426 | 2017-03-03 07:16:01 | https://stackoverflow.com/q/42568138 | https://stackoverflow.com/a/42568589 | <h2>You can rebase your branch while detecting renames like so:</h2>
<pre><code>git rebase --strategy-option="rename-threshold=10" master
</code></pre>
<p><strong><em>Edit:</strong> Since Git 2.8.0, the term 'rename-threshold' has been deprecated in favor of 'find-renames'.</em></p>
<p><em>At the moment I'm using Gi... | <h2>You can rebase your branch while detecting renames like so:</h2> <pre><code>git rebase --strategy-option="rename-threshold=10" master </code></pre> <p><strong><em>Edit:</strong> Since Git 2.8.0, the term 'rename-threshold' has been deprecated in favor of 'find-renames'.</em></p> <p><em>At the moment I'm using Gi... | 119, 717, 8974 | git, merge, rebase | <h1>Git rebase with renamed files</h1>
<p>I've got a branch that renames many files, and I'm trying to rebase it onto <code>master</code> where the original files have been modified (preferably without this devolving into a manual conflict-resolution nightmare).</p>
<h2>Situation</h2>
<ol>
<li><p>I've been porting a ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,621 | git | # Git rebase with renamed files
I've got a branch that renames many files, and I'm trying to rebase it onto `master` where the original files have been modified (preferably without this devolving into a manual conflict-resolution nightmare).
## Situation
1. I've been porting a JavaScript project to TypeScript, in my... | ## You can rebase your branch while detecting renames like so:
```
git rebase --strategy-option="rename-threshold=10" master
```
***Edit:*** Since Git 2.8.0, the term 'rename-threshold' has been deprecated in favor of 'find-renames'.
*At the moment I'm using Git 2.7.4, and so I could only actually verify that the ab... |
38068790 | Remove repository from GitKraken overview | 40 | 2016-06-28 06:39:34 | <p>I accidentally cloned the same repository twice in GitKraken (don't ask me how, I am still learning in Git), and now it shows up twice in the repo overview. It both point to the same folder, so I cannot just delete the repo, as I would have lost the other one too. How can I remove one from the overview?</p>
<p>I ca... | 41,843 | 2,781,698 | 2020-04-15 12:19:58 | 39,326,685 | 46 | 2016-09-05 08:36:57 | 5,903,844 | 2017-04-22 07:06:56 | https://stackoverflow.com/q/38068790 | https://stackoverflow.com/a/39326685 | <p>In fact you can easily go to your <code>%APPDATA%</code> folder or Library folder (for MacOS) and find the <code>.gitkraken</code> folder. There there is a profile folder and then your profile guid folder. The directory should look something like this:</p>
<p><code>%APPDATA%\.gitkraken\profiles\<guid></code> ... | <p>In fact you can easily go to your <code>%APPDATA%</code> folder or Library folder (for MacOS) and find the <code>.gitkraken</code> folder. There there is a profile folder and then your profile guid folder. The directory should look something like this:</p> <p><code>%APPDATA%\.gitkraken\profiles\<guid></code> ... | 119, 119628 | git, gitkraken | <h1>Remove repository from GitKraken overview</h1>
<p>I accidentally cloned the same repository twice in GitKraken (don't ask me how, I am still learning in Git), and now it shows up twice in the repo overview. It both point to the same folder, so I cannot just delete the repo, as I would have lost the other one too. H... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,622 | git | # Remove repository from GitKraken overview
I accidentally cloned the same repository twice in GitKraken (don't ask me how, I am still learning in Git), and now it shows up twice in the repo overview. It both point to the same folder, so I cannot just delete the repo, as I would have lost the other one too. How can I ... | In fact you can easily go to your `%APPDATA%` folder or Library folder (for MacOS) and find the `.gitkraken` folder. There there is a profile folder and then your profile guid folder. The directory should look something like this:
`%APPDATA%\.gitkraken\profiles\<guid>`
or
`Users\<user>\.gitkraken\profiles\<guid>... |
22063842 | Check if a latitude and longitude is within a circle | 38 | 2014-02-27 09:11:15 | <p>See this illustration:</p>
<p><img src="https://i.sstatic.net/C8R24.png" alt="enter image description here"></p>
<p>What I would like to know is:</p>
<ol>
<li>How to create an area (circle) when given a latitude and longitude and the distance (10 kilometers)</li>
<li>How to check (calculate) if a latitude and lon... | 56,832 | 294,661 | 2021-02-13 16:16:13 | 22,063,916 | 46 | 2014-02-27 09:15:11 | 2,331,953 | 2019-04-04 11:16:13 | https://stackoverflow.com/q/22063842 | https://stackoverflow.com/a/22063916 | <p>What you basically need, is the distance between two points on the map:</p>
<pre><code>float[] results = new float[1];
Location.distanceBetween(centerLatitude, centerLongitude, testLatitude, testLongitude, results);
float distanceInMeters = results[0];
boolean isWithin10km = distanceInMeters < 10000;
</code></pr... | <p>What you basically need, is the distance between two points on the map:</p> <pre><code>float[] results = new float[1]; Location.distanceBetween(centerLatitude, centerLongitude, testLatitude, testLongitude, results); float distanceInMeters = results[0]; boolean isWithin10km = distanceInMeters < 10000; </code></pr... | 17, 1386, 14292, 20301, 86459 | android, area, google-maps-android-api-2, java, latitude-longitude | <h1>Check if a latitude and longitude is within a circle</h1>
<p>See this illustration:</p>
<p><img src="https://i.sstatic.net/C8R24.png" alt="enter image description here"></p>
<p>What I would like to know is:</p>
<ol>
<li>How to create an area (circle) when given a latitude and longitude and the distance (10 kilom... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,624 | git | # Check if a latitude and longitude is within a circle
See this illustration:

What I would like to know is:
1. How to create an area (circle) when given a latitude and longitude and the distance (10 kilometers)
2. How to check (calculate) if a latitud... | What you basically need, is the distance between two points on the map:
```
float[] results = new float[1];
Location.distanceBetween(centerLatitude, centerLongitude, testLatitude, testLongitude, results);
float distanceInMeters = results[0];
boolean isWithin10km = distanceInMeters < 10000;
```
If you have already `Lo... |
2353804 | List git branches that can safely be deleted | 37 | 2010-03-01 04:00:24 | <p>If you do <code>git branch -d branchname</code>, it will delete branch name if it references an earlier commit in your history, or tell you that you need to use <code>-D</code> otherwise. I often create branches that are later pushed to master, and can thus be deleted by this criterion. Is there an easy way to lis... | 6,107 | 161,801 | 2017-06-16 11:14:12 | 2,353,809 | 46 | 2010-03-01 04:04:19 | 89,391 | 2017-06-16 11:14:12 | https://stackoverflow.com/q/2353804 | https://stackoverflow.com/a/2353809 | <p>Try:</p>
<pre><code>$ git checkout master # or whatever branch you might compare against ...
$ git branch --no-merged
$ git branch --merged
</code></pre>
<p>From <a href="https://git-scm.com/docs/git-branch" rel="noreferrer">git branch documentation</a>:</p>
<blockquote>
<p>With --merged, only branches merged i... | <p>Try:</p> <pre><code>$ git checkout master # or whatever branch you might compare against ... $ git branch --no-merged $ git branch --merged </code></pre> <p>From <a href="https://git-scm.com/docs/git-branch" rel="noreferrer">git branch documentation</a>:</p> <blockquote> <p>With --merged, only branches merged i... | 119 | git | <h1>List git branches that can safely be deleted</h1>
<p>If you do <code>git branch -d branchname</code>, it will delete branch name if it references an earlier commit in your history, or tell you that you need to use <code>-D</code> otherwise. I often create branches that are later pushed to master, and can thus be d... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,625 | git | # List git branches that can safely be deleted
If you do `git branch -d branchname`, it will delete branch name if it references an earlier commit in your history, or tell you that you need to use `-D` otherwise. I often create branches that are later pushed to master, and can thus be deleted by this criterion. Is the... | Try:
```
$ git checkout master # or whatever branch you might compare against ...
$ git branch --no-merged
$ git branch --merged
```
From [git branch documentation](https://git-scm.com/docs/git-branch):
> With --merged, only branches merged into the named commit (i.e. the branches whose tip commits are reachable fro... |
7671305 | How do you make Git work with IntelliJ? | 36 | 2011-10-06 07:25:51 | <p>I am going to use Git version control by IntelliJ Community Edition in order to make branches of the programs I intend to develop. I am striving to accustom myself to its functionality and I come accross obstacles. </p>
<p>I follow the instructions of the web-page <a href="http://wiki.jetbrains.net/intellij/Using... | 149,935 | 954,724 | 2021-01-30 18:16:30 | 7,671,364 | 46 | 2011-10-06 07:32:28 | 6,309 | 2020-07-29 07:20:21 | https://stackoverflow.com/q/7671305 | https://stackoverflow.com/a/7671364 | <p>You need to specify the executable path of Git in the <a href="http://www.jetbrains.com/idea/webhelp/git.html" rel="noreferrer">Git Settings</a>, as mentionned in the per-requesites:</p>
<blockquote>
<p>The <a href="http://www.jetbrains.com/idea/webhelp/updating-installing-and-uninstalling-plugins-from-jetbrains-plu... | <p>You need to specify the executable path of Git in the <a href="http://www.jetbrains.com/idea/webhelp/git.html" rel="noreferrer">Git Settings</a>, as mentionned in the per-requesites:</p> <blockquote> <p>The <a href="http://www.jetbrains.com/idea/webhelp/updating-installing-and-uninstalling-plugins-from-jetbrains-plu... | 17, 119, 456 | git, java, version-control | <h1>How do you make Git work with IntelliJ?</h1>
<p>I am going to use Git version control by IntelliJ Community Edition in order to make branches of the programs I intend to develop. I am striving to accustom myself to its functionality and I come accross obstacles. </p>
<p>I follow the instructions of the web-page ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,627 | git | # How do you make Git work with IntelliJ?
I am going to use Git version control by IntelliJ Community Edition in order to make branches of the programs I intend to develop. I am striving to accustom myself to its functionality and I come accross obstacles.
I follow the instructions of the web-page <http://wiki.jetbra... | You need to specify the executable path of Git in the [Git Settings](http://www.jetbrains.com/idea/webhelp/git.html), as mentionned in the per-requesites:
> The [Git integration plugin is enabled](http://www.jetbrains.com/idea/webhelp/updating-installing-and-uninstalling-plugins-from-jetbrains-plugin-repository.html) ... |
5183051 | How do you delete a remote git branch "properly", a.k.a. updating the remote branch list for all users? | 34 | 2011-03-03 15:47:33 | <p>I'm trying to delete a remote git branch, however the process isn't "fully" deleting the branch as I'd expect.</p>
<p>Let's say for example I'm deleting a branch called <code>mybranch</code>. To do this, I run the following command,</p>
<pre><code>git push origin :mybranch
</code></pre>
<p>This removes the branch... | 6,333 | 189,230 | 2012-09-05 15:56:29 | 5,183,258 | 46 | 2011-03-03 16:03:52 | 198,244 | 2011-03-03 16:03:52 | https://stackoverflow.com/q/5183051 | https://stackoverflow.com/a/5183258 | <p>Until they update their remotes, their git will have no knowledge of what's happened on the repository. Once they've done an update (via <code>git fetch</code> or <code>git remote update</code>), <code>git remote show origin</code> will correctly show that they have local tracking branches for branches that no long... | <p>Until they update their remotes, their git will have no knowledge of what's happened on the repository. Once they've done an update (via <code>git fetch</code> or <code>git remote update</code>), <code>git remote show origin</code> will correctly show that they have local tracking branches for branches that no long... | 119, 1879 | branch, git | <h1>How do you delete a remote git branch "properly", a.k.a. updating the remote branch list for all users?</h1>
<p>I'm trying to delete a remote git branch, however the process isn't "fully" deleting the branch as I'd expect.</p>
<p>Let's say for example I'm deleting a branch called <code>mybranch</code>. To do this,... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,629 | git | # How do you delete a remote git branch "properly", a.k.a. updating the remote branch list for all users?
I'm trying to delete a remote git branch, however the process isn't "fully" deleting the branch as I'd expect.
Let's say for example I'm deleting a branch called `mybranch`. To do this, I run the following comman... | Until they update their remotes, their git will have no knowledge of what's happened on the repository. Once they've done an update (via `git fetch` or `git remote update`), `git remote show origin` will correctly show that they have local tracking branches for branches that no longer exist upstream. At that point, `gi... |
3594746 | Getting the information of squashed commits in Git | 34 | 2010-08-29 12:36:03 | <p>I squash some commits in Git using <code>git rebase -i origin/master</code> as mentioned in <a href="http://reinh.com/blog/2009/03/02/a-git-workflow-for-agile-teams.html" rel="noreferrer">ReinH.com</a>.</p>
<p>After squashing some commits, is there a way to see the original commits? Is it possible to get "diff" of ... | 20,412 | 227,171 | 2018-12-14 07:33:34 | 3,594,848 | 46 | 2010-08-29 13:06:51 | 119,963 | 2018-12-14 07:33:34 | https://stackoverflow.com/q/3594746 | https://stackoverflow.com/a/3594848 | <p>The point of squashing commits is to rewrite history, replacing the original commits with a single commit.</p>
<p>That said, it's hard to make things actually disappear in git. The easiest way to get at those commits will be via <code>git reflog</code>. Try <code>git reflog <branch></code> for the previous po... | <p>The point of squashing commits is to rewrite history, replacing the original commits with a single commit.</p> <p>That said, it's hard to make things actually disappear in git. The easiest way to get at those commits will be via <code>git reflog</code>. Try <code>git reflog <branch></code> for the previous po... | 119 | git | <h1>Getting the information of squashed commits in Git</h1>
<p>I squash some commits in Git using <code>git rebase -i origin/master</code> as mentioned in <a href="http://reinh.com/blog/2009/03/02/a-git-workflow-for-agile-teams.html" rel="noreferrer">ReinH.com</a>.</p>
<p>After squashing some commits, is there a way t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,630 | git | # Getting the information of squashed commits in Git
I squash some commits in Git using `git rebase -i origin/master` as mentioned in [ReinH.com](http://reinh.com/blog/2009/03/02/a-git-workflow-for-agile-teams.html).
After squashing some commits, is there a way to see the original commits? Is it possible to get "diff... | The point of squashing commits is to rewrite history, replacing the original commits with a single commit.
That said, it's hard to make things actually disappear in git. The easiest way to get at those commits will be via `git reflog`. Try `git reflog <branch>` for the previous positions of the branch which you rebase... |
49313250 | git am: Patch format detection failed | 32 | 2018-03-16 04:30:44 | <p>I have never used patches with Git before and I need some help. I am trying to apply a patch to a Git repo to test a Wine patch, specifically <a href="https://bugs.winehq.org/attachment.cgi?id=60752" rel="noreferrer">this patch here</a>. So I did the following:</p>
<pre><code>$ git clone git://source.winehq.org/git... | 38,460 | 4,441,547 | 2019-01-09 08:39:36 | 52,624,311 | 46 | 2018-10-03 09:51:27 | 276,648 | 2018-10-03 09:51:27 | https://stackoverflow.com/q/49313250 | https://stackoverflow.com/a/52624311 | <p><code>Patch format detection failed.</code> probably means you're using the wrong command: use <code>git apply</code> instead of <code>git am</code> or the other way around.</p>
<p>See <a href="https://stackoverflow.com/questions/12240154/what-is-the-difference-between-git-am-and-git-apply">What is the difference b... | <p><code>Patch format detection failed.</code> probably means you're using the wrong command: use <code>git apply</code> instead of <code>git am</code> or the other way around.</p> <p>See <a href="https://stackoverflow.com/questions/12240154/what-is-the-difference-between-git-am-and-git-apply">What is the difference b... | 119, 2132, 3319 | git, patch, wine | <h1>git am: Patch format detection failed</h1>
<p>I have never used patches with Git before and I need some help. I am trying to apply a patch to a Git repo to test a Wine patch, specifically <a href="https://bugs.winehq.org/attachment.cgi?id=60752" rel="noreferrer">this patch here</a>. So I did the following:</p>
<pr... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,632 | git | # git am: Patch format detection failed
I have never used patches with Git before and I need some help. I am trying to apply a patch to a Git repo to test a Wine patch, specifically [this patch here](https://bugs.winehq.org/attachment.cgi?id=60752). So I did the following:
```
$ git clone git://source.winehq.org/git/... | `Patch format detection failed.` probably means you're using the wrong command: use `git apply` instead of `git am` or the other way around.
See [What is the difference between git am and git apply?](https://stackoverflow.com/questions/12240154/what-is-the-difference-between-git-am-and-git-apply) for more on the diffe... |
19612439 | Forgot to branch in git, need to move changes from master | 31 | 2013-10-26 22:09:09 | <p>I eagerly ducked into code mode and modified some files, but neglected to branch from master first. The mods aren't so extensive that I can't redo them, but what's a good way of taking my (so far, uncommitted) changes in master and migrating them to a new branch, leaving master untouched in the end?</p>
| 22,338 | 172,617 | 2020-03-24 14:14:49 | 19,612,507 | 46 | 2013-10-26 22:16:15 | 1,256,452 | 2013-10-26 22:21:25 | https://stackoverflow.com/q/19612439 | https://stackoverflow.com/a/19612507 | <p>If not yet committed anywhere (<code>git status</code> shows a bunch of stuff modified, it's OK if it's "git add"-ed too):</p>
<pre><code>$ git checkout -b newbranch
</code></pre>
<p>Despite the name <code>checkout</code> this usage (with <code>-b</code>) does not check anything out. The <code>-b</code> flag says... | <p>If not yet committed anywhere (<code>git status</code> shows a bunch of stuff modified, it's OK if it's "git add"-ed too):</p> <pre><code>$ git checkout -b newbranch </code></pre> <p>Despite the name <code>checkout</code> this usage (with <code>-b</code>) does not check anything out. The <code>-b</code> flag says... | 119, 76220 | git, git-branch | <h1>Forgot to branch in git, need to move changes from master</h1>
<p>I eagerly ducked into code mode and modified some files, but neglected to branch from master first. The mods aren't so extensive that I can't redo them, but what's a good way of taking my (so far, uncommitted) changes in master and migrating them to... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,633 | git | # Forgot to branch in git, need to move changes from master
I eagerly ducked into code mode and modified some files, but neglected to branch from master first. The mods aren't so extensive that I can't redo them, but what's a good way of taking my (so far, uncommitted) changes in master and migrating them to a new bra... | If not yet committed anywhere (`git status` shows a bunch of stuff modified, it's OK if it's "git add"-ed too):
```
$ git checkout -b newbranch
```
Despite the name `checkout` this usage (with `-b`) does not check anything out. The `-b` flag says "create a new branch", so git creates the branch-name and makes it corr... |
42117385 | gpg: skipped "N": secret key not available | 30 | 2017-02-08 15:38:03 | <h2>1. Summary</h2>
<p>I can not begin to use Gpg4win.</p>
<hr>
<h2>2. Expected behavior</h2>
<p>Successfully commits.</p>
<hr>
<h2>3. Actual behavior</h2>
<pre class="lang-bash prettyprint-override"><code>SashaChernykh@DESKTOP-EEOT0TN D:\SashaGitHub
$ git commit -m "[Test] gpg4win"
gpg: skipped "DBA8E7A2": secr... | 19,263 | 5,951,529 | 2024-09-20 07:30:11 | 42,118,485 | 46 | 2017-02-08 16:26:29 | 5,951,529 | 2017-02-08 16:26:29 | https://stackoverflow.com/q/42117385 | https://stackoverflow.com/a/42118485 | <h2>1. Demonstration</h2>
<p><img src="https://i.sstatic.net/vn7Jq.png" alt="Verified key"></p>
<hr>
<h2>2. Solution</h2>
<p>I must be <a href="https://stackoverflow.com/a/42008822/5951529"><strong>manually set path to gpg2 in git settings</strong></a>.</p>
<pre class="lang-bash prettyprint-override"><code>SashaCh... | <h2>1. Demonstration</h2> <p><img src="https://i.sstatic.net/vn7Jq.png" alt="Verified key"></p> <hr> <h2>2. Solution</h2> <p>I must be <a href="https://stackoverflow.com/a/42008822/5951529"><strong>manually set path to gpg2 in git settings</strong></a>.</p> <pre class="lang-bash prettyprint-override"><code>SashaCh... | 119, 6735 | git, gnupg | <h1>gpg: skipped "N": secret key not available</h1>
<h2>1. Summary</h2>
<p>I can not begin to use Gpg4win.</p>
<hr>
<h2>2. Expected behavior</h2>
<p>Successfully commits.</p>
<hr>
<h2>3. Actual behavior</h2>
<pre class="lang-bash prettyprint-override"><code>SashaChernykh@DESKTOP-EEOT0TN D:\SashaGitHub
$ git comm... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,634 | git | # gpg: skipped "N": secret key not available
## 1. Summary
I can not begin to use Gpg4win.
---
## 2. Expected behavior
Successfully commits.
---
## 3. Actual behavior
```
SashaChernykh@DESKTOP-EEOT0TN D:\SashaGitHub
$ git commit -m "[Test] gpg4win"
gpg: skipped "DBA8E7A2": secret key not available
gpg: signing ... | ## 1. Demonstration

---
## 2. Solution
I must be [**manually set path to gpg2 in git settings**](https://stackoverflow.com/a/42008822/5951529).
```
SashaChernykh@DESKTOP-EEOT0TN D:\SashaGitHub
$ where gpg2
C:\Program Files (x86)\GNU\GnuPG\pub\gpg2.exe
SashaChernykh... |
56235287 | What does "git ls-files" do exactly and how do we remove a file from it? | 29 | 2019-05-21 09:30:47 | <p>Does it show files from the local repository, the staging repository, the remote repository or from somewhere else?</p>
<p>I'm constantly seeing a file that is present in <a href="https://git-scm.com/docs/git-ls-files" rel="noreferrer"><code>git ls-files</code></a>.
That file was deleted from the remote repository.
... | 35,174 | 169,513 | 2023-10-21 08:57:43 | 56,242,906 | 46 | 2019-05-21 16:43:20 | 1,256,452 | 2019-05-22 05:46:56 | https://stackoverflow.com/q/56235287 | https://stackoverflow.com/a/56242906 | <h1>Summary</h1>
<p>You need to wrap your head around the idea that Git stores <em>at least three, and sometimes up to five</em> active copies of each file: one in the <em>current commit</em>, one (or two or three!) in the <em>index</em>, and one—the only one you can see and work with—in your <em>work-tree</em>. The ... | <h1>Summary</h1> <p>You need to wrap your head around the idea that Git stores <em>at least three, and sometimes up to five</em> active copies of each file: one in the <em>current commit</em>, one (or two or three!) in the <em>index</em>, and one—the only one you can see and work with—in your <em>work-tree</em>. The ... | 119, 107030 | git, git-ls-files | <h1>What does "git ls-files" do exactly and how do we remove a file from it?</h1>
<p>Does it show files from the local repository, the staging repository, the remote repository or from somewhere else?</p>
<p>I'm constantly seeing a file that is present in <a href="https://git-scm.com/docs/git-ls-files" rel="noreferrer"... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,635 | git | # What does "git ls-files" do exactly and how do we remove a file from it?
Does it show files from the local repository, the staging repository, the remote repository or from somewhere else?
I'm constantly seeing a file that is present in [`git ls-files`](https://git-scm.com/docs/git-ls-files).
That file was deleted ... | # Summary
You need to wrap your head around the idea that Git stores *at least three, and sometimes up to five* active copies of each file: one in the *current commit*, one (or two or three!) in the *index*, and one—the only one you can see and work with—in your *work-tree*. The `git ls-files` command looks at these c... |
43927066 | Git says branch is merged, but changes are apparently not present | 24 | 2017-05-11 23:20:56 | <p>I've worked myself into a situation that is not making sense to me. I'll try to describe it as best I can.</p>
<p>I have a development branch and I've merged master into it via <code>git checkout develpment && git merge master</code>. I didn't get any merge conflicts here.</p>
<p>There is a specific commit... | 34,831 | 871,096 | 2017-05-12 17:08:29 | 43,928,592 | 46 | 2017-05-12 03:00:41 | 1,256,452 | 2017-05-12 03:07:14 | https://stackoverflow.com/q/43927066 | https://stackoverflow.com/a/43928592 | <p>This answer is long, because there is a lot going on here. The TL;DR summary, though, is probably that you want <code>--full-history</code>.</p>
<p>There are multiple separate issues here that need to be untangled:</p>
<ul>
<li>The phrase "show changes", or what you see in <code>git log -p</code> or <code>git sho... | <p>This answer is long, because there is a lot going on here. The TL;DR summary, though, is probably that you want <code>--full-history</code>.</p> <p>There are multiple separate issues here that need to be untangled:</p> <ul> <li>The phrase "show changes", or what you see in <code>git log -p</code> or <code>git sho... | 119, 717, 47913 | git, git-log, merge | <h1>Git says branch is merged, but changes are apparently not present</h1>
<p>I've worked myself into a situation that is not making sense to me. I'll try to describe it as best I can.</p>
<p>I have a development branch and I've merged master into it via <code>git checkout develpment && git merge master</code>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,638 | git | # Git says branch is merged, but changes are apparently not present
I've worked myself into a situation that is not making sense to me. I'll try to describe it as best I can.
I have a development branch and I've merged master into it via `git checkout develpment && git merge master`. I didn't get any merge conflicts ... | This answer is long, because there is a lot going on here. The TL;DR summary, though, is probably that you want `--full-history`.
There are multiple separate issues here that need to be untangled:
- The phrase "show changes", or what you see in `git log -p` or `git show`, often leads people down the wrong path in int... |
29717502 | Run "git pull --rebase" in interactive mode? | 24 | 2015-04-18 12:42:57 | <p>Is it possible to run the command <code>git pull --rebase</code> in an interactive mode (like <code>git rebase -i</code>)?</p>
| 14,250 | 1,355,801 | 2020-02-26 07:55:26 | 29,717,607 | 46 | 2015-04-18 12:52:32 | 6,309 | 2020-02-26 07:55:26 | https://stackoverflow.com/q/29717502 | https://stackoverflow.com/a/29717607 | <p>Original answer (April 2015)</p>
<p><del>Not really</del>, considering a <a href="https://stackoverflow.com/a/11531502/6309"><code>git pull --rebase</code> is not the same as a <code>git fech</code> + <code>git rebase</code></a>.<br>
See <a href="http://gitolite.com/git-pull--rebase.html" rel="noreferrer">what does... | <p>Original answer (April 2015)</p> <p><del>Not really</del>, considering a <a href="https://stackoverflow.com/a/11531502/6309"><code>git pull --rebase</code> is not the same as a <code>git fech</code> + <code>git rebase</code></a>.<br> See <a href="http://gitolite.com/git-pull--rebase.html" rel="noreferrer">what does... | 119 | git | <h1>Run "git pull --rebase" in interactive mode?</h1>
<p>Is it possible to run the command <code>git pull --rebase</code> in an interactive mode (like <code>git rebase -i</code>)?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,639 | git | # Run "git pull --rebase" in interactive mode?
Is it possible to run the command `git pull --rebase` in an interactive mode (like `git rebase -i`)? | Original answer (April 2015)
~~Not really~~, considering a [`git pull --rebase` is not the same as a `git fech` + `git rebase`](https://stackoverflow.com/a/11531502/6309).
See [what does "`git pull --rebase`" do?](http://gitolite.com/git-pull--rebase.html)
---
Update January 2016
Git 2.8 (March 2016) will allows ... |
25748132 | What to include in gitignore for a Laravel and PHPStorm project? | 20 | 2014-09-09 15:12:21 | <p>I'm going to be collaborating on a project using Laravel and PHPStorm. After doing some research and working on a few projects, here is the <code>.gitignore</code> I've come up with so far. </p>
<pre><code>/bootstrap/compiled.php
/vendor
/node_modules
composer.phar
composer.lock
.env.*.php
.env.php
.DS_Store
worksp... | 59,292 | 3,626,450 | 2021-05-26 04:33:32 | 25,748,488 | 46 | 2014-09-09 15:27:36 | 354,577 | 2020-11-17 15:32:34 | https://stackoverflow.com/q/25748132 | https://stackoverflow.com/a/25748488 |
<p>Unless PHPStorm is an official part of the project (e.g. it's mandated by a company, or agreed to by all team members) I would urge you to put its ignore settings into <code>.git/info/exclude</code> instead of <code>.gitignore</code>. The former is local to your copy, the latter should be committed and shared.</p>
... | <p>Unless PHPStorm is an official part of the project (e.g. it's mandated by a company, or agreed to by all team members) I would urge you to put its ignore settings into <code>.git/info/exclude</code> instead of <code>.gitignore</code>. The former is local to your copy, the latter should be committed and shared.</p> ... | 5, 119, 66821, 75151 | git, laravel, php, phpstorm | <h1>What to include in gitignore for a Laravel and PHPStorm project?</h1>
<p>I'm going to be collaborating on a project using Laravel and PHPStorm. After doing some research and working on a few projects, here is the <code>.gitignore</code> I've come up with so far. </p>
<pre><code>/bootstrap/compiled.php
/vendor
/nod... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,641 | git | # What to include in gitignore for a Laravel and PHPStorm project?
I'm going to be collaborating on a project using Laravel and PHPStorm. After doing some research and working on a few projects, here is the `.gitignore` I've come up with so far.
```
/bootstrap/compiled.php
/vendor
/node_modules
composer.phar
composer... | Unless PHPStorm is an official part of the project (e.g. it's mandated by a company, or agreed to by all team members) I would urge you to put its ignore settings into `.git/info/exclude` instead of `.gitignore`. The former is local to your copy, the latter should be committed and shared.
[gitignore.io](https://www.gi... |
12201083 | "src refspec does not match" and "failed to push some refs" errors on git push | 20 | 2012-08-30 16:06:30 | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/959477/error-when-git-push-to-github">Error when “git push” to github</a> </p>
</blockquote>
<p>I tried to push my new branch (let's just call it <code>new_branch</code>) to remote rep. There is no ... | 30,837 | 1,185,254 | 2012-08-30 17:36:54 | 12,202,281 | 46 | 2012-08-30 17:26:05 | 1,198,509 | 2012-08-30 17:36:54 | https://stackoverflow.com/q/12201083 | https://stackoverflow.com/a/12202281 | <p>The syntax you're using for <code>git push</code> includes a <em>refspec</em> (<code>new_branch:new_branch</code>). Refspecs are always in the form <code>source:destination</code>, so the error is telling you that something's wrong with the source part of your refspec.</p>
<p>I was able to reproduce this error by ... | <p>The syntax you're using for <code>git push</code> includes a <em>refspec</em> (<code>new_branch:new_branch</code>). Refspecs are always in the form <code>source:destination</code>, so the error is telling you that something's wrong with the source part of your refspec.</p> <p>I was able to reproduce this error by ... | 119, 28898, 41346, 76220 | git, git-branch, git-push, git-remote | <h1>"src refspec does not match" and "failed to push some refs" errors on git push</h1>
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/959477/error-when-git-push-to-github">Error when “git push” to github</a> </p>
</blockquote>
<p>I tried to pus... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,643 | git | # "src refspec does not match" and "failed to push some refs" errors on git push
> **Possible Duplicate:**
> [Error when “git push” to github](https://stackoverflow.com/questions/959477/error-when-git-push-to-github)
I tried to push my new branch (let's just call it `new_branch`) to remote rep. There is no such bra... | The syntax you're using for `git push` includes a *refspec* (`new_branch:new_branch`). Refspecs are always in the form `source:destination`, so the error is telling you that something's wrong with the source part of your refspec.
I was able to reproduce this error by trying to push a branch that doesn't exist (`git pu... |
22814602 | Can't resolve rebase conflict | 19 | 2014-04-02 14:27:30 | <pre><code>foo:/opt/bar$ git status
# On branch develop
nothing to commit (working directory clean)
foo:/opt/bar$ git pull --rebase origin develop
From ssh://xxx/yyy
* branch develop -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: Subscription logging added.
Using index info to rec... | 26,817 | 705,373 | 2020-07-30 18:09:51 | 22,816,493 | 46 | 2014-04-02 15:40:33 | 679,227 | 2014-04-02 15:40:33 | https://stackoverflow.com/q/22814602 | https://stackoverflow.com/a/22816493 | <p>You are on the right path. You just need to use skip the commit on which you have problems:</p>
<pre><code>git rebase --skip
</code></pre>
<p>You have fixed the conflict, but this has resulted in no changes compared to the previous commit. In this case you cannot just <code>git rebase --continue</code>, because yo... | <p>You are on the right path. You just need to use skip the commit on which you have problems:</p> <pre><code>git rebase --skip </code></pre> <p>You have fixed the conflict, but this has resulted in no changes compared to the previous commit. In this case you cannot just <code>git rebase --continue</code>, because yo... | 119, 8974, 29934 | git, git-rebase, rebase | <h1>Can't resolve rebase conflict</h1>
<pre><code>foo:/opt/bar$ git status
# On branch develop
nothing to commit (working directory clean)
foo:/opt/bar$ git pull --rebase origin develop
From ssh://xxx/yyy
* branch develop -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: Subscription... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,644 | git | # Can't resolve rebase conflict
```
foo:/opt/bar$ git status
# On branch develop
nothing to commit (working directory clean)
foo:/opt/bar$ git pull --rebase origin develop
From ssh://xxx/yyy
* branch develop -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: Subscription logging added.
... | You are on the right path. You just need to use skip the commit on which you have problems:
```
git rebase --skip
```
You have fixed the conflict, but this has resulted in no changes compared to the previous commit. In this case you cannot just `git rebase --continue`, because you are telling Git to create an empty c... |
46656240 | Understanding git rebase and the "golden rule" | 15 | 2017-10-09 23:01:06 | <p>I work on a large team and we recently switched to Git from TFS.</p>
<p>We've already had a few issues with work being overwritten and believe that <code>git pull --rebase</code> is what we want to do, so instead of a straight merge its replaying the pulled commits on your local branch.</p>
<p>However, we have bee... | 7,764 | 3,946,099 | 2017-10-10 00:44:28 | 46,657,021 | 46 | 2017-10-10 00:44:28 | 1,256,452 | 2017-10-10 00:44:28 | https://stackoverflow.com/q/46656240 | https://stackoverflow.com/a/46657021 | <p>There really is no single, simple, universal rule that works for everyone in every situation. "Never rebase anything" is a simple rule and does work, but is not for everyone. There's a somewhat more complicated rule that always works: <em>Rebase is OK as long as everyone who has the original commits is willing to ... | <p>There really is no single, simple, universal rule that works for everyone in every situation. "Never rebase anything" is a simple rule and does work, but is not for everyone. There's a somewhat more complicated rule that always works: <em>Rebase is OK as long as everyone who has the original commits is willing to ... | 119, 456 | git, version-control | <h1>Understanding git rebase and the "golden rule"</h1>
<p>I work on a large team and we recently switched to Git from TFS.</p>
<p>We've already had a few issues with work being overwritten and believe that <code>git pull --rebase</code> is what we want to do, so instead of a straight merge its replaying the pulled co... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,645 | git | # Understanding git rebase and the "golden rule"
I work on a large team and we recently switched to Git from TFS.
We've already had a few issues with work being overwritten and believe that `git pull --rebase` is what we want to do, so instead of a straight merge its replaying the pulled commits on your local branch.... | There really is no single, simple, universal rule that works for everyone in every situation. "Never rebase anything" is a simple rule and does work, but is not for everyone. There's a somewhat more complicated rule that always works: *Rebase is OK as long as everyone who has the original commits is willing to switch t... |
39999361 | Authentication Fails When Cloning TFS repo with Git | 13 | 2016-10-12 13:05:00 | <p>I have always created local repositories using this command: </p>
<pre><code>git clone http://TFSServer:8080/tfs/Scripts/_git/ProjectName
</code></pre>
<p>However, when I do it at the moment I get this message: </p>
<blockquote>
<p>Cloning into 'ProjectName' ...</p>
<p>fatal: Authentication failed for '<a ... | 21,085 | 4,671,754 | 2019-10-04 00:33:55 | 40,085,380 | 46 | 2016-10-17 11:37:20 | 4,671,754 | 2016-10-17 11:37:20 | https://stackoverflow.com/q/39999361 | https://stackoverflow.com/a/40085380 | <p>It turns out that this only started happening after I needed to change Windows logon password. </p>
<p>The password was updated locally and on the TFS server, but not in the cached credentials for git. </p>
<h3>Fix</h3>
<p><code>Control Panel</code> -> <code>Credential Manager</code> -> <code>Generic Credentials<... | <p>It turns out that this only started happening after I needed to change Windows logon password. </p> <p>The password was updated locally and on the TFS server, but not in the cached credentials for git. </p> <h3>Fix</h3> <p><code>Control Panel</code> -> <code>Credential Manager</code> -> <code>Generic Credentials<... | 119, 733, 111608 | git, tfs, visual-studio-code | <h1>Authentication Fails When Cloning TFS repo with Git</h1>
<p>I have always created local repositories using this command: </p>
<pre><code>git clone http://TFSServer:8080/tfs/Scripts/_git/ProjectName
</code></pre>
<p>However, when I do it at the moment I get this message: </p>
<blockquote>
<p>Cloning into 'Proje... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,646 | git | # Authentication Fails When Cloning TFS repo with Git
I have always created local repositories using this command:
```
git clone http://TFSServer:8080/tfs/Scripts/_git/ProjectName
```
However, when I do it at the moment I get this message:
> Cloning into 'ProjectName' ...
>
> fatal: Authentication failed for '<http... | It turns out that this only started happening after I needed to change Windows logon password.
The password was updated locally and on the TFS server, but not in the cached credentials for git.
### Fix
`Control Panel` -> `Credential Manager` -> `Generic Credentials`
Then update the password for `git:http://ServerNa... |
4414140 | Git auto-pull using cronjob | 71 | 2010-12-10 23:14:42 | <p>I was trying to create a cronjob with a task to do a <code>git pull</code> every minute to keep my production site in sync with my master branch. </p>
<p>The git pull needs to be done by the system user <code>nobody</code>, due to the permissions problem. However it seems that the <code>nobody</code> account is not... | 112,075 | 291,233 | 2022-07-05 03:04:11 | 4,415,927 | 45 | 2010-12-11 08:39:57 | 291,233 | 2019-06-22 20:22:42 | https://stackoverflow.com/q/4414140 | https://stackoverflow.com/a/4415927 | <p>Solution:</p>
<pre><code>*/1 * * * * su -s /bin/sh nobody -c 'cd ~dstrt/www && /usr/local/bin/git pull -q origin master'
</code></pre>
| <p>Solution:</p> <pre><code>*/1 * * * * su -s /bin/sh nobody -c 'cd ~dstrt/www && /usr/local/bin/git pull -q origin master' </code></pre> | 119, 601 | cron, git | <h1>Git auto-pull using cronjob</h1>
<p>I was trying to create a cronjob with a task to do a <code>git pull</code> every minute to keep my production site in sync with my master branch. </p>
<p>The git pull needs to be done by the system user <code>nobody</code>, due to the permissions problem. However it seems that t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,649 | git | # Git auto-pull using cronjob
I was trying to create a cronjob with a task to do a `git pull` every minute to keep my production site in sync with my master branch.
The git pull needs to be done by the system user `nobody`, due to the permissions problem. However it seems that the `nobody` account is not allowed run ... | Solution:
```
*/1 * * * * su -s /bin/sh nobody -c 'cd ~dstrt/www && /usr/local/bin/git pull -q origin master'
``` |
28189880 | Why am I getting "Commit failed with error: pathspec ... did not match any file(s)"? | 68 | 2015-01-28 10:28:24 | <p>I am having some issues with Git.</p>
<p>I have a repository where I can commit any file to without problem. However, there is a single file 'Funder.php' which, when I try committing, tells me there is an error as:</p>
<pre><code>Commit failed with error:
pathspec 'application/libraries/Funder.php' did not match ... | 97,538 | 2,197,256 | 2020-09-04 10:18:14 | 28,190,291 | 45 | 2015-01-28 10:48:14 | 2,541,573 | 2015-01-28 10:48:14 | https://stackoverflow.com/q/28189880 | https://stackoverflow.com/a/28190291 | <p>This is the error you get when you attempt to run</p>
<pre><code>git commit <file>
</code></pre>
<p>but <code><file></code> hasn't been staged yet; in other words, Git hasn't been told about it, yet. This is most likely what's happening here. Run</p>
<pre><code>git add application/libraries/Funder.php... | <p>This is the error you get when you attempt to run</p> <pre><code>git commit <file> </code></pre> <p>but <code><file></code> hasn't been staged yet; in other words, Git hasn't been told about it, yet. This is most likely what's happening here. Run</p> <pre><code>git add application/libraries/Funder.php... | 119, 53850 | git, git-commit | <h1>Why am I getting "Commit failed with error: pathspec ... did not match any file(s)"?</h1>
<p>I am having some issues with Git.</p>
<p>I have a repository where I can commit any file to without problem. However, there is a single file 'Funder.php' which, when I try committing, tells me there is an error as:</p>
<... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,650 | git | # Why am I getting "Commit failed with error: pathspec ... did not match any file(s)"?
I am having some issues with Git.
I have a repository where I can commit any file to without problem. However, there is a single file 'Funder.php' which, when I try committing, tells me there is an error as:
```
Commit failed with... | This is the error you get when you attempt to run
```
git commit <file>
```
but `<file>` hasn't been staged yet; in other words, Git hasn't been told about it, yet. This is most likely what's happening here. Run
```
git add application/libraries/Funder.php
```
then try to commit. |
24393148 | Android Studio Update Project: Merge vs Rebase vs Branch Default | 64 | 2014-06-24 17:48:18 | <p>Apologies if this seems redundant as I know there are fair amount of questions regarding Merge vs Rebase, but there doesn't seem to be any that throw in 'Branch Default' as well. </p>
<p>You are given a case where you have multiple people working on something (i.e. an Android app in Android Studio) concurrently. Wh... | 79,604 | 2,288,548 | 2023-04-21 13:33:03 | 24,393,293 | 45 | 2014-06-24 17:58:35 | 1,253,844 | 2014-06-24 17:58:35 | https://stackoverflow.com/q/24393148 | https://stackoverflow.com/a/24393293 | <p><strong>Stashing</strong></p>
<p>The key here is that you have uncommitted work that you want to save. Before trying to merge anything in, you should <a href="http://git-scm.com/book/en/Git-Tools-Stashing" rel="noreferrer">stash your changes</a> to save your uncommitted changes and clean your working directory.</p>... | <p><strong>Stashing</strong></p> <p>The key here is that you have uncommitted work that you want to save. Before trying to merge anything in, you should <a href="http://git-scm.com/book/en/Git-Tools-Stashing" rel="noreferrer">stash your changes</a> to save your uncommitted changes and clean your working directory.</p>... | 119, 1386, 28897, 91905 | android, android-studio, git, git-merge | <h1>Android Studio Update Project: Merge vs Rebase vs Branch Default</h1>
<p>Apologies if this seems redundant as I know there are fair amount of questions regarding Merge vs Rebase, but there doesn't seem to be any that throw in 'Branch Default' as well. </p>
<p>You are given a case where you have multiple people wor... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,652 | git | # Android Studio Update Project: Merge vs Rebase vs Branch Default
Apologies if this seems redundant as I know there are fair amount of questions regarding Merge vs Rebase, but there doesn't seem to be any that throw in 'Branch Default' as well.
You are given a case where you have multiple people working on something... | **Stashing**
The key here is that you have uncommitted work that you want to save. Before trying to merge anything in, you should [stash your changes](http://git-scm.com/book/en/Git-Tools-Stashing) to save your uncommitted changes and clean your working directory.
Run `git stash` to stash your changes. You should the... |
12153405 | How to manage multiple versions of a project? | 60 | 2012-08-28 05:46:02 | <p>I have a project that is open sourced using <code>git</code> for revision control. Soon, I am going to release a premium hosted version of the project as well, but there will be changes made to the code specifically for the premium hosted version (performance, etc.), that should not exist in the open source version.... | 39,872 | 425,964 | 2023-01-27 09:55:55 | 12,153,522 | 45 | 2012-08-28 06:00:15 | 6,309 | 2015-10-13 04:33:49 | https://stackoverflow.com/q/12153405 | https://stackoverflow.com/a/12153522 | <p>And yet, branching should work, and will allow you to maintain two separate versions.</p>
<p>If you have a bug which applies to the premium version, fix it on <code>master</code>, and merge it on <code>premium</code> branch.<br>
Git will only merge what has changed since you branched between <code>master</code> and... | <p>And yet, branching should work, and will allow you to maintain two separate versions.</p> <p>If you have a bug which applies to the premium version, fix it on <code>master</code>, and merge it on <code>premium</code> branch.<br> Git will only merge what has changed since you branched between <code>master</code> and... | 119, 456, 1363 | git, project-management, version-control | <h1>How to manage multiple versions of a project?</h1>
<p>I have a project that is open sourced using <code>git</code> for revision control. Soon, I am going to release a premium hosted version of the project as well, but there will be changes made to the code specifically for the premium hosted version (performance, e... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,653 | git | # How to manage multiple versions of a project?
I have a project that is open sourced using `git` for revision control. Soon, I am going to release a premium hosted version of the project as well, but there will be changes made to the code specifically for the premium hosted version (performance, etc.), that should no... | And yet, branching should work, and will allow you to maintain two separate versions.
If you have a bug which applies to the premium version, fix it on `master`, and merge it on `premium` branch.
Git will only merge what has changed since you branched between `master` and `premium`, ie your bug fix.
On another way... |
47842479 | How to use Swift Package Manager with private repos? | 47 | 2017-12-16 04:17:12 | <p>How to use the Swift Package Manager with dependencies stored in private repositories?</p>
<p>Adding a <code>username</code> and <code>password</code> can functionally work:</p>
<pre class="lang-swift prettyprint-override"><code>let package = Package(
name: "MyPackage",
dependencies: [
.package(url: "https... | 42,844 | 3,103,448 | 2023-03-06 16:14:26 | 47,842,480 | 45 | 2017-12-16 04:17:12 | 3,103,448 | 2023-03-06 16:14:26 | https://stackoverflow.com/q/47842479 | https://stackoverflow.com/a/47842480 | <p>A solution, for Unix-like systems, is to use SSH <code>git</code> URLs and add <code>Host</code> configurations to <code>~/.ssh/config</code>. This approach works for both macOS/Linux command line and Xcode.</p>
<p><em>Use a ssh form for the dependency url in <code>Package.swift</code>.</em></p>
<pre class="lang-sw... | <p>A solution, for Unix-like systems, is to use SSH <code>git</code> URLs and add <code>Host</code> configurations to <code>~/.ssh/config</code>. This approach works for both macOS/Linux command line and Xcode.</p> <p><em>Use a ssh form for the dependency url in <code>Package.swift</code>.</em></p> <pre class="lang-sw... | 119, 116442 | git, swift-package-manager | <h1>How to use Swift Package Manager with private repos?</h1>
<p>How to use the Swift Package Manager with dependencies stored in private repositories?</p>
<p>Adding a <code>username</code> and <code>password</code> can functionally work:</p>
<pre class="lang-swift prettyprint-override"><code>let package = Package(
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,657 | git | # How to use Swift Package Manager with private repos?
How to use the Swift Package Manager with dependencies stored in private repositories?
Adding a `username` and `password` can functionally work:
```
let package = Package(
name: "MyPackage",
dependencies: [
.package(url: "https://username:password@gitlab... | A solution, for Unix-like systems, is to use SSH `git` URLs and add `Host` configurations to `~/.ssh/config`. This approach works for both macOS/Linux command line and Xcode.
*Use a ssh form for the dependency url in `Package.swift`.*
```
// swift-tools-version:4.0
import PackageDescription
let package = Package... |
2085402 | What does git update-server-info do? | 45 | 2010-01-18 10:47:43 | <p>What does git update-server-info do? How do I know if I need it? The manual says:</p>
<blockquote>
<p>A dumb server that does not do on-the-fly pack generations must have some auxiliary information files in $GIT_DIR/info and $GIT_OBJECT_DIRECTORY/info directories to help clients discover what references and pack... | 32,435 | 247,525 | 2022-03-26 22:46:00 | 2,085,582 | 45 | 2010-01-18 11:23:45 | 98,530 | 2010-01-18 11:23:45 | https://stackoverflow.com/q/2085402 | https://stackoverflow.com/a/2085582 | <p>Dumb server basically means accessed over HTTP. So if you access your Git repository over <code>http:</code> or <code>https:</code> URLs, you need the <code>update-server-info</code> business, otherwise (<code>git:</code>, <code>ssh:</code>, etc.) you don't need it.</p>
| <p>Dumb server basically means accessed over HTTP. So if you access your Git repository over <code>http:</code> or <code>https:</code> URLs, you need the <code>update-server-info</code> business, otherwise (<code>git:</code>, <code>ssh:</code>, etc.) you don't need it.</p> | 119, 386 | git, ssh | <h1>What does git update-server-info do?</h1>
<p>What does git update-server-info do? How do I know if I need it? The manual says:</p>
<blockquote>
<p>A dumb server that does not do on-the-fly pack generations must have some auxiliary information files in $GIT_DIR/info and $GIT_OBJECT_DIRECTORY/info directories to ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,658 | git | # What does git update-server-info do?
What does git update-server-info do? How do I know if I need it? The manual says:
> A dumb server that does not do on-the-fly pack generations must have some auxiliary information files in $GIT_DIR/info and $GIT_OBJECT_DIRECTORY/info directories to help clients discover what ref... | Dumb server basically means accessed over HTTP. So if you access your Git repository over `http:` or `https:` URLs, you need the `update-server-info` business, otherwise (`git:`, `ssh:`, etc.) you don't need it. |
26189082 | Track file inside ignored directory | 44 | 2014-10-04 02:39:29 | <p>Some time ago I set up my <code>.gitignore</code> file to <em>not</em> track a folder <code>my_folder</code> with:</p>
<pre><code>my_folder/
</code></pre>
<p>Now I want to track only a given file inside said folder, named <code>my_file.md</code>. After making <code>.gitignore</code> look like this:</p>
<pre><code... | 19,614 | 1,391,441 | 2024-04-11 12:31:50 | 26,190,177 | 45 | 2014-10-04 06:02:37 | 6,309 | 2016-04-12 18:27:44 | https://stackoverflow.com/q/26189082 | https://stackoverflow.com/a/26190177 | <p>To add to "<a href="https://stackoverflow.com/a/20652768/6309"><code>.gitignore</code> exclude folder but include specific subfolder</a>", one good way to debug those .gitignore file is to use <a href="http://git-scm.com/docs/git-check-ignore" rel="noreferrer"><code>git check-ignore</code></a> (Git 1.8.4+):</p>
<pr... | <p>To add to "<a href="https://stackoverflow.com/a/20652768/6309"><code>.gitignore</code> exclude folder but include specific subfolder</a>", one good way to debug those .gitignore file is to use <a href="http://git-scm.com/docs/git-check-ignore" rel="noreferrer"><code>git check-ignore</code></a> (Git 1.8.4+):</p> <pr... | 119, 53850 | git, git-commit | <h1>Track file inside ignored directory</h1>
<p>Some time ago I set up my <code>.gitignore</code> file to <em>not</em> track a folder <code>my_folder</code> with:</p>
<pre><code>my_folder/
</code></pre>
<p>Now I want to track only a given file inside said folder, named <code>my_file.md</code>. After making <code>.git... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 17,659 | git | # Track file inside ignored directory
Some time ago I set up my `.gitignore` file to *not* track a folder `my_folder` with:
```
my_folder/
```
Now I want to track only a given file inside said folder, named `my_file.md`. After making `.gitignore` look like this:
```
my_folder/
!my_folder/my_file.md
```
and checkin... | To add to "[`.gitignore` exclude folder but include specific subfolder](https://stackoverflow.com/a/20652768/6309)", one good way to debug those .gitignore file is to use [`git check-ignore`](http://git-scm.com/docs/git-check-ignore) (Git 1.8.4+):
```
git check-ignore -v my_folder/my_file.md
```
You would see it is s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.