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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6414227 | How to serve GIT through HTTP via NGINX with user/password? | 21 | 2011-06-20 16:09:14 | <p>Despite all the links I've found on how to configure git/nginx to get my repos, I can't make them work.</p>
<p>I followed this tutorial, <a href="http://www.xiaoka.com/blog/2008/04/13/git-repository-over-http-webdav-with-nginx/">Git repository over HTTP WebDAV with nginx</a>, but the user/password restriction doesn... | 47,697 | 330,867 | 2021-08-12 11:49:17 | 17,553,364 | 24 | 2013-07-09 16:21:28 | 1,431,239 | 2013-07-09 16:31:28 | https://stackoverflow.com/q/6414227 | https://stackoverflow.com/a/17553364 | <p>Take a look at the following article, <a href="http://www.toofishes.net/blog/git-smart-http-transport-nginx/" rel="noreferrer">http://www.toofishes.net/blog/git-smart-http-transport-nginx/</a></p>
<p>It provides a sample nginx config:</p>
<pre><code>http {
...
server {
listen 80;
serv... | <p>Take a look at the following article, <a href="http://www.toofishes.net/blog/git-smart-http-transport-nginx/" rel="noreferrer">http://www.toofishes.net/blog/git-smart-http-transport-nginx/</a></p> <p>It provides a sample nginx config:</p> <pre><code>http { ... server { listen 80; serv... | 119, 6605 | git, nginx | <h1>How to serve GIT through HTTP via NGINX with user/password?</h1>
<p>Despite all the links I've found on how to configure git/nginx to get my repos, I can't make them work.</p>
<p>I followed this tutorial, <a href="http://www.xiaoka.com/blog/2008/04/13/git-repository-over-http-webdav-with-nginx/">Git repository ove... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,789 | git | # How to serve GIT through HTTP via NGINX with user/password?
Despite all the links I've found on how to configure git/nginx to get my repos, I can't make them work.
I followed this tutorial, [Git repository over HTTP WebDAV with nginx](http://www.xiaoka.com/blog/2008/04/13/git-repository-over-http-webdav-with-nginx/... | Take a look at the following article, <http://www.toofishes.net/blog/git-smart-http-transport-nginx/>
It provides a sample nginx config:
```
http {
...
server {
listen 80;
server_name git.mydomain.com;
location ~ /git(/.*) {
# fcgiwrap is set up to listen on this ho... |
1783659 | Does git clone work through NTLM proxies? | 21 | 2009-11-23 15:01:44 | <p>I've tried both using <code>export http_proxy=http://[username]:[pwd]@[proxy]</code> and <code>git config --global http.proxy http://[username]:[pwd]@[proxy]</code>. </p>
<p>I couldn't make it work. It looks like git uses Basic authentication:</p>
<pre><code>Initialized empty Git repository in /home/.../.git/
* Co... | 33,667 | 209,486 | 2018-01-17 23:48:06 | 10,848,870 | 24 | 2012-06-01 10:49:15 | 352,672 | 2014-11-05 16:07:57 | https://stackoverflow.com/q/1783659 | https://stackoverflow.com/a/10848870 | <p>Git supports NTLM proxy authentication from version <strong>1.7.10</strong> onwards, relevant commit is <a href="https://github.com/gitster/git/commit/dd6139971a18e25a5089c0f96dc80e454683ef0b">https://github.com/gitster/git/commit/dd6139971a18e25a5089c0f96dc80e454683ef0b</a></p>
<p><strong>1.7.10</strong> <a href="... | <p>Git supports NTLM proxy authentication from version <strong>1.7.10</strong> onwards, relevant commit is <a href="https://github.com/gitster/git/commit/dd6139971a18e25a5089c0f96dc80e454683ef0b">https://github.com/gitster/git/commit/dd6139971a18e25a5089c0f96dc80e454683ef0b</a></p> <p><strong>1.7.10</strong> <a href="... | 119, 760, 1554, 2269 | curl, git, ntlm, proxy | <h1>Does git clone work through NTLM proxies?</h1>
<p>I've tried both using <code>export http_proxy=http://[username]:[pwd]@[proxy]</code> and <code>git config --global http.proxy http://[username]:[pwd]@[proxy]</code>. </p>
<p>I couldn't make it work. It looks like git uses Basic authentication:</p>
<pre><code>Initi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,790 | git | # Does git clone work through NTLM proxies?
I've tried both using `export http_proxy=http://[username]:[pwd]@[proxy]` and `git config --global http.proxy http://[username]:[pwd]@[proxy]`.
I couldn't make it work. It looks like git uses Basic authentication:
```
Initialized empty Git repository in /home/.../.git/
* C... | Git supports NTLM proxy authentication from version **1.7.10** onwards, relevant commit is <https://github.com/gitster/git/commit/dd6139971a18e25a5089c0f96dc80e454683ef0b>
**1.7.10** [release notes](https://raw.github.com/git/git/master/Documentation/RelNotes/1.7.10.txt) briefly mentioned it as:
```
* HTTP transport ... |
20325089 | Hosting a git server on localhost | 20 | 2013-12-02 09:43:30 | <p>My company does not have a central git server, and neither do they allow me to use BitBucket etc. </p>
<p>Is there anyway I can use my localhost as <code>remote</code> ?</p>
<p>EDIT: I am on a windows machine</p>
| 31,167 | 690,851 | 2017-06-29 10:02:42 | 20,329,071 | 24 | 2013-12-02 13:04:59 | 12,471 | 2013-12-02 13:04:59 | https://stackoverflow.com/q/20325089 | https://stackoverflow.com/a/20329071 | <p>Local directories work just like remote repository URLs, so basically there's nothing you need to do as long as you're the only person using the repository.</p>
<p>Example, assuming Git Bash (from msysgit):</p>
<pre><code>mkdir /c/git
mkdir /c/git/testrepo.git
cd /c/git/testrepo.git
git init --bare
cd $TEMP
git cl... | <p>Local directories work just like remote repository URLs, so basically there's nothing you need to do as long as you're the only person using the repository.</p> <p>Example, assuming Git Bash (from msysgit):</p> <pre><code>mkdir /c/git mkdir /c/git/testrepo.git cd /c/git/testrepo.git git init --bare cd $TEMP git cl... | 119, 456 | git, version-control | <h1>Hosting a git server on localhost</h1>
<p>My company does not have a central git server, and neither do they allow me to use BitBucket etc. </p>
<p>Is there anyway I can use my localhost as <code>remote</code> ?</p>
<p>EDIT: I am on a windows machine</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,792 | git | # Hosting a git server on localhost
My company does not have a central git server, and neither do they allow me to use BitBucket etc.
Is there anyway I can use my localhost as `remote` ?
EDIT: I am on a windows machine | Local directories work just like remote repository URLs, so basically there's nothing you need to do as long as you're the only person using the repository.
Example, assuming Git Bash (from msysgit):
```
mkdir /c/git
mkdir /c/git/testrepo.git
cd /c/git/testrepo.git
git init --bare
cd $TEMP
git clone /c/git/testrepo.g... |
14595772 | have composer update get latest version from git repo | 20 | 2013-01-30 02:37:02 | <p>I am trying to move away from git submodules for the development in my team. The most important reason for this is that when a team member commits changes in a submodule, but forgets to push to origin, but does push the reference to this new commit in the "root" project, origin is broken, and the other developers ge... | 17,814 | 520,819 | 2013-01-30 09:17:21 | 14,600,363 | 24 | 2013-01-30 09:17:21 | 291,573 | 2013-01-30 09:17:21 | https://stackoverflow.com/q/14595772 | https://stackoverflow.com/a/14600363 | <p>If you won't have to specify each version separately in your repositories section, you'll need to add a <code>composer.json</code> file to <strong>wkjagt/Seagull</strong> and include the package like this:</p>
<pre><code>{
"type": "vcs",
"url": "https://github.com/wkjagt/Seagull"
},
</code></pre>
<p>Composer... | <p>If you won't have to specify each version separately in your repositories section, you'll need to add a <code>composer.json</code> file to <strong>wkjagt/Seagull</strong> and include the package like this:</p> <pre><code>{ "type": "vcs", "url": "https://github.com/wkjagt/Seagull" }, </code></pre> <p>Composer... | 5, 119, 78546 | composer-php, git, php | <h1>have composer update get latest version from git repo</h1>
<p>I am trying to move away from git submodules for the development in my team. The most important reason for this is that when a team member commits changes in a submodule, but forgets to push to origin, but does push the reference to this new commit in th... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,794 | git | # have composer update get latest version from git repo
I am trying to move away from git submodules for the development in my team. The most important reason for this is that when a team member commits changes in a submodule, but forgets to push to origin, but does push the reference to this new commit in the "root" ... | If you won't have to specify each version separately in your repositories section, you'll need to add a `composer.json` file to **wkjagt/Seagull** and include the package like this:
```
{
"type": "vcs",
"url": "https://github.com/wkjagt/Seagull"
},
```
Composer can then read through your tags and treat them as ... |
12281859 | Can I continue working while git pushes? | 20 | 2012-09-05 12:51:32 | <p>I am doing my initial import of existing code into git, it is quite a big codebase so the push is taking it's time.</p>
<p>From what I am aware git gets the changes and then does the upload, so am I safe to continue working while the push is going, or do I need to wait for it to complete before I modify the files?<... | 1,435 | 383,759 | 2012-09-05 12:55:10 | 12,281,931 | 24 | 2012-09-05 12:55:10 | 11,343 | 2012-09-05 12:55:10 | https://stackoverflow.com/q/12281859 | https://stackoverflow.com/a/12281931 | <p>When Git pushes, it doesn't read or write anything from the working tree, only stuff from the <code>.git</code> folder.</p>
<p>So yes, you're safe to continue working.</p>
| <p>When Git pushes, it doesn't read or write anything from the working tree, only stuff from the <code>.git</code> folder.</p> <p>So yes, you're safe to continue working.</p> | 119, 28898 | git, git-push | <h1>Can I continue working while git pushes?</h1>
<p>I am doing my initial import of existing code into git, it is quite a big codebase so the push is taking it's time.</p>
<p>From what I am aware git gets the changes and then does the upload, so am I safe to continue working while the push is going, or do I need to w... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,795 | git | # Can I continue working while git pushes?
I am doing my initial import of existing code into git, it is quite a big codebase so the push is taking it's time.
From what I am aware git gets the changes and then does the upload, so am I safe to continue working while the push is going, or do I need to wait for it to co... | When Git pushes, it doesn't read or write anything from the working tree, only stuff from the `.git` folder.
So yes, you're safe to continue working. |
62039244 | Does Git store the file creation time? | 19 | 2020-05-27 08:59:55 | <p>Let's say I created a project and pushed it to GitHub. When someone clones the project, can they see the <strong>file creation time</strong> of each file in the project?</p>
| 8,012 | 7,330,592 | 2021-10-24 19:58:41 | 62,039,285 | 24 | 2020-05-27 09:01:58 | 4,621,513 | 2021-04-26 08:22:50 | https://stackoverflow.com/q/62039244 | https://stackoverflow.com/a/62039285 | <p>They can see the time when a file was added to the repository, via the commit date.</p>
<p>They cannot see the "file creation" or "file modification" timestamps of the file in your local filesystem.</p>
<h3>Example</h3>
<pre><code>$ git init
Initialized empty Git repository in /tmp/tmp.t4KdOYhQGr... | <p>They can see the time when a file was added to the repository, via the commit date.</p> <p>They cannot see the "file creation" or "file modification" timestamps of the file in your local filesystem.</p> <h3>Example</h3> <pre><code>$ git init Initialized empty Git repository in /tmp/tmp.t4KdOYhQGr... | 119 | git | <h1>Does Git store the file creation time?</h1>
<p>Let's say I created a project and pushed it to GitHub. When someone clones the project, can they see the <strong>file creation time</strong> of each file in the project?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,796 | git | # Does Git store the file creation time?
Let's say I created a project and pushed it to GitHub. When someone clones the project, can they see the **file creation time** of each file in the project? | They can see the time when a file was added to the repository, via the commit date.
They cannot see the "file creation" or "file modification" timestamps of the file in your local filesystem.
### Example
```
$ git init
Initialized empty Git repository in /tmp/tmp.t4KdOYhQGr/.git/
$ echo bla >file.txt
$ git add file.... |
44159978 | Nginx Configuration Versioning Strategy | 19 | 2017-05-24 13:35:24 | <p>currently a project my team inherited has a complete mess on the nginx configuration across 10+ environments, we would like to implement a versioning strategy however im not sure how people "normally" achieve this. you make the whole nginx conf folder a git repo and ignore what you do not want to version? or have a ... | 6,279 | 1,844,187 | 2017-05-24 16:10:39 | 44,163,566 | 24 | 2017-05-24 16:10:39 | 1,320,932 | 2017-05-24 16:10:39 | https://stackoverflow.com/q/44159978 | https://stackoverflow.com/a/44163566 | <p>We manage it via separate Git repository exclusive only for nginx configuration. Yes, it includes everything inside <code>/etc/nginx/</code> directory.</p>
<p>But it's not synced directly on server, instead a bash script is used to pull changes, update configuration, and reload nginx configuration.</p>
<p>Script e... | <p>We manage it via separate Git repository exclusive only for nginx configuration. Yes, it includes everything inside <code>/etc/nginx/</code> directory.</p> <p>But it's not synced directly on server, instead a bash script is used to pull changes, update configuration, and reload nginx configuration.</p> <p>Script e... | 58, 119, 456, 3574, 6605 | config, git, linux, nginx, version-control | <h1>Nginx Configuration Versioning Strategy</h1>
<p>currently a project my team inherited has a complete mess on the nginx configuration across 10+ environments, we would like to implement a versioning strategy however im not sure how people "normally" achieve this. you make the whole nginx conf folder a git repo and i... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,798 | git | # Nginx Configuration Versioning Strategy
currently a project my team inherited has a complete mess on the nginx configuration across 10+ environments, we would like to implement a versioning strategy however im not sure how people "normally" achieve this. you make the whole nginx conf folder a git repo and ignore wha... | We manage it via separate Git repository exclusive only for nginx configuration. Yes, it includes everything inside `/etc/nginx/` directory.
But it's not synced directly on server, instead a bash script is used to pull changes, update configuration, and reload nginx configuration.
Script example:
```
# Pull changes
... |
32819596 | How to view all stashes at once? | 19 | 2015-09-28 09:25:25 | <p>It's time-consuming to read through dozens of stashes, one-by-one, by issuing:</p>
<pre class="lang-sh prettyprint-override"><code>git stash show -p 'stash@{N}' # Where "N" is the stash index
</code></pre>
<p>Is there a way to view all stashes at once (in patch form)? Note that I don't want to view all the... | 6,458 | 797,744 | 2021-01-04 06:51:49 | 32,820,026 | 24 | 2015-09-28 09:46:44 | 2,274,140 | 2015-09-28 09:46:44 | https://stackoverflow.com/q/32819596 | https://stackoverflow.com/a/32820026 | <p>Is it possible you are looking for the command</p>
<pre><code>git stash list -p
</code></pre>
<p>As mentioned in <a href="http://git-scm.com/docs/git-stash" rel="noreferrer">http://git-scm.com/docs/git-stash</a>
you can add all options from git log to git stash list...</p>
| <p>Is it possible you are looking for the command</p> <pre><code>git stash list -p </code></pre> <p>As mentioned in <a href="http://git-scm.com/docs/git-stash" rel="noreferrer">http://git-scm.com/docs/git-stash</a> you can add all options from git log to git stash list...</p> | 119, 13091 | git, git-stash | <h1>How to view all stashes at once?</h1>
<p>It's time-consuming to read through dozens of stashes, one-by-one, by issuing:</p>
<pre class="lang-sh prettyprint-override"><code>git stash show -p 'stash@{N}' # Where "N" is the stash index
</code></pre>
<p>Is there a way to view all stashes at once (in patch for... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,799 | git | # How to view all stashes at once?
It's time-consuming to read through dozens of stashes, one-by-one, by issuing:
```
git stash show -p 'stash@{N}' # Where "N" is the stash index
```
Is there a way to view all stashes at once (in patch form)? Note that I don't want to view all the stashes merged into one big patch b... | Is it possible you are looking for the command
```
git stash list -p
```
As mentioned in <http://git-scm.com/docs/git-stash>
you can add all options from git log to git stash list... |
26180437 | Composer - adding git repository without composer.json | 19 | 2014-10-03 14:02:33 | <p>I try to add repository from github (designmodo/Flat-UI), play with config and get errors <code>No valid composer.json was found in any branch or...</code>, <code>Your requirements could not be resolved to an installable set of packages.</code>, <code>The requested package designmodo/flat-ui could not be found in an... | 8,069 | 1,726,507 | 2021-05-24 16:27:27 | 26,181,123 | 24 | 2014-10-03 14:42:37 | 1,726,507 | 2014-10-03 14:42:37 | https://stackoverflow.com/q/26180437 | https://stackoverflow.com/a/26181123 | <p>Problem solved. Play around and changed <code>reference</code> to <code>master</code> and version to any <code>*</code> in <code>"designmodo/Flat-UI": "*"</code> section. After that composer download package via git and update <code>composer.lock</code> without problems. Should work for any github repos.</p>
<p><st... | <p>Problem solved. Play around and changed <code>reference</code> to <code>master</code> and version to any <code>*</code> in <code>"designmodo/Flat-UI": "*"</code> section. After that composer download package via git and update <code>composer.lock</code> without problems. Should work for any github repos.</p> <p><st... | 119, 78546 | composer-php, git | <h1>Composer - adding git repository without composer.json</h1>
<p>I try to add repository from github (designmodo/Flat-UI), play with config and get errors <code>No valid composer.json was found in any branch or...</code>, <code>Your requirements could not be resolved to an installable set of packages.</code>, <code>T... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,801 | git | # Composer - adding git repository without composer.json
I try to add repository from github (designmodo/Flat-UI), play with config and get errors `No valid composer.json was found in any branch or...`, `Your requirements could not be resolved to an installable set of packages.`, `The requested package designmodo/flat... | Problem solved. Play around and changed `reference` to `master` and version to any `*` in `"designmodo/Flat-UI": "*"` section. After that composer download package via git and update `composer.lock` without problems. Should work for any github repos.
**Working config:**
```
{
"repositories": {
"flat-ui": {
... |
18137757 | Git Flag Syntax: why do some flags have -one dash and some have --two? | 19 | 2013-08-08 23:10:33 | <p>I am learning Git and have been <a href="http://www.google.com/search?q=git%20two%20dashes%20flag" rel="noreferrer">unable</a> <a href="http://www.google.com/search?q=git%20flag%20option%20dashes" rel="noreferrer">to</a> <a href="http://www.google.com/search?q=git+"two+dashes"" rel="noreferrer">find</a> <a... | 3,364 | 925,897 | 2013-08-08 23:33:25 | 18,137,960 | 24 | 2013-08-08 23:33:25 | 565,145 | 2013-08-08 23:33:25 | https://stackoverflow.com/q/18137757 | https://stackoverflow.com/a/18137960 | <p>My understanding is that git follows the 'standard' Linux convention for flags. That is:</p>
<ul>
<li>one dash for 'short' flags: generally one character flags, but sometimes flags with a single character, then further characters which represent a parameter to the flag (e.g. <code>git log -SFoo</code>, in which <co... | <p>My understanding is that git follows the 'standard' Linux convention for flags. That is:</p> <ul> <li>one dash for 'short' flags: generally one character flags, but sometimes flags with a single character, then further characters which represent a parameter to the flag (e.g. <code>git log -SFoo</code>, in which <co... | 119, 367, 1079 | flags, git, syntax | <h1>Git Flag Syntax: why do some flags have -one dash and some have --two?</h1>
<p>I am learning Git and have been <a href="http://www.google.com/search?q=git%20two%20dashes%20flag" rel="noreferrer">unable</a> <a href="http://www.google.com/search?q=git%20flag%20option%20dashes" rel="noreferrer">to</a> <a href="http://... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,802 | git | # Git Flag Syntax: why do some flags have -one dash and some have --two?
I am learning Git and have been [unable](http://www.google.com/search?q=git%20two%20dashes%20flag) [to](http://www.google.com/search?q=git%20flag%20option%20dashes) [find](http://www.google.com/search?q=git+"two+dashes") [any](http://www.google.c... | My understanding is that git follows the 'standard' Linux convention for flags. That is:
- one dash for 'short' flags: generally one character flags, but sometimes flags with a single character, then further characters which represent a parameter to the flag (e.g. `git log -SFoo`, in which `Foo` is a parameter to the ... |
8790799 | Get a List of all Pushes with Git | 19 | 2012-01-09 15:30:09 | <p>How can I get a list of all <code>push</code> commands to or from a particular remote in <code>git</code>? </p>
<p><strong>For my case</strong>, this would be OK to run on either the remote or the local repos.</p>
<p><strong>For bonus points</strong>, how would I get a list of all <strong>successful</strong> <cod... | 16,485 | 30,753 | 2016-03-23 23:52:59 | 8,791,295 | 24 | 2012-01-09 16:00:25 | 223,092 | 2012-01-09 16:00:25 | https://stackoverflow.com/q/8790799 | https://stackoverflow.com/a/8791295 | <p>This method will only give you the successful pushes, but it may still be useful to you:</p>
<p>When you push to a branch in a remote that corresponds to one of your remote-tracking branches, and that push is successful, the remote-tracking branch will be updated. In the default case where you've cloned from a rep... | <p>This method will only give you the successful pushes, but it may still be useful to you:</p> <p>When you push to a branch in a remote that corresponds to one of your remote-tracking branches, and that push is successful, the remote-tracking branch will be updated. In the default case where you've cloned from a rep... | 119 | git | <h1>Get a List of all Pushes with Git</h1>
<p>How can I get a list of all <code>push</code> commands to or from a particular remote in <code>git</code>? </p>
<p><strong>For my case</strong>, this would be OK to run on either the remote or the local repos.</p>
<p><strong>For bonus points</strong>, how would I get a l... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,803 | git | # Get a List of all Pushes with Git
How can I get a list of all `push` commands to or from a particular remote in `git`?
**For my case**, this would be OK to run on either the remote or the local repos.
**For bonus points**, how would I get a list of all **successful** `push` commands? | This method will only give you the successful pushes, but it may still be useful to you:
When you push to a branch in a remote that corresponds to one of your remote-tracking branches, and that push is successful, the remote-tracking branch will be updated. In the default case where you've cloned from a repository thi... |
3409526 | Customizing headings in git diff | 19 | 2010-08-04 20:24:31 | <p>When viewing a diff using <code>git diff</code>, each change starts with line like:</p>
<pre><code>@@ -28,41 +20,10 @@ namespace ConsoleApplication1
</code></pre>
<p>For C, the final part is quite descriptive β it shows for example the function in which the change occurred. But for C#, it only ever shows the names... | 2,754 | 41,071 | 2019-05-02 13:48:25 | 3,409,698 | 24 | 2010-08-04 20:48:12 | 41,071 | 2019-05-02 13:48:25 | https://stackoverflow.com/q/3409526 | https://stackoverflow.com/a/3409698 | <p>I have found it, the line is called hunk header and <a href="https://git-scm.com/docs/gitattributes#_generating_diff_text" rel="noreferrer">the documentation</a> says how to customize it:</p>
<blockquote>
<h2>Defining a custom hunk-header</h2>
<p>Each group of changes (called a "hunk") in the textual diff ou... | <p>I have found it, the line is called hunk header and <a href="https://git-scm.com/docs/gitattributes#_generating_diff_text" rel="noreferrer">the documentation</a> says how to customize it:</p> <blockquote> <h2>Defining a custom hunk-header</h2> <p>Each group of changes (called a "hunk") in the textual diff ou... | 119, 606, 9033 | diff, git, git-diff | <h1>Customizing headings in git diff</h1>
<p>When viewing a diff using <code>git diff</code>, each change starts with line like:</p>
<pre><code>@@ -28,41 +20,10 @@ namespace ConsoleApplication1
</code></pre>
<p>For C, the final part is quite descriptive β it shows for example the function in which the change occurred... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,804 | git | # Customizing headings in git diff
When viewing a diff using `git diff`, each change starts with line like:
```
@@ -28,41 +20,10 @@ namespace ConsoleApplication1
```
For C, the final part is quite descriptive β it shows for example the function in which the change occurred. But for C#, it only ever shows the namespa... | I have found it, the line is called hunk header and [the documentation](https://git-scm.com/docs/gitattributes#_generating_diff_text) says how to customize it:
> ## Defining a custom hunk-header
>
> Each group of changes (called a "hunk") in the textual diff output is prefixed with a line of the form:
>
> ```
> @@ -k,... |
1081186 | Is [---] a comment in .gitconfig? | 19 | 2009-07-04 00:17:38 | <p>This question is based on <a href="https://stackoverflow.com/questions/1063618/unable-to-understand-how-gits-difftool-configs-are-set/1063646">this thread</a>.</p>
<p>Is <code>[---]</code> a comment in Git such that I can use only <code>% tool=opendiff %</code> once in my <code>.gitconfig</code>?</p>
| 10,263 | 54,964 | 2015-07-17 15:39:38 | 1,081,197 | 24 | 2009-07-04 00:26:02 | 893 | 2012-01-02 17:37:46 | https://stackoverflow.com/q/1081186 | https://stackoverflow.com/a/1081197 | <p>I think you are asking whether the square bracket syntax in <code>.gitconfig</code> means something significant. The answer is yes, it separates <code>.gitconfig</code> into sections. Each section has a name, shown between the square brackets. For example:</p>
<pre><code>[core]
repositoryformatversion = 0
... | <p>I think you are asking whether the square bracket syntax in <code>.gitconfig</code> means something significant. The answer is yes, it separates <code>.gitconfig</code> into sections. Each section has a name, shown between the square brackets. For example:</p> <pre><code>[core] repositoryformatversion = 0 ... | 119, 1966 | comments, git | <h1>Is [---] a comment in .gitconfig?</h1>
<p>This question is based on <a href="https://stackoverflow.com/questions/1063618/unable-to-understand-how-gits-difftool-configs-are-set/1063646">this thread</a>.</p>
<p>Is <code>[---]</code> a comment in Git such that I can use only <code>% tool=opendiff %</code> once in my ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,805 | git | # Is [---] a comment in .gitconfig?
This question is based on [this thread](https://stackoverflow.com/questions/1063618/unable-to-understand-how-gits-difftool-configs-are-set/1063646).
Is `[---]` a comment in Git such that I can use only `% tool=opendiff %` once in my `.gitconfig`? | I think you are asking whether the square bracket syntax in `.gitconfig` means something significant. The answer is yes, it separates `.gitconfig` into sections. Each section has a name, shown between the square brackets. For example:
```
[core]
repositoryformatversion = 0
filemode = true
bare ... |
32074850 | How to add multiple files in git for a single commit? | 18 | 2015-08-18 14:11:23 | <p>I made changes to two files in different directory, How can I add the two files for a single commit. can I do like, add the first, then change the directory to second file and add the second file finally do the commit. Is this going to work? </p>
| 103,098 | 4,025,940 | 2018-12-16 08:45:15 | 53,800,696 | 24 | 2018-12-16 08:45:15 | 6,842,763 | 2018-12-16 08:45:15 | https://stackoverflow.com/q/32074850 | https://stackoverflow.com/a/53800696 | <p>You can add all the files using </p>
<pre><code>git add file1.txt folder/file2.txt file3.txt file4.txt file5.txt
</code></pre>
<p>And the commit your the files you wish to commit.</p>
<pre><code>git commit file1.txt folder/file2.txt file3.txt -m"I committed file1.txt folder/file2.txt"
</code></pre>
<p>You will h... | <p>You can add all the files using </p> <pre><code>git add file1.txt folder/file2.txt file3.txt file4.txt file5.txt </code></pre> <p>And the commit your the files you wish to commit.</p> <pre><code>git commit file1.txt folder/file2.txt file3.txt -m"I committed file1.txt folder/file2.txt" </code></pre> <p>You will h... | 119, 53850 | git, git-commit | <h1>How to add multiple files in git for a single commit?</h1>
<p>I made changes to two files in different directory, How can I add the two files for a single commit. can I do like, add the first, then change the directory to second file and add the second file finally do the commit. Is this going to work? </p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,806 | git | # How to add multiple files in git for a single commit?
I made changes to two files in different directory, How can I add the two files for a single commit. can I do like, add the first, then change the directory to second file and add the second file finally do the commit. Is this going to work? | You can add all the files using
```
git add file1.txt folder/file2.txt file3.txt file4.txt file5.txt
```
And the commit your the files you wish to commit.
```
git commit file1.txt folder/file2.txt file3.txt -m"I committed file1.txt folder/file2.txt"
```
You will have added
- file1.txt
- folder/file2.txt
- file3.tx... |
38250900 | git show: exclude a directory when checking a past commit's changes | 18 | 2016-07-07 16:37:44 | <p>I usually check the changes introduced by a commit with the <code>git show</code> command. This works well, except when I'm only interested in the changes introduced in a subset of the changed files.</p>
<p>Is there something like <code>git show --exclude some/path</code> that will do this out of the box?</p>
| 4,516 | 147,072 | 2024-07-02 22:33:00 | 38,251,311 | 24 | 2016-07-07 17:01:18 | 5,819,286 | 2016-07-07 17:01:18 | https://stackoverflow.com/q/38250900 | https://stackoverflow.com/a/38251311 | <p>Translating @DavidN's comment into an answer, here's what you get (people may not realize that "git log" and "git show" take all the same options):</p>
<pre><code>git show -- . ':!some/path'
</code></pre>
<p>Requires git 1.9 or newer.</p>
<p>Here's a example showing it in use against the php github repo:</p>
<pr... | <p>Translating @DavidN's comment into an answer, here's what you get (people may not realize that "git log" and "git show" take all the same options):</p> <pre><code>git show -- . ':!some/path' </code></pre> <p>Requires git 1.9 or newer.</p> <p>Here's a example showing it in use against the php github repo:</p> <pr... | 119 | git | <h1>git show: exclude a directory when checking a past commit's changes</h1>
<p>I usually check the changes introduced by a commit with the <code>git show</code> command. This works well, except when I'm only interested in the changes introduced in a subset of the changed files.</p>
<p>Is there something like <code>gi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,807 | git | # git show: exclude a directory when checking a past commit's changes
I usually check the changes introduced by a commit with the `git show` command. This works well, except when I'm only interested in the changes introduced in a subset of the changed files.
Is there something like `git show --exclude some/path` that... | Translating @DavidN's comment into an answer, here's what you get (people may not realize that "git log" and "git show" take all the same options):
```
git show -- . ':!some/path'
```
Requires git 1.9 or newer.
Here's a example showing it in use against the php github repo:
```
git remote -v
origin https://github.... |
49057558 | Change admin password in Gitea | 17 | 2018-03-01 19:46:27 | <p>I created an admin user with a password, that contains a special character. Installation of Gitea was successful, but I can't login. I can't get new password, because it says:</p>
<blockquote>
<p>Sorry, Register Mail Confirmation has been disabled.</p>
</blockquote>
<p>I tried command <code>gitea admin change-pa... | 47,247 | 3,946,482 | 2022-02-13 14:37:12 | 65,645,634 | 24 | 2021-01-09 17:36:20 | 7,576,836 | 2021-08-25 17:10:28 | https://stackoverflow.com/q/49057558 | https://stackoverflow.com/a/65645634 | <p>It's the future now and the other answers will no longer work. I found this answer because I had the same problem. I know I will mess this up again as this is already my second time, so hello future me!</p>
<p>Non-docker answer:</p>
<pre><code>gitea admin user change-password -u <username> -p <password>
... | <p>It's the future now and the other answers will no longer work. I found this answer because I had the same problem. I know I will mess this up again as this is already my second time, so hello future me!</p> <p>Non-docker answer:</p> <pre><code>gitea admin user change-password -u <username> -p <password> ... | 119, 128429 | git, gitea | <h1>Change admin password in Gitea</h1>
<p>I created an admin user with a password, that contains a special character. Installation of Gitea was successful, but I can't login. I can't get new password, because it says:</p>
<blockquote>
<p>Sorry, Register Mail Confirmation has been disabled.</p>
</blockquote>
<p>I t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,809 | git | # Change admin password in Gitea
I created an admin user with a password, that contains a special character. Installation of Gitea was successful, but I can't login. I can't get new password, because it says:
> Sorry, Register Mail Confirmation has been disabled.
I tried command `gitea admin change-password`, but co... | It's the future now and the other answers will no longer work. I found this answer because I had the same problem. I know I will mess this up again as this is already my second time, so hello future me!
Non-docker answer:
```
gitea admin user change-password -u <username> -p <password>
```
Docker answer:
```
docker... |
39479154 | How can I split a single file from a git repo into a new repo? | 17 | 2016-09-13 21:20:17 | <p>I have a git repo with several directories, and a single file, <code>MyFile.ext</code>.</p>
<pre><code>/
LargeDir1/
LargeDir2/
LargeDir3/
.
.
.
MyFile.ext
</code></pre>
<p>I'd like to start a new repo with just <code>MyFile.ext</code> in it, and keep all the history pertaining to it, but ... | 2,594 | 817,630 | 2025-12-30 08:28:06 | 42,845,758 | 24 | 2017-03-16 22:14:35 | 1,219,295 | 2025-12-30 08:28:06 | https://stackoverflow.com/q/39479154 | https://stackoverflow.com/a/42845758 | <p>Use <a href="https://git-scm.com/docs/git-fast-export" rel="nofollow noreferrer"><code>git fast-export</code></a>.</p>
<p>First you export the history of the file to a <em>fast-import stream</em> (<code>.fi</code> file). Make sure you do this on the <code>master</code> branch.</p>
<pre><code>cd oldrepo
git fast-expo... | <p>Use <a href="https://git-scm.com/docs/git-fast-export" rel="nofollow noreferrer"><code>git fast-export</code></a>.</p> <p>First you export the history of the file to a <em>fast-import stream</em> (<code>.fi</code> file). Make sure you do this on the <code>master</code> branch.</p> <pre><code>cd oldrepo git fast-expo... | 119 | git | <h1>How can I split a single file from a git repo into a new repo?</h1>
<p>I have a git repo with several directories, and a single file, <code>MyFile.ext</code>.</p>
<pre><code>/
LargeDir1/
LargeDir2/
LargeDir3/
.
.
.
MyFile.ext
</code></pre>
<p>I'd like to start a new repo with just <code>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,810 | git | # How can I split a single file from a git repo into a new repo?
I have a git repo with several directories, and a single file, `MyFile.ext`.
```
/
LargeDir1/
LargeDir2/
LargeDir3/
.
.
.
MyFile.ext
```
I'd like to start a new repo with just `MyFile.ext` in it, and keep all the history perta... | Use [`git fast-export`](https://git-scm.com/docs/git-fast-export).
First you export the history of the file to a *fast-import stream* (`.fi` file). Make sure you do this on the `master` branch.
```
cd oldrepo
git fast-export HEAD -- MyFile.ext >../myfile.fi
```
Then you create a new repo and import.
```
cd ..
mkdir... |
33577383 | Git apply three-way error "repository lacks the necessary blob to fall back on 3-way merge." | 17 | 2015-11-06 23:50:40 | <p>I have a Git diff created with</p>
<pre><code>git diff --full-index --ignore-submodules > mypatch.diff
</code></pre>
<p>And when trying to apply it to another Git repository (same remote branch, more advanced revision) I get the error in the title</p>
<pre><code>git apply --3way mypatch.diff
...
error: patch fail... | 16,738 | 1,001,395 | 2021-08-29 20:54:11 | 33,577,782 | 24 | 2015-11-07 00:39:44 | 1,256,452 | 2016-11-23 07:42:59 | https://stackoverflow.com/q/33577383 | https://stackoverflow.com/a/33577782 | <p>You probably need to run <code>git fetch</code> (and you may need to tweak your <code>fetch</code> refspecs, and/or use <code>--unshallow</code>).</p>
<h3>What's happening</h3>
<p>The blob(s) that Git needs are specific versions of the files (pathnames are irrelevant at this point).</p>
<p>For instance, consider ... | <p>You probably need to run <code>git fetch</code> (and you may need to tweak your <code>fetch</code> refspecs, and/or use <code>--unshallow</code>).</p> <h3>What's happening</h3> <p>The blob(s) that Git needs are specific versions of the files (pathnames are irrelevant at this point).</p> <p>For instance, consider ... | 119 | git | <h1>Git apply three-way error "repository lacks the necessary blob to fall back on 3-way merge."</h1>
<p>I have a Git diff created with</p>
<pre><code>git diff --full-index --ignore-submodules > mypatch.diff
</code></pre>
<p>And when trying to apply it to another Git repository (same remote branch, more advanced rev... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,811 | git | # Git apply three-way error "repository lacks the necessary blob to fall back on 3-way merge."
I have a Git diff created with
```
git diff --full-index --ignore-submodules > mypatch.diff
```
And when trying to apply it to another Git repository (same remote branch, more advanced revision) I get the error in the titl... | You probably need to run `git fetch` (and you may need to tweak your `fetch` refspecs, and/or use `--unshallow`).
### What's happening
The blob(s) that Git needs are specific versions of the files (pathnames are irrelevant at this point).
For instance, consider this bit of patch:
```
diff --git a/fmt.py b/fmt.py
in... |
29800349 | Are file permissions and owner:group properties included in git commits? | 17 | 2015-04-22 14:14:28 | <p>Are file permissions and owner:group properties included in git commits?
How are these properties of files and directories handled throughout the git pipeline [commit, push, pull, merge, etc] ?</p>
| 4,635 | 241,677 | 2025-11-10 14:27:06 | 29,800,979 | 24 | 2015-04-22 14:38:28 | 354,577 | 2025-11-10 14:27:06 | https://stackoverflow.com/q/29800349 | https://stackoverflow.com/a/29800979 | <p>Files in Git are assigned either 644 (owner <code>rw-</code>, group and other <code>r--</code>) or 755 (owner <code>rwx</code>, group and other <code>r-x</code>). Ownership information is not stored.</p>
<p>This is deliberate, and well-explained by <a href="https://web.archive.org/web/20110209091736/http://git.66134... | <p>Files in Git are assigned either 644 (owner <code>rw-</code>, group and other <code>r--</code>) or 755 (owner <code>rwx</code>, group and other <code>r-x</code>). Ownership information is not stored.</p> <p>This is deliberate, and well-explained by <a href="https://web.archive.org/web/20110209091736/http://git.66134... | 119 | git | <h1>Are file permissions and owner:group properties included in git commits?</h1>
<p>Are file permissions and owner:group properties included in git commits?
How are these properties of files and directories handled throughout the git pipeline [commit, push, pull, merge, etc] ?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,812 | git | # Are file permissions and owner:group properties included in git commits?
Are file permissions and owner:group properties included in git commits?
How are these properties of files and directories handled throughout the git pipeline [commit, push, pull, merge, etc] ? | Files in Git are assigned either 644 (owner `rw-`, group and other `r--`) or 755 (owner `rwx`, group and other `r-x`). Ownership information is not stored.
This is deliberate, and well-explained by [this post](https://web.archive.org/web/20110209091736/http://git.661346.n2.nabble.com/why-not-preserve-file-permissions-... |
27407343 | How to see how many commits a local branch is ahead/behind another local branch in git? | 17 | 2014-12-10 17:35:47 | <p>If I'm working on a feature branch, I would like to know how many commits this branch is ahead or behind the master branch. I can't seem to find the command that does this.</p>
| 12,479 | 371,699 | 2014-12-10 18:27:51 | 27,408,246 | 24 | 2014-12-10 18:27:51 | 1,256,452 | 2014-12-10 18:27:51 | https://stackoverflow.com/q/27407343 | https://stackoverflow.com/a/27408246 | <h3>Listing and counting commits: <code>git rev-list</code></h3>
<p>A quick way is to do what <code>git status</code> does when there's an "upstream". Specifically, <code>git status</code> simply counts revisions that are on the current branch that are not on the upstream branch. For instance, consider branch <code>... | <h3>Listing and counting commits: <code>git rev-list</code></h3> <p>A quick way is to do what <code>git status</code> does when there's an "upstream". Specifically, <code>git status</code> simply counts revisions that are on the current branch that are not on the upstream branch. For instance, consider branch <code>... | 119 | git | <h1>How to see how many commits a local branch is ahead/behind another local branch in git?</h1>
<p>If I'm working on a feature branch, I would like to know how many commits this branch is ahead or behind the master branch. I can't seem to find the command that does this.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,813 | git | # How to see how many commits a local branch is ahead/behind another local branch in git?
If I'm working on a feature branch, I would like to know how many commits this branch is ahead or behind the master branch. I can't seem to find the command that does this. | ### Listing and counting commits: `git rev-list`
A quick way is to do what `git status` does when there's an "upstream". Specifically, `git status` simply counts revisions that are on the current branch that are not on the upstream branch. For instance, consider branch `foo` that has an upstream of `origin/foo`, and s... |
15463795 | How to copy a local repository to remote server using git? | 17 | 2013-03-17 17:25:04 | <p>I'm trying to use git to deploy my local code in my remote server.</p>
<p>So here is what I've done in my <b>local</b> folder mywebsite/ :</p>
<pre><code>git init
git add .
git commit -m "Initial commit"
</code></pre>
<p>Then, on my <b>web server</b> :</p>
<pre><code>mkdir ~/public_html/myrepo.git
cd myrepo.git
... | 14,815 | 1,456,355 | 2015-09-13 20:18:39 | 15,463,973 | 24 | 2013-03-17 17:40:59 | 1,286,639 | 2013-03-17 17:40:59 | https://stackoverflow.com/q/15463795 | https://stackoverflow.com/a/15463973 | <p>You've created a remote repository without a working directory (which is the purpose of the <code>--bare</code> option). What you need to do next is clone that remote repository into your website directory. I use the same approach; I have a ~/git directory with one or more bare git repositories and then clones for... | <p>You've created a remote repository without a working directory (which is the purpose of the <code>--bare</code> option). What you need to do next is clone that remote repository into your website directory. I use the same approach; I have a ~/git directory with one or more bare git repositories and then clones for... | 119 | git | <h1>How to copy a local repository to remote server using git?</h1>
<p>I'm trying to use git to deploy my local code in my remote server.</p>
<p>So here is what I've done in my <b>local</b> folder mywebsite/ :</p>
<pre><code>git init
git add .
git commit -m "Initial commit"
</code></pre>
<p>Then, on my <b>web server... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,814 | git | # How to copy a local repository to remote server using git?
I'm trying to use git to deploy my local code in my remote server.
So here is what I've done in my **local** folder mywebsite/ :
```
git init
git add .
git commit -m "Initial commit"
```
Then, on my **web server** :
```
mkdir ~/public_html/myrepo.git
cd ... | You've created a remote repository without a working directory (which is the purpose of the `--bare` option). What you need to do next is clone that remote repository into your website directory. I use the same approach; I have a ~/git directory with one or more bare git repositories and then clones for one or more web... |
6390966 | Disable tag deletion | 17 | 2011-06-17 19:43:32 | <p>I have a central bare repository in which a team publish (push) their commits.
In this main repository, I want to disable the tag deletion and renaming.</p>
<p>Is there a solution like a hook or something ?</p>
| 6,016 | 803,850 | 2015-08-29 17:36:07 | 6,391,028 | 24 | 2011-06-17 19:48:25 | 712,605 | 2011-06-17 19:59:52 | https://stackoverflow.com/q/6390966 | https://stackoverflow.com/a/6391028 | <p><code>git help hooks</code> contains documentation about the hooks. The <code>update</code> hook is invoked when Git is about to create/move/delete a reference. It is called once per reference to be updated, and is given:</p>
<ul>
<li>1st argument: the reference name (e.g., refs/tags/v1.0)</li>
<li>2nd argument:... | <p><code>git help hooks</code> contains documentation about the hooks. The <code>update</code> hook is invoked when Git is about to create/move/delete a reference. It is called once per reference to be updated, and is given:</p> <ul> <li>1st argument: the reference name (e.g., refs/tags/v1.0)</li> <li>2nd argument:... | 115, 119 | git, tags | <h1>Disable tag deletion</h1>
<p>I have a central bare repository in which a team publish (push) their commits.
In this main repository, I want to disable the tag deletion and renaming.</p>
<p>Is there a solution like a hook or something ?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,815 | git | # Disable tag deletion
I have a central bare repository in which a team publish (push) their commits.
In this main repository, I want to disable the tag deletion and renaming.
Is there a solution like a hook or something ? | `git help hooks` contains documentation about the hooks. The `update` hook is invoked when Git is about to create/move/delete a reference. It is called once per reference to be updated, and is given:
- 1st argument: the reference name (e.g., refs/tags/v1.0)
- 2nd argument: SHA1 of the object where the reference curren... |
3876206 | How do I view a Git repository's receive history? | 17 | 2010-10-06 19:34:50 | <p>We have a "central" repository that we use to deploy to our development server.</p>
<p>I know <code>git log</code> will show me commits and the date/time they were committed, but I'd like to see when commits were pushed to/received by the repository. Is there a way to do this?</p>
| 5,075 | 468,388 | 2025-02-14 16:57:00 | 3,877,483 | 24 | 2010-10-06 22:51:50 | 193,688 | 2018-03-16 12:17:00 | https://stackoverflow.com/q/3876206 | https://stackoverflow.com/a/3877483 | <p>Gitβs <a href="https://git-scm.com/docs/git-reflog" rel="nofollow noreferrer">reflogs</a> will record your specified data (date, and new tip commit).</p>
<p>If your central repository is bare, then its reflogs are probably not enabled (they are not enabled by default when creating a bare repository). Enable them li... | <p>Gitβs <a href="https://git-scm.com/docs/git-reflog" rel="nofollow noreferrer">reflogs</a> will record your specified data (date, and new tip commit).</p> <p>If your central repository is bare, then its reflogs are probably not enabled (they are not enabled by default when creating a bare repository). Enable them li... | 119 | git | <h1>How do I view a Git repository's receive history?</h1>
<p>We have a "central" repository that we use to deploy to our development server.</p>
<p>I know <code>git log</code> will show me commits and the date/time they were committed, but I'd like to see when commits were pushed to/received by the repositor... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,816 | git | # How do I view a Git repository's receive history?
We have a "central" repository that we use to deploy to our development server.
I know `git log` will show me commits and the date/time they were committed, but I'd like to see when commits were pushed to/received by the repository. Is there a way to do this? | Gitβs [reflogs](https://git-scm.com/docs/git-reflog) will record your specified data (date, and new tip commit).
If your central repository is bare, then its reflogs are probably not enabled (they are not enabled by default when creating a bare repository). Enable them like this:
```
git config core.logAllRefUpdates ... |
48324376 | What exactly does `git rebase --skip` skip during a rebase? | 16 | 2018-01-18 15:07:23 | <p>When you perform a rebase, git asks for manual intervention if it can't resolve differences between your current branch and the new base branch.</p>
<p>If you resolve conflicts and type <code>git rebase --continue</code>, git treats the resolved code as the 'new code' for that commit.</p>
<p>But what happens when ... | 11,604 | 7,028,216 | 2019-05-30 15:55:23 | 48,324,452 | 24 | 2018-01-18 15:11:12 | 1,440,565 | 2019-05-30 15:55:23 | https://stackoverflow.com/q/48324376 | https://stackoverflow.com/a/48324452 | <p>If there is a conflict, <code>git rebase --skip</code> simply skips the entire commit. The changes from that commit will not be in the history after the rebase finishes successfully. Let's look at an example</p>
<pre><code>A-B-C <- master
\
D-E <- foo
</code></pre>
<p>Now say D causes a conflict after</p>... | <p>If there is a conflict, <code>git rebase --skip</code> simply skips the entire commit. The changes from that commit will not be in the history after the rebase finishes successfully. Let's look at an example</p> <pre><code>A-B-C <- master \ D-E <- foo </code></pre> <p>Now say D causes a conflict after</p>... | 119 | git | <h1>What exactly does `git rebase --skip` skip during a rebase?</h1>
<p>When you perform a rebase, git asks for manual intervention if it can't resolve differences between your current branch and the new base branch.</p>
<p>If you resolve conflicts and type <code>git rebase --continue</code>, git treats the resolved c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,819 | git | # What exactly does `git rebase --skip` skip during a rebase?
When you perform a rebase, git asks for manual intervention if it can't resolve differences between your current branch and the new base branch.
If you resolve conflicts and type `git rebase --continue`, git treats the resolved code as the 'new code' for t... | If there is a conflict, `git rebase --skip` simply skips the entire commit. The changes from that commit will not be in the history after the rebase finishes successfully. Let's look at an example
```
A-B-C <- master
\
D-E <- foo
```
Now say D causes a conflict after
```
git checkout foo
git rebase master
```
Th... |
34825675 | IntelliJ annotate vs git blame | 16 | 2016-01-16 09:57:43 | <p>I am using IntelliJ's annotate feature to see in the editor who last changed a line in a file. </p>
<p>Now I am using JGit to read the same annotations and they differ. For me it seems that Intellij checks that a line has not been changed between commits and still uses the old commit message. JGit does not see it a... | 23,425 | 430,035 | 2021-10-25 06:51:50 | 34,825,743 | 24 | 2016-01-16 10:07:49 | 147,024 | 2016-01-16 10:07:49 | https://stackoverflow.com/q/34825675 | https://stackoverflow.com/a/34825743 | <p>IntelliJ IDEA does not have its own algorithm for calculating annotations; it simply runs the standard <code>git blame</code> command and parses its output. There is no way to force it to behave differently.</p>
<p>You can find the code implementing the Annotate command in the IntelliJ IDEA Git plugin <a href="http... | <p>IntelliJ IDEA does not have its own algorithm for calculating annotations; it simply runs the standard <code>git blame</code> command and parses its output. There is no way to force it to behave differently.</p> <p>You can find the code implementing the Annotate command in the IntelliJ IDEA Git plugin <a href="http... | 119, 8945, 61058, 105902 | git, git-blame, intellij-idea, jgit | <h1>IntelliJ annotate vs git blame</h1>
<p>I am using IntelliJ's annotate feature to see in the editor who last changed a line in a file. </p>
<p>Now I am using JGit to read the same annotations and they differ. For me it seems that Intellij checks that a line has not been changed between commits and still uses the ol... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,820 | git | # IntelliJ annotate vs git blame
I am using IntelliJ's annotate feature to see in the editor who last changed a line in a file.
Now I am using JGit to read the same annotations and they differ. For me it seems that Intellij checks that a line has not been changed between commits and still uses the old commit message.... | IntelliJ IDEA does not have its own algorithm for calculating annotations; it simply runs the standard `git blame` command and parses its output. There is no way to force it to behave differently.
You can find the code implementing the Annotate command in the IntelliJ IDEA Git plugin [here](https://github.com/JetBrain... |
10737966 | undoing git merge after merge.renameLimit warning plus conflicts | 16 | 2012-05-24 12:58:24 | <p>I am trying to do a merge squash from a devel branch into the master.</p>
<pre><code>stefanos-imac:trunk borini$ git merge --squash devel
CONFLICT (content): Merge conflict in test1
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your merge.renamelimit variable to a... | 14,408 | 78,374 | 2016-01-01 13:44:48 | 10,738,171 | 24 | 2012-05-24 13:11:07 | 269,483 | 2012-05-24 13:11:07 | https://stackoverflow.com/q/10737966 | https://stackoverflow.com/a/10738171 | <p>Em, <code>git reset --hard origin/master</code>?</p>
| <p>Em, <code>git reset --hard origin/master</code>?</p> | 119, 456, 28897 | git, git-merge, version-control | <h1>undoing git merge after merge.renameLimit warning plus conflicts</h1>
<p>I am trying to do a merge squash from a devel branch into the master.</p>
<pre><code>stefanos-imac:trunk borini$ git merge --squash devel
CONFLICT (content): Merge conflict in test1
warning: inexact rename detection was skipped due to too man... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,821 | git | # undoing git merge after merge.renameLimit warning plus conflicts
I am trying to do a merge squash from a devel branch into the master.
```
stefanos-imac:trunk borini$ git merge --squash devel
CONFLICT (content): Merge conflict in test1
warning: inexact rename detection was skipped due to too many files.
warning: yo... | Em, `git reset --hard origin/master`? |
6240808 | count line changes with git? | 16 | 2011-06-05 03:19:41 | <p>Is there a simple way I can ask git for the amount of lines I added (or add and removed) in a specific date range?</p>
<p>I'm using git on Windows, Linux and TortoiseGit(Windows)</p>
| 6,903 | null | 2018-05-20 03:14:49 | 6,241,539 | 24 | 2011-06-05 07:27:22 | 78,845 | 2012-12-15 20:16:13 | https://stackoverflow.com/q/6240808 | https://stackoverflow.com/a/6241539 | <p>Building upon <a href="https://stackoverflow.com/questions/6240808/count-line-changes-with-git/6240832#6240832">Seth Robertson's answer</a>, (+1 Seth!) <code>awk</code> will tally up the columns for you:</p>
<pre><code>% git log --stat --author $(git config --get user.email) --since="last year" --until="last month"... | <p>Building upon <a href="https://stackoverflow.com/questions/6240808/count-line-changes-with-git/6240832#6240832">Seth Robertson's answer</a>, (+1 Seth!) <code>awk</code> will tally up the columns for you:</p> <pre><code>% git log --stat --author $(git config --get user.email) --since="last year" --until="last month"... | 119, 31409 | git, tortoisegit | <h1>count line changes with git?</h1>
<p>Is there a simple way I can ask git for the amount of lines I added (or add and removed) in a specific date range?</p>
<p>I'm using git on Windows, Linux and TortoiseGit(Windows)</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,822 | git | # count line changes with git?
Is there a simple way I can ask git for the amount of lines I added (or add and removed) in a specific date range?
I'm using git on Windows, Linux and TortoiseGit(Windows) | Building upon [Seth Robertson's answer](https://stackoverflow.com/questions/6240808/count-line-changes-with-git/6240832#6240832), (+1 Seth!) `awk` will tally up the columns for you:
```
% git log --stat --author $(git config --get user.email) --since="last year" --until="last month" | awk -F',' '/files? changed/ {
... |
1664801 | How do I merge a single commit? | 16 | 2009-11-03 02:06:28 | <p>Sometimes I'm working with several branches at once. Say I have branches called master, release-1.1, and experimental. I create a new file or make a change in experimental and I want that one single change to apply to the other branches.</p>
<p>Can I do this in git? If I simply merge the commit into another bran... | 2,588 | 126,855 | 2009-11-03 08:54:10 | 1,664,814 | 24 | 2009-11-03 02:10:05 | 28,804 | 2009-11-03 02:10:05 | https://stackoverflow.com/q/1664801 | https://stackoverflow.com/a/1664814 | <p>What you want to do is called <a href="http://www.kernel.org/pub/software/scm/git/docs/git-cherry-pick.html" rel="noreferrer">cherry picking</a>. You can <em>cherry pick</em> a single commit using the following command:</p>
<pre><code>$ git cherry-pick <commit hash or name>
</code></pre>
<p>This will incorpo... | <p>What you want to do is called <a href="http://www.kernel.org/pub/software/scm/git/docs/git-cherry-pick.html" rel="noreferrer">cherry picking</a>. You can <em>cherry pick</em> a single commit using the following command:</p> <pre><code>$ git cherry-pick <commit hash or name> </code></pre> <p>This will incorpo... | 119, 717, 5597 | commit, git, merge | <h1>How do I merge a single commit?</h1>
<p>Sometimes I'm working with several branches at once. Say I have branches called master, release-1.1, and experimental. I create a new file or make a change in experimental and I want that one single change to apply to the other branches.</p>
<p>Can I do this in git? If I ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,823 | git | # How do I merge a single commit?
Sometimes I'm working with several branches at once. Say I have branches called master, release-1.1, and experimental. I create a new file or make a change in experimental and I want that one single change to apply to the other branches.
Can I do this in git? If I simply merge the co... | What you want to do is called [cherry picking](http://www.kernel.org/pub/software/scm/git/docs/git-cherry-pick.html). You can *cherry pick* a single commit using the following command:
```
$ git cherry-pick <commit hash or name>
```
This will incorporate the change from that commit *only* into your current branch. No... |
51353961 | Mistakenly committed to master locally. How to move changes to branch? | 15 | 2018-07-16 02:48:42 | <p>I made a number of changes that could break the code. I thought I was in a branch but was in master when I committed. Is there any way to move the 4 local commits to a branch locally and then push?</p>
| 24,545 | 233,928 | 2022-03-08 18:35:45 | 51,356,968 | 24 | 2018-07-16 07:50:39 | 9,649,501 | 2018-11-18 15:12:51 | https://stackoverflow.com/q/51353961 | https://stackoverflow.com/a/51356968 | <p>Going by the details you said (4 commits), you could do this:</p>
<pre><code>git branch new-branch-name-here
# new commits on branch
git checkout master
git reset HEAD~4
# move HEAD (master) 4 commits back, commits are no longer on master
# note: that's a ~ (tilde, above your Tab), not a - (dash).
git push origin n... | <p>Going by the details you said (4 commits), you could do this:</p> <pre><code>git branch new-branch-name-here # new commits on branch git checkout master git reset HEAD~4 # move HEAD (master) 4 commits back, commits are no longer on master # note: that's a ~ (tilde, above your Tab), not a - (dash). git push origin n... | 119, 1879 | branch, git | <h1>Mistakenly committed to master locally. How to move changes to branch?</h1>
<p>I made a number of changes that could break the code. I thought I was in a branch but was in master when I committed. Is there any way to move the 4 local commits to a branch locally and then push?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,824 | git | # Mistakenly committed to master locally. How to move changes to branch?
I made a number of changes that could break the code. I thought I was in a branch but was in master when I committed. Is there any way to move the 4 local commits to a branch locally and then push? | Going by the details you said (4 commits), you could do this:
```
git branch new-branch-name-here
# new commits on branch
git checkout master
git reset HEAD~4
# move HEAD (master) 4 commits back, commits are no longer on master
# note: that's a ~ (tilde, above your Tab), not a - (dash).
git push origin new-branch-name... |
15948202 | How can I find the first commit of a branch? | 15 | 2013-04-11 11:58:24 | <p>Assume the following graph:</p>
<pre><code>A -- B -- C -- D -- E -- F
\
G -- H -- I
</code></pre>
<p>I would like to find <code>G</code> in order to be able to an interactive rebase to squash the commits (but still keep one commit on the topic branch) which will be reviewed and merged later. I don't w... | 11,173 | 140,367 | 2017-09-15 02:59:37 | 15,949,920 | 24 | 2013-04-11 13:22:06 | 758,345 | 2017-09-15 02:59:37 | https://stackoverflow.com/q/15948202 | https://stackoverflow.com/a/15949920 | <p>There are no commits βon a branchβ in git. There are only commits <em>reachable</em> from a branch. And that information is not a very good indicator of what branch that commit originally belonged to. So I see two ways to interpret your question:</p>
<ul>
<li>I want to find the first commit after the merge-base of ... | <p>There are no commits βon a branchβ in git. There are only commits <em>reachable</em> from a branch. And that information is not a very good indicator of what branch that commit originally belonged to. So I see two ways to interpret your question:</p> <ul> <li>I want to find the first commit after the merge-base of ... | 119 | git | <h1>How can I find the first commit of a branch?</h1>
<p>Assume the following graph:</p>
<pre><code>A -- B -- C -- D -- E -- F
\
G -- H -- I
</code></pre>
<p>I would like to find <code>G</code> in order to be able to an interactive rebase to squash the commits (but still keep one commit on the topic bran... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,825 | git | # How can I find the first commit of a branch?
Assume the following graph:
```
A -- B -- C -- D -- E -- F
\
G -- H -- I
```
I would like to find `G` in order to be able to an interactive rebase to squash the commits (but still keep one commit on the topic branch) which will be reviewed and merged later.... | There are no commits βon a branchβ in git. There are only commits *reachable* from a branch. And that information is not a very good indicator of what branch that commit originally belonged to. So I see two ways to interpret your question:
- I want to find the first commit after the merge-base of `branch` and `master`... |
14011998 | Setting path to git executable in RStudio under OSX Mountain Lion | 15 | 2012-12-23 15:06:28 | <p>I am running RStudio v. 0.97.237 under Mac OSX v. 10.8.2 (Mountain Lion). I am trying to set the path to my git executable file in RStudio. The correct path is /usr/local/git. There is a preference setting in RStudio for entering the path to the Git executable file (Preferences..., Git/SVN, Git executable). If I co... | 11,499 | 1,913,594 | 2014-05-19 11:44:40 | 14,021,696 | 24 | 2012-12-24 12:54:05 | 1,913,594 | 2012-12-24 12:54:05 | https://stackoverflow.com/q/14011998 | https://stackoverflow.com/a/14021696 | <p>I was able to find the answer to my question, courtesy of <a href="http://osxdaily.com/2009/02/25/show-hidden-files-in-os-x/" rel="noreferrer">http://osxdaily.com/2009/02/25/show-hidden-files-in-os-x/</a> and
<a href="http://support.rstudio.org/help/discussions/problems/2907-no-svn-in-mountain-lion" rel="noreferrer"... | <p>I was able to find the answer to my question, courtesy of <a href="http://osxdaily.com/2009/02/25/show-hidden-files-in-os-x/" rel="noreferrer">http://osxdaily.com/2009/02/25/show-hidden-files-in-os-x/</a> and <a href="http://support.rstudio.org/help/discussions/problems/2907-no-svn-in-mountain-lion" rel="noreferrer"... | 119, 67746, 77491 | git, osx-mountain-lion, rstudio | <h1>Setting path to git executable in RStudio under OSX Mountain Lion</h1>
<p>I am running RStudio v. 0.97.237 under Mac OSX v. 10.8.2 (Mountain Lion). I am trying to set the path to my git executable file in RStudio. The correct path is /usr/local/git. There is a preference setting in RStudio for entering the path to ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,826 | git | # Setting path to git executable in RStudio under OSX Mountain Lion
I am running RStudio v. 0.97.237 under Mac OSX v. 10.8.2 (Mountain Lion). I am trying to set the path to my git executable file in RStudio. The correct path is /usr/local/git. There is a preference setting in RStudio for entering the path to the Git e... | I was able to find the answer to my question, courtesy of <http://osxdaily.com/2009/02/25/show-hidden-files-in-os-x/> and
<http://support.rstudio.org/help/discussions/problems/2907-no-svn-in-mountain-lion>.
To make sure you have the correct path to the Git executable file: open a terminal window, and type:
```
$ whic... |
5914681 | Git-svn: Bulk removing orphaned remote branches | 15 | 2011-05-06 17:01:21 | <p>A project in SVN I'm working on (via git-svn) has frequently-created branches that are then --reintegrated with trunk, and then deleted. </p>
<p>Right now the project has about 10 branches that have not been deleted, but in git, git branch -r shows about 50.</p>
<p>I can remove these one at a time, checking whethe... | 5,281 | 311,499 | 2015-09-14 11:44:03 | 7,209,462 | 24 | 2011-08-26 19:10:44 | 387,239 | 2011-08-26 19:10:44 | https://stackoverflow.com/q/5914681 | https://stackoverflow.com/a/7209462 | <p>This is a quick-n-dirty solution I made in a few minutes. It makes use of nice regex patterns that are not available everywhere.</p>
<p>This grabs a clean list of branches. I remove formatting spaces at the beginning of each line, and I'm ignoring tags for now:</p>
<pre><code>git branch -r | sed 's|^[[:space:]]*||... | <p>This is a quick-n-dirty solution I made in a few minutes. It makes use of nice regex patterns that are not available everywhere.</p> <p>This grabs a clean list of branches. I remove formatting spaces at the beginning of each line, and I'm ignoring tags for now:</p> <pre><code>git branch -r | sed 's|^[[:space:]]*||... | 119, 6452 | git, git-svn | <h1>Git-svn: Bulk removing orphaned remote branches</h1>
<p>A project in SVN I'm working on (via git-svn) has frequently-created branches that are then --reintegrated with trunk, and then deleted. </p>
<p>Right now the project has about 10 branches that have not been deleted, but in git, git branch -r shows about 50.<... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,827 | git | # Git-svn: Bulk removing orphaned remote branches
A project in SVN I'm working on (via git-svn) has frequently-created branches that are then --reintegrated with trunk, and then deleted.
Right now the project has about 10 branches that have not been deleted, but in git, git branch -r shows about 50.
I can remove the... | This is a quick-n-dirty solution I made in a few minutes. It makes use of nice regex patterns that are not available everywhere.
This grabs a clean list of branches. I remove formatting spaces at the beginning of each line, and I'm ignoring tags for now:
```
git branch -r | sed 's|^[[:space:]]*||' | grep -v '^tags/' ... |
3282377 | git-svn fetch/rebase failing after trying to repair a corrupted file | 15 | 2010-07-19 15:18:35 | <p>I recently had a corrupted object in my repository, pointing on my HEAD (the object was empty) . It happened after interrupting a git-svn command. Then, I restored my repository by changing manually the refs on this object.</p>
<p>Now, I want to synchronize my git repository with SVN, but git svn fetch returns:</p... | 4,186 | 395,948 | 2011-05-20 15:14:38 | 3,282,594 | 24 | 2010-07-19 15:42:56 | 112,968 | 2011-05-20 15:14:38 | https://stackoverflow.com/q/3282377 | https://stackoverflow.com/a/3282594 | <p>if you have svn metadata stored with your commit messages (those <code>http://svn.β¦./svn/trunk@r12331 (<id>)</code>), you can delete the <code>.rev_map.<id></code> files from the <code>.git/svn/β¦</code> directories.</p>
<p>git-svn will then re-create them before running the next command.</p>
<p>Edit:
W... | <p>if you have svn metadata stored with your commit messages (those <code>http://svn.β¦./svn/trunk@r12331 (<id>)</code>), you can delete the <code>.rev_map.<id></code> files from the <code>.git/svn/β¦</code> directories.</p> <p>git-svn will then re-create them before running the next command.</p> <p>Edit: W... | 119, 6452 | git, git-svn | <h1>git-svn fetch/rebase failing after trying to repair a corrupted file</h1>
<p>I recently had a corrupted object in my repository, pointing on my HEAD (the object was empty) . It happened after interrupting a git-svn command. Then, I restored my repository by changing manually the refs on this object.</p>
<p>Now, I... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,828 | git | # git-svn fetch/rebase failing after trying to repair a corrupted file
I recently had a corrupted object in my repository, pointing on my HEAD (the object was empty) . It happened after interrupting a git-svn command. Then, I restored my repository by changing manually the refs on this object.
Now, I want to synchron... | if you have svn metadata stored with your commit messages (those `http://svn.β¦./svn/trunk@r12331 (<id>)`), you can delete the `.rev_map.<id>` files from the `.git/svn/β¦` directories.
git-svn will then re-create them before running the next command.
Edit:
When running `git gc` if you see output along the lines of:
``... |
579871 | Can I make vim respect my .gitignore files? | 15 | 2009-02-23 23:38:18 | <p>I was wondering if there is a way to get vim to read .gitignore files and use them to determine options not to present when auto-completing filenames. </p>
<p>For example, working in python, I'd like to not see .pyc files offered for editing. I think vim has its own mechanism for this, I was wondering how to load i... | 6,637 | 37,984 | 2022-07-15 22:26:03 | 581,860 | 24 | 2009-02-24 14:05:26 | 21,632 | 2009-02-24 14:05:26 | https://stackoverflow.com/q/579871 | https://stackoverflow.com/a/581860 | <p>As suggested by @dwc, here's a vim script:</p>
<pre><code>let filename = '.gitignore'
if filereadable(filename)
let igstring = ''
for oline in readfile(filename)
let line = substitute(oline, '\s|\n|\r', '', "g")
if line =~ '^#' | con | endif
if line == '' | con | endif
if li... | <p>As suggested by @dwc, here's a vim script:</p> <pre><code>let filename = '.gitignore' if filereadable(filename) let igstring = '' for oline in readfile(filename) let line = substitute(oline, '\s|\n|\r', '', "g") if line =~ '^#' | con | endif if line == '' | con | endif if li... | 119, 370, 25056 | git, gitignore, vim | <h1>Can I make vim respect my .gitignore files?</h1>
<p>I was wondering if there is a way to get vim to read .gitignore files and use them to determine options not to present when auto-completing filenames. </p>
<p>For example, working in python, I'd like to not see .pyc files offered for editing. I think vim has its ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,829 | git | # Can I make vim respect my .gitignore files?
I was wondering if there is a way to get vim to read .gitignore files and use them to determine options not to present when auto-completing filenames.
For example, working in python, I'd like to not see .pyc files offered for editing. I think vim has its own mechanism for... | As suggested by @dwc, here's a vim script:
```
let filename = '.gitignore'
if filereadable(filename)
let igstring = ''
for oline in readfile(filename)
let line = substitute(oline, '\s|\n|\r', '', "g")
if line =~ '^#' | con | endif
if line == '' | con | endif
if line =~ '^!' | c... |
52975103 | How can I recover the commit message when the git commit-msg hook fails? | 14 | 2018-10-24 17:44:53 | <p>I'm using one of git's hooks <code>commit-msg</code> to validate a commit message for certain format and contents.</p>
<p>However, whenever a commit message fails the hook, I have sometimes lost a paragraph or more of text from my message.</p>
<p>I've played around with saving it off somewhere, but I'm not sure ho... | 5,659 | 1,153,105 | 2024-11-13 17:56:19 | 52,976,498 | 24 | 2018-10-24 19:21:28 | 10,470,287 | 2018-10-24 19:21:28 | https://stackoverflow.com/q/52975103 | https://stackoverflow.com/a/52976498 | <p>The commit message is stored in <code>.git/COMMIT_EDITMSG</code>. After a "failed" committing attempt, you could run:</p>
<pre><code>git commit --edit --file=.git/COMMIT_EDITMSG
</code></pre>
<p>or shorter, e.g.:</p>
<pre><code>git commit -eF .git/COMMIT_EDITMSG
</code></pre>
<p>which will load the bad commit me... | <p>The commit message is stored in <code>.git/COMMIT_EDITMSG</code>. After a "failed" committing attempt, you could run:</p> <pre><code>git commit --edit --file=.git/COMMIT_EDITMSG </code></pre> <p>or shorter, e.g.:</p> <pre><code>git commit -eF .git/COMMIT_EDITMSG </code></pre> <p>which will load the bad commit me... | 119, 43087, 53850 | git, git-commit, githooks | <h1>How can I recover the commit message when the git commit-msg hook fails?</h1>
<p>I'm using one of git's hooks <code>commit-msg</code> to validate a commit message for certain format and contents.</p>
<p>However, whenever a commit message fails the hook, I have sometimes lost a paragraph or more of text from my mes... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,831 | git | # How can I recover the commit message when the git commit-msg hook fails?
I'm using one of git's hooks `commit-msg` to validate a commit message for certain format and contents.
However, whenever a commit message fails the hook, I have sometimes lost a paragraph or more of text from my message.
I've played around w... | The commit message is stored in `.git/COMMIT_EDITMSG`. After a "failed" committing attempt, you could run:
```
git commit --edit --file=.git/COMMIT_EDITMSG
```
or shorter, e.g.:
```
git commit -eF .git/COMMIT_EDITMSG
```
which will load the bad commit message in your `$EDITOR` (or the editor you set up in your Git ... |
52472435 | Why doesn't Git natively support UTF-16? | 14 | 2018-09-24 03:47:20 | <p>Git supports several different encoding schemes, <a href="https://en.wikipedia.org/wiki/UTF-7" rel="nofollow noreferrer">UTF-7</a>, <a href="https://en.wikipedia.org/wiki/UTF-8" rel="nofollow noreferrer">UTF-8</a>, and <a href="https://en.wikipedia.org/wiki/UTF-32" rel="nofollow noreferrer">UTF-32</a>, as well as no... | 6,362 | 6,617,427 | 2022-03-08 20:55:30 | 52,474,068 | 24 | 2018-09-24 06:57:24 | 1,256,452 | 2022-02-18 22:59:34 | https://stackoverflow.com/q/52472435 | https://stackoverflow.com/a/52474068 | <p>I devote a significant chunk of a full chapter of my (currently rather moribund) <a href="http://web.torek.net/torek/tmp/book.pdf" rel="nofollow noreferrer">book (see Chapter 3, which is in better shape than later chapters)</a> to the issue of character encoding, because it is a historical mess. It's worth mentioni... | <p>I devote a significant chunk of a full chapter of my (currently rather moribund) <a href="http://web.torek.net/torek/tmp/book.pdf" rel="nofollow noreferrer">book (see Chapter 3, which is in better shape than later chapters)</a> to the issue of character encoding, because it is a historical mess. It's worth mentioni... | 119, 10016 | git, utf-16 | <h1>Why doesn't Git natively support UTF-16?</h1>
<p>Git supports several different encoding schemes, <a href="https://en.wikipedia.org/wiki/UTF-7" rel="nofollow noreferrer">UTF-7</a>, <a href="https://en.wikipedia.org/wiki/UTF-8" rel="nofollow noreferrer">UTF-8</a>, and <a href="https://en.wikipedia.org/wiki/UTF-32" r... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,832 | git | # Why doesn't Git natively support UTF-16?
Git supports several different encoding schemes, [UTF-7](https://en.wikipedia.org/wiki/UTF-7), [UTF-8](https://en.wikipedia.org/wiki/UTF-8), and [UTF-32](https://en.wikipedia.org/wiki/UTF-32), as well as non-UTF ones.
Given this, why doesn't it support UTF-16?
There's a lot... | I devote a significant chunk of a full chapter of my (currently rather moribund) [book (see Chapter 3, which is in better shape than later chapters)](http://web.torek.net/torek/tmp/book.pdf) to the issue of character encoding, because it is a historical mess. It's worth mentioning here, though, that part of the premise... |
39612846 | what does the hash from `git describe` refer to? | 14 | 2016-09-21 09:38:45 | <pre><code>$ git describe --tags --long
test-1-g3c31c73
\_ ???
</code></pre>
<p>The <code>g3c31c73</code> doesn't seem to point to anything... The <a href="https://git-scm.com/docs/git-describe" rel="noreferrer">doc</a> says it's <em>the abbreviated object name of the most recent commit</em>, but it's not t... | 3,414 | 927,631 | 2017-10-27 07:25:20 | 39,613,204 | 24 | 2016-09-21 09:53:25 | 440,564 | 2017-10-27 07:25:20 | https://stackoverflow.com/q/39612846 | https://stackoverflow.com/a/39613204 | <p>The "g" isn't a part of the commit.</p>
<p>Try looking for a commit <code>3c31c73</code> using <code>git show 3c31c73</code>.</p>
<p>From the <a href="https://git-scm.com/docs/git-describe#_examples" rel="noreferrer">git-describe doc</a>:</p>
<blockquote>
<p>The "g" prefix stands for "git" and is used to allow ... | <p>The "g" isn't a part of the commit.</p> <p>Try looking for a commit <code>3c31c73</code> using <code>git show 3c31c73</code>.</p> <p>From the <a href="https://git-scm.com/docs/git-describe#_examples" rel="noreferrer">git-describe doc</a>:</p> <blockquote> <p>The "g" prefix stands for "git" and is used to allow ... | 119, 80455, 117987 | git, git-describe, git-hash | <h1>what does the hash from `git describe` refer to?</h1>
<pre><code>$ git describe --tags --long
test-1-g3c31c73
\_ ???
</code></pre>
<p>The <code>g3c31c73</code> doesn't seem to point to anything... The <a href="https://git-scm.com/docs/git-describe" rel="noreferrer">doc</a> says it's <em>the abbreviated ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,833 | git | # what does the hash from `git describe` refer to?
```
$ git describe --tags --long
test-1-g3c31c73
\_ ???
```
The `g3c31c73` doesn't seem to point to anything... The [doc](https://git-scm.com/docs/git-describe) says it's *the abbreviated object name of the most recent commit*, but it's not the HEAD commit... | The "g" isn't a part of the commit.
Try looking for a commit `3c31c73` using `git show 3c31c73`.
From the [git-describe doc](https://git-scm.com/docs/git-describe#_examples):
> The "g" prefix stands for "git" and is used to allow describing the version of a software depending on the SCM the software is managed with.... |
22246907 | Move running merge of git to beyond compare | 14 | 2014-03-07 09:59:47 | <p>I made certain changes in my local branch. I didn't commit. I just indexed all changes and moved them to stash.
Now I did a</p>
<pre><code>git pull
</code></pre>
<p>After git pull I did</p>
<pre><code>git stash apply
</code></pre>
<p>Now there are some conflicts. In eclipse I am able to see the conflicts in norm... | 12,293 | 1,450,832 | 2021-02-17 09:18:49 | 22,247,085 | 24 | 2014-03-07 10:06:22 | null | 2018-09-12 16:36:05 | https://stackoverflow.com/q/22246907 | https://stackoverflow.com/a/22247085 | <p>I'm assuming that you're okay with launching Beyond Compare from the command line, and that you're on Windows. You can add the following lines to your global <code>.gitconfig</code> file:</p>
<pre class="lang-none prettyprint-override"><code>[merge]
tool = bc3
[diff]
tool = bc3
[difftool "bc3"]
cmd = "\... | <p>I'm assuming that you're okay with launching Beyond Compare from the command line, and that you're on Windows. You can add the following lines to your global <code>.gitconfig</code> file:</p> <pre class="lang-none prettyprint-override"><code>[merge] tool = bc3 [diff] tool = bc3 [difftool "bc3"] cmd = "\... | 119, 28897, 33007 | beyondcompare3, git, git-merge | <h1>Move running merge of git to beyond compare</h1>
<p>I made certain changes in my local branch. I didn't commit. I just indexed all changes and moved them to stash.
Now I did a</p>
<pre><code>git pull
</code></pre>
<p>After git pull I did</p>
<pre><code>git stash apply
</code></pre>
<p>Now there are some conflic... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,834 | git | # Move running merge of git to beyond compare
I made certain changes in my local branch. I didn't commit. I just indexed all changes and moved them to stash.
Now I did a
```
git pull
```
After git pull I did
```
git stash apply
```
Now there are some conflicts. In eclipse I am able to see the conflicts in normal g... | I'm assuming that you're okay with launching Beyond Compare from the command line, and that you're on Windows. You can add the following lines to your global `.gitconfig` file:
```
[merge]
tool = bc3
[diff]
tool = bc3
[difftool "bc3"]
cmd = "\"c:/program files (x86)/beyond compare 3/bcomp.exe\" \"$LOCAL\" ... |
18106638 | Git push new local branch to remote, without having to specify name | 14 | 2013-08-07 14:50:50 | <p>When working on patch fixes for a specific, tracked issue, our workflow looks like:</p>
<pre><code>1. git checkout patch; git pull upstream patch; # make sure we're up-to-date
2. git checkout -b issue-435-db-integrity-exception
3. # code some awesome
4. git commit -am "Fixes issue #435"
5. git push -u origin issue-... | 2,653 | 88,111 | 2025-09-06 10:22:52 | 18,106,859 | 24 | 2013-08-07 15:00:16 | null | 2013-12-09 12:56:20 | https://stackoverflow.com/q/18106638 | https://stackoverflow.com/a/18106859 | <p>You could use the following:</p>
<pre><code># For Git 1.8.5+
git push origin -u @
# For older versions of Git
git push origin -u HEAD
</code></pre>
<p>By using <code>@</code> or <code>HEAD</code>, Git will push the currently checked-out branch to <code>origin</code>, and if the branch doesn't exist on <code>origi... | <p>You could use the following:</p> <pre><code># For Git 1.8.5+ git push origin -u @ # For older versions of Git git push origin -u HEAD </code></pre> <p>By using <code>@</code> or <code>HEAD</code>, Git will push the currently checked-out branch to <code>origin</code>, and if the branch doesn't exist on <code>origi... | 119 | git | <h1>Git push new local branch to remote, without having to specify name</h1>
<p>When working on patch fixes for a specific, tracked issue, our workflow looks like:</p>
<pre><code>1. git checkout patch; git pull upstream patch; # make sure we're up-to-date
2. git checkout -b issue-435-db-integrity-exception
3. # code s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,835 | git | # Git push new local branch to remote, without having to specify name
When working on patch fixes for a specific, tracked issue, our workflow looks like:
```
1. git checkout patch; git pull upstream patch; # make sure we're up-to-date
2. git checkout -b issue-435-db-integrity-exception
3. # code some awesome
4. git c... | You could use the following:
```
# For Git 1.8.5+
git push origin -u @
# For older versions of Git
git push origin -u HEAD
```
By using `@` or `HEAD`, Git will push the currently checked-out branch to `origin`, and if the branch doesn't exist on `origin` yet, it will create it.
So, in your example, if you have `iss... |
11792461 | Visual Studio gitignore and mdf, ldf files | 14 | 2012-08-03 08:54:23 | <p>I have a database project that generates these files and added to gitignore. However they don't seem to be getting ignored and I need to revert them before commiting, quite annoying. The files are still locked by VS, is this a problem?</p>
<pre><code>#
# Windows and Mac OS X Temp Cache Files
#
[Tt]humbs.db
*.DS_Sto... | 4,871 | 27,294 | 2012-08-03 09:07:12 | 11,792,662 | 24 | 2012-08-03 09:07:12 | 520,162 | 2012-08-03 09:07:12 | https://stackoverflow.com/q/11792461 | https://stackoverflow.com/a/11792662 | <blockquote>
<p>I need to revert them before commiting</p>
</blockquote>
<p>indicates that they are already versioned and were entered into <code>.gitignore</code> <strong>after</strong> they were added using <code>git add</code>.</p>
<p>Two possible solutions:</p>
<ol>
<li><p>temporarily take them out of your <co... | <blockquote> <p>I need to revert them before commiting</p> </blockquote> <p>indicates that they are already versioned and were entered into <code>.gitignore</code> <strong>after</strong> they were added using <code>git add</code>.</p> <p>Two possible solutions:</p> <ol> <li><p>temporarily take them out of your <co... | 119, 14456, 25056 | git, gitignore, visual-studio-2010 | <h1>Visual Studio gitignore and mdf, ldf files</h1>
<p>I have a database project that generates these files and added to gitignore. However they don't seem to be getting ignored and I need to revert them before commiting, quite annoying. The files are still locked by VS, is this a problem?</p>
<pre><code>#
# Windows a... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,836 | git | # Visual Studio gitignore and mdf, ldf files
I have a database project that generates these files and added to gitignore. However they don't seem to be getting ignored and I need to revert them before commiting, quite annoying. The files are still locked by VS, is this a problem?
```
#
# Windows and Mac OS X Temp Cac... | > I need to revert them before commiting
indicates that they are already versioned and were entered into `.gitignore` **after** they were added using `git add`.
Two possible solutions:
1. temporarily take them out of your `.gitignore`, then
`git rm --cached -- *.mdf` and
`git rm --cached -- *.ldf`.
Th... |
2030477 | git error "Cannot rewrite branch(es) with a dirty working directory" | 14 | 2010-01-08 20:21:48 | <p><code>"Cannot rewrite branch(es) with a dirty working directory".</code></p>
<p>I am new to Git - I tried <em>googling</em> for an answer to no avail.</p>
<p>What does this error mean? What should/can I do?</p>
| 12,727 | 171,461 | 2010-01-08 20:25:18 | 2,030,496 | 24 | 2010-01-08 20:25:18 | 218,956 | 2010-01-08 20:25:18 | https://stackoverflow.com/q/2030477 | https://stackoverflow.com/a/2030496 | <p>A dirty working directory means you have uncommitted changes to your branch. You can either commit them or stash them. To stash just use:</p>
<pre><code>git stash
</code></pre>
<p>And use this to bring your changes back</p>
<pre><code>git stash apply
</code></pre>
| <p>A dirty working directory means you have uncommitted changes to your branch. You can either commit them or stash them. To stash just use:</p> <pre><code>git stash </code></pre> <p>And use this to bring your changes back</p> <pre><code>git stash apply </code></pre> | 119 | git | <h1>git error "Cannot rewrite branch(es) with a dirty working directory"</h1>
<p><code>"Cannot rewrite branch(es) with a dirty working directory".</code></p>
<p>I am new to Git - I tried <em>googling</em> for an answer to no avail.</p>
<p>What does this error mean? What should/can I do?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,837 | git | # git error "Cannot rewrite branch(es) with a dirty working directory"
`"Cannot rewrite branch(es) with a dirty working directory".`
I am new to Git - I tried *googling* for an answer to no avail.
What does this error mean? What should/can I do? | A dirty working directory means you have uncommitted changes to your branch. You can either commit them or stash them. To stash just use:
```
git stash
```
And use this to bring your changes back
```
git stash apply
``` |
1465398 | "git pull" broken | 14 | 2009-09-23 11:24:31 | <p>I recently upgraded my MacBook Pro to Snow Leopard and "git pull" returns:</p>
<pre><code>rakudo $ git pull
git: 'pull' is not a git-command. See 'git --help'
Did you mean this?
shell
rakudo $ git-pull
-bash: git-pull: command not found
</code></pre>
<p>I've tried reinstalling via macports, but to no avai... | 10,653 | 8,003 | 2020-11-02 10:57:09 | 1,466,029 | 24 | 2009-09-23 13:32:37 | 71,343 | 2009-09-23 13:32:37 | https://stackoverflow.com/q/1465398 | https://stackoverflow.com/a/1466029 | <p>Looking in the source of git, there's a comment in git.c:</p>
<pre><code>/*
* We use PATH to find git commands, but we prepend some higher
* precedence paths: the "--exec-path" option, the GIT_EXEC_PATH
* environment, and the $(gitexecdir) from the Makefile at build
* time.
*/
</code></pre>
<p>If you call <co... | <p>Looking in the source of git, there's a comment in git.c:</p> <pre><code>/* * We use PATH to find git commands, but we prepend some higher * precedence paths: the "--exec-path" option, the GIT_EXEC_PATH * environment, and the $(gitexecdir) from the Makefile at build * time. */ </code></pre> <p>If you call <co... | 119, 369, 32395 | git, macos, osx-snow-leopard | <h1>"git pull" broken</h1>
<p>I recently upgraded my MacBook Pro to Snow Leopard and "git pull" returns:</p>
<pre><code>rakudo $ git pull
git: 'pull' is not a git-command. See 'git --help'
Did you mean this?
shell
rakudo $ git-pull
-bash: git-pull: command not found
</code></pre>
<p>I've tried reinstalling v... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,838 | git | # "git pull" broken
I recently upgraded my MacBook Pro to Snow Leopard and "git pull" returns:
```
rakudo $ git pull
git: 'pull' is not a git-command. See 'git --help'
Did you mean this?
shell
rakudo $ git-pull
-bash: git-pull: command not found
```
I've tried reinstalling via macports, but to no avail. The... | Looking in the source of git, there's a comment in git.c:
```
/*
* We use PATH to find git commands, but we prepend some higher
* precedence paths: the "--exec-path" option, the GIT_EXEC_PATH
* environment, and the $(gitexecdir) from the Makefile at build
* time.
*/
```
If you call `git --exec-path`, you end up ... |
47029731 | Git get latest changes before pushing a branch | 13 | 2017-10-31 07:11:01 | <p>I have a local branch <code>features</code> that I based off of my local <code>master</code> to add some stuff in my code. I am now ready to merge those back into <code>master</code> , however, the state of the remote <code>master</code> branch has changed since then.</p>
<p>How can I get the latest version of mast... | 14,814 | 5,493,420 | 2024-04-02 01:44:32 | 47,029,875 | 24 | 2017-10-31 07:21:42 | 3,026,283 | 2017-10-31 08:20:29 | https://stackoverflow.com/q/47029731 | https://stackoverflow.com/a/47029875 | <ol>
<li>Go to <code>master</code> branch with: <code>git checkout master</code></li>
<li>Update your local <code>master</code> with: <code>git pull origin master</code></li>
<li>Resolve conflicts (if applicable)</li>
<li>Go back to <code>features</code> with: <code>git checkout features</code></li>
<li>Merge <code>mas... | <ol> <li>Go to <code>master</code> branch with: <code>git checkout master</code></li> <li>Update your local <code>master</code> with: <code>git pull origin master</code></li> <li>Resolve conflicts (if applicable)</li> <li>Go back to <code>features</code> with: <code>git checkout features</code></li> <li>Merge <code>mas... | 119, 456, 717, 37230, 53847 | branching-and-merging, git, git-checkout, merge, version-control | <h1>Git get latest changes before pushing a branch</h1>
<p>I have a local branch <code>features</code> that I based off of my local <code>master</code> to add some stuff in my code. I am now ready to merge those back into <code>master</code> , however, the state of the remote <code>master</code> branch has changed sinc... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,839 | git | # Git get latest changes before pushing a branch
I have a local branch `features` that I based off of my local `master` to add some stuff in my code. I am now ready to merge those back into `master` , however, the state of the remote `master` branch has changed since then.
How can I get the latest version of master a... | 1. Go to `master` branch with: `git checkout master`
2. Update your local `master` with: `git pull origin master`
3. Resolve conflicts (if applicable)
4. Go back to `features` with: `git checkout features`
5. Merge `master` branch over `features` with: `git merge master`
6. Push changes with: `git push origin features`... |
45819357 | How to resolve merge conflict during pull request? | 13 | 2017-08-22 13:43:08 | <p>We generally have individual branches off of master. So for example we have a branch named "JohnMaster". John does his development locally off of JohnMaster and when he is ready to push his code to master he pushes his branch to remote and then does a pull request to master from JohnMaster. The problem were running ... | 14,955 | 127,954 | 2017-08-23 02:32:57 | 45,819,784 | 24 | 2017-08-22 14:00:42 | 6,939,011 | 2017-08-23 02:32:57 | https://stackoverflow.com/q/45819357 | https://stackoverflow.com/a/45819784 | <p><strong>Short answer</strong>: </p>
<p>Merge origin/master into JohnMaster and push this to its remote (origin/JohnMaster). Now you can do the pull request from origin/JohnMaster to master and you won't get merge conflicts as long as there are no new commits on master (commits in master that are not contained on Jo... | <p><strong>Short answer</strong>: </p> <p>Merge origin/master into JohnMaster and push this to its remote (origin/JohnMaster). Now you can do the pull request from origin/JohnMaster to master and you won't get merge conflicts as long as there are no new commits on master (commits in master that are not contained on Jo... | 119, 733, 64512, 116537 | azure-devops, git, pull-request, tfs | <h1>How to resolve merge conflict during pull request?</h1>
<p>We generally have individual branches off of master. So for example we have a branch named "JohnMaster". John does his development locally off of JohnMaster and when he is ready to push his code to master he pushes his branch to remote and then does a pull ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,840 | git | # How to resolve merge conflict during pull request?
We generally have individual branches off of master. So for example we have a branch named "JohnMaster". John does his development locally off of JohnMaster and when he is ready to push his code to master he pushes his branch to remote and then does a pull request t... | **Short answer**:
Merge origin/master into JohnMaster and push this to its remote (origin/JohnMaster). Now you can do the pull request from origin/JohnMaster to master and you won't get merge conflicts as long as there are no new commits on master (commits in master that are not contained on JohnMaster)
```
git check... |
29490893 | Parsing string to local date doesn't use desired century | 13 | 2015-04-07 11:49:47 | <p>I am using this DateTimeFormatter:</p>
<pre class="lang-java prettyprint-override"><code>DateTimeFormatter.ofPattern("ddMMYY")
</code></pre>
<p>I want to parse the string <code>150790</code> and I got this error:</p>
<pre><code>Unable to obtain LocalDate from TemporalAccessor: {DayOfMonth=15, MonthOfYear=7, WeekB... | 4,419 | 3,202,612 | 2016-05-11 11:45:58 | 29,496,149 | 24 | 2015-04-07 16:10:15 | 2,491,410 | 2015-04-07 16:10:15 | https://stackoverflow.com/q/29490893 | https://stackoverflow.com/a/29496149 | <p>Since this question is really about new <code>java.time</code>-package and NOT <code>SimpleDateFormat</code> I will cite following <a href="http://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html" rel="noreferrer">relevant section</a>:</p>
<blockquote>
<p>Year: The count of letters determ... | <p>Since this question is really about new <code>java.time</code>-package and NOT <code>SimpleDateFormat</code> I will cite following <a href="http://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html" rel="noreferrer">relevant section</a>:</p> <blockquote> <p>Year: The count of letters determ... | 17, 5002, 8016, 100364 | 2-digit-year, date, java, java-time | <h1>Parsing string to local date doesn't use desired century</h1>
<p>I am using this DateTimeFormatter:</p>
<pre class="lang-java prettyprint-override"><code>DateTimeFormatter.ofPattern("ddMMYY")
</code></pre>
<p>I want to parse the string <code>150790</code> and I got this error:</p>
<pre><code>Unable to obtain Loc... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,843 | git | # Parsing string to local date doesn't use desired century
I am using this DateTimeFormatter:
```
DateTimeFormatter.ofPattern("ddMMYY")
```
I want to parse the string `150790` and I got this error:
```
Unable to obtain LocalDate from TemporalAccessor: {DayOfMonth=15, MonthOfYear=7, WeekBasedYear[WeekFields[MONDAY,4... | Since this question is really about new `java.time`-package and NOT `SimpleDateFormat` I will cite following [relevant section](http://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html):
> Year: The count of letters determines the minimum field width below
> which padding is used. If the count ... |
26649591 | Git fetch does not download remote branches | 13 | 2014-10-30 09:42:54 | <p>I cannot get Git to fetch new branches on the remote. <code>git remote show</code> will not show that any branch other than master exists, but <code>git ls-remote</code> proves that they exist. </p>
<p>Example: <code>git ls-remote</code> shows that the branch homodyne_process exist-</p>
<pre><code>$ git ls-remote ... | 12,891 | 1,982,894 | 2020-03-31 13:11:11 | 26,649,770 | 24 | 2014-10-30 09:51:33 | 1,982,894 | 2020-03-31 13:11:11 | https://stackoverflow.com/q/26649591 | https://stackoverflow.com/a/26649770 | <p>This answer solved my question: <a href="https://stackoverflow.com/a/25941875/1982894">https://stackoverflow.com/a/25941875/1982894</a>.</p>
<p>Basically I needed to run </p>
<pre><code>git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
</code></pre>
<p>This sets git to fetch all remote branches... | <p>This answer solved my question: <a href="https://stackoverflow.com/a/25941875/1982894">https://stackoverflow.com/a/25941875/1982894</a>.</p> <p>Basically I needed to run </p> <pre><code>git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" </code></pre> <p>This sets git to fetch all remote branches... | 119 | git | <h1>Git fetch does not download remote branches</h1>
<p>I cannot get Git to fetch new branches on the remote. <code>git remote show</code> will not show that any branch other than master exists, but <code>git ls-remote</code> proves that they exist. </p>
<p>Example: <code>git ls-remote</code> shows that the branch hom... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,844 | git | # Git fetch does not download remote branches
I cannot get Git to fetch new branches on the remote. `git remote show` will not show that any branch other than master exists, but `git ls-remote` proves that they exist.
Example: `git ls-remote` shows that the branch homodyne_process exist-
```
$ git ls-remote origin
b... | This answer solved my question: <https://stackoverflow.com/a/25941875/1982894>.
Basically I needed to run
```
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
```
This sets git to fetch all remote branches and not just master. The original configuration was:
```
$ git config --get remote.origin.... |
15439104 | Can Install EGit: Missing requirement: Git Team Provider Core | 13 | 2013-03-15 17:55:48 | <p>So I am using Coldfusion Builder with Ecplise. I am trying to get EGit installed in it so I can do Git stuff. The only thing I can ever get installed is EGit 0.11.1 from <code>http://download.ecplise.org/releases/helios/</code>. When I try to install the latest version from <code>http://download.eclipse.org/egit/upd... | 16,684 | 1,229,594 | 2014-07-06 13:44:11 | 15,441,326 | 24 | 2013-03-15 20:14:08 | 845,716 | 2013-03-15 20:14:08 | https://stackoverflow.com/q/15439104 | https://stackoverflow.com/a/15441326 | <p>You said you were trying to update via <code>http://download.eclipse.org/releases/helios/</code>, so sounds like you're still running Eclipse 3.6 (Helios).</p>
<p>According to the <a href="http://wiki.eclipse.org/EGit/FAQ#What_versions_of_Eclipse_does_EGit_target.3F">EGit FAQ</a>, the latest version of EGit that is... | <p>You said you were trying to update via <code>http://download.eclipse.org/releases/helios/</code>, so sounds like you're still running Eclipse 3.6 (Helios).</p> <p>According to the <a href="http://wiki.eclipse.org/EGit/FAQ#What_versions_of_Eclipse_does_EGit_target.3F">EGit FAQ</a>, the latest version of EGit that is... | 119, 3885, 41624, 41989, 43702 | coldfusionbuilder, eclipse-plugin, egit, git, windows-7-x64 | <h1>Can Install EGit: Missing requirement: Git Team Provider Core</h1>
<p>So I am using Coldfusion Builder with Ecplise. I am trying to get EGit installed in it so I can do Git stuff. The only thing I can ever get installed is EGit 0.11.1 from <code>http://download.ecplise.org/releases/helios/</code>. When I try to ins... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,845 | git | # Can Install EGit: Missing requirement: Git Team Provider Core
So I am using Coldfusion Builder with Ecplise. I am trying to get EGit installed in it so I can do Git stuff. The only thing I can ever get installed is EGit 0.11.1 from `http://download.ecplise.org/releases/helios/`. When I try to install the latest vers... | You said you were trying to update via `http://download.eclipse.org/releases/helios/`, so sounds like you're still running Eclipse 3.6 (Helios).
According to the [EGit FAQ](http://wiki.eclipse.org/EGit/FAQ#What_versions_of_Eclipse_does_EGit_target.3F), the latest version of EGit that is supported on Helios is 2.1.0.20... |
5735656 | Tagging release before deploying with Capistrano | 13 | 2011-04-20 19:34:26 | <p>I'm looking to build a nice little Capistrano recipe for deploying sites version controlled in Git.</p>
<p>In addition to some other things I'm working on adding, my first task is to tag the current release with the current date...and when that tag already exists (e.g. multiple releases in a day), append a letter.<... | 5,563 | 79,550 | 2020-06-08 13:47:42 | 5,735,765 | 24 | 2011-04-20 19:45:32 | 113,987 | 2011-04-20 19:45:32 | https://stackoverflow.com/q/5735656 | https://stackoverflow.com/a/5735765 | <p>I've done something similar with Capistrano. The easiest thing to do is tag using the timestamp name that Capistrano used during the deploy - that's YYYYMMDDHHMMSS, so it's really hard to get duplicates. </p>
<p>Example:</p>
<pre><code>task :push_deploy_tag do
user = `git config --get user.name`.chomp
email ... | <p>I've done something similar with Capistrano. The easiest thing to do is tag using the timestamp name that Capistrano used during the deploy - that's YYYYMMDDHHMMSS, so it's really hard to get duplicates. </p> <p>Example:</p> <pre><code>task :push_deploy_tag do user = `git config --get user.name`.chomp email ... | 12, 119, 2831 | capistrano, git, ruby | <h1>Tagging release before deploying with Capistrano</h1>
<p>I'm looking to build a nice little Capistrano recipe for deploying sites version controlled in Git.</p>
<p>In addition to some other things I'm working on adding, my first task is to tag the current release with the current date...and when that tag already e... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,847 | git | # Tagging release before deploying with Capistrano
I'm looking to build a nice little Capistrano recipe for deploying sites version controlled in Git.
In addition to some other things I'm working on adding, my first task is to tag the current release with the current date...and when that tag already exists (e.g. mult... | I've done something similar with Capistrano. The easiest thing to do is tag using the timestamp name that Capistrano used during the deploy - that's YYYYMMDDHHMMSS, so it's really hard to get duplicates.
Example:
```
task :push_deploy_tag do
user = `git config --get user.name`.chomp
email = `git config --get user... |
73644598 | Why does signing commit with SSH key fail with "invalid format?" and "failed to write commit object"? | 12 | 2022-09-08 06:32:00 | <p>I followed <a href="https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-ssh-key" rel="noreferrer">GitHub's instructions</a> for telling git about my SSH key, but when I tried to sign a commit</p>
<pre><code>git commit -S
</code></... | 13,306 | 5,432,315 | 2024-05-29 23:00:16 | 73,644,599 | 24 | 2022-09-08 06:32:00 | 5,432,315 | 2024-05-29 23:00:16 | https://stackoverflow.com/q/73644598 | https://stackoverflow.com/a/73644599 | <h2>Setup</h2>
<p>For Git to successfully sign the commit,</p>
<ol>
<li>Git (v2.34 or later) needs to <a href="https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-ssh-key" rel="nofollow noreferrer">know about your SSH key</a></li>
<l... | <h2>Setup</h2> <p>For Git to successfully sign the commit,</p> <ol> <li>Git (v2.34 or later) needs to <a href="https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-ssh-key" rel="nofollow noreferrer">know about your SSH key</a></li> <l... | 119, 3263, 25308, 123373 | git, git-for-windows, signing, ssh-keys | <h1>Why does signing commit with SSH key fail with "invalid format?" and "failed to write commit object"?</h1>
<p>I followed <a href="https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-ssh-key" rel="noreferrer">GitHub's instructions... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,849 | git | # Why does signing commit with SSH key fail with "invalid format?" and "failed to write commit object"?
I followed [GitHub's instructions](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-ssh-key) for telling git about my SSH key... | ## Setup
For Git to successfully sign the commit,
1. Git (v2.34 or later) needs to [know about your SSH key](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-ssh-key)
2. The ssh-agent needs to be running
- `eval "$(ssh-agent ... |
71448559 | Git Large File Storage / How to install git lfs on AWS EC2 Linux 2 / "No package git-lfs available." | 12 | 2022-03-12 09:37:19 | <p>How to install <code>git-lfs</code> on an Amazon EC2 (Amazon Linux 2) instance?</p>
<p>Based on <a href="https://github.com/git-lfs/git-lfs/blob/main/INSTALLING.md" rel="noreferrer">https://github.com/git-lfs/git-lfs/blob/main/INSTALLING.md</a> did I tried:</p>
<pre><code>sudo yum install git -y;
cd /home/ec2-user;
... | 12,616 | 8,446,781 | 2024-08-15 14:17:50 | 71,466,001 | 24 | 2022-03-14 10:09:06 | 12,326,605 | 2023-04-28 07:20:31 | https://stackoverflow.com/q/71448559 | https://stackoverflow.com/a/71466001 | <p>With Amazon Linux 2, you can use the <strong>Extras</strong> Library to install application and software updates on your instances. These software updates are known as topics.</p>
<p>Below are the steps:</p>
<ol>
<li><p>Connect to your EC2 Linux instance using SSH.</p>
</li>
<li><p>Use the <strong>which</strong> com... | <p>With Amazon Linux 2, you can use the <strong>Extras</strong> Library to install application and software updates on your instances. These software updates are known as topics.</p> <p>Below are the steps:</p> <ol> <li><p>Connect to your EC2 Linux instance using SSH.</p> </li> <li><p>Use the <strong>which</strong> com... | 58, 119, 12375, 115244 | amazon-ec2, git, git-lfs, linux | <h1>Git Large File Storage / How to install git lfs on AWS EC2 Linux 2 / "No package git-lfs available."</h1>
<p>How to install <code>git-lfs</code> on an Amazon EC2 (Amazon Linux 2) instance?</p>
<p>Based on <a href="https://github.com/git-lfs/git-lfs/blob/main/INSTALLING.md" rel="noreferrer">https://github.com/git-lf... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,850 | git | # Git Large File Storage / How to install git lfs on AWS EC2 Linux 2 / "No package git-lfs available."
How to install `git-lfs` on an Amazon EC2 (Amazon Linux 2) instance?
Based on <https://github.com/git-lfs/git-lfs/blob/main/INSTALLING.md> did I tried:
```
sudo yum install git -y;
cd /home/ec2-user;
curl -s https:... | With Amazon Linux 2, you can use the **Extras** Library to install application and software updates on your instances. These software updates are known as topics.
Below are the steps:
1. Connect to your EC2 Linux instance using SSH.
2. Use the **which** command to confirm that the amazon-linux-extras package is insta... |
61637163 | git-svn Can't locate SVN/Core.pm after fresh installation of macOS Catalina 10.15.4 | 12 | 2020-05-06 14:02:04 | <p>Recently I reinstalled <code>macOS Catalina 10.15.4</code>. After I installed <code>Command_Line_Tools_11.4.1</code>, it told me svn is no longer working with Xcode. Then I installed both git and svn by brew, hopefully git-svn would work. Unfortunately got this error message:</p>
<blockquote>
<p>Can't locate SVN/... | 10,646 | 13,483,355 | 2023-03-07 16:27:32 | 61,637,406 | 24 | 2020-05-06 14:12:48 | 13,483,355 | 2020-05-06 14:12:48 | https://stackoverflow.com/q/61637163 | https://stackoverflow.com/a/61637406 | <p>Finally I figure it out!!!</p>
<p>Open the <code>git-svn</code> file (perl script, in my case file location is <code>/usr/local/opt/git/libexec/git-core/git-svn</code>), change the first line <code>#!/usr/bin/perl</code> to <code>#!/usr/local/bin/perl</code></p>
<p>And it works!</p>
<p>I guess system perl doesn't... | <p>Finally I figure it out!!!</p> <p>Open the <code>git-svn</code> file (perl script, in my case file location is <code>/usr/local/opt/git/libexec/git-core/git-svn</code>), change the first line <code>#!/usr/bin/perl</code> to <code>#!/usr/local/bin/perl</code></p> <p>And it works!</p> <p>I guess system perl doesn't... | 369, 580, 6452 | git-svn, macos, perl | <h1>git-svn Can't locate SVN/Core.pm after fresh installation of macOS Catalina 10.15.4</h1>
<p>Recently I reinstalled <code>macOS Catalina 10.15.4</code>. After I installed <code>Command_Line_Tools_11.4.1</code>, it told me svn is no longer working with Xcode. Then I installed both git and svn by brew, hopefully git-s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,852 | git | # git-svn Can't locate SVN/Core.pm after fresh installation of macOS Catalina 10.15.4
Recently I reinstalled `macOS Catalina 10.15.4`. After I installed `Command_Line_Tools_11.4.1`, it told me svn is no longer working with Xcode. Then I installed both git and svn by brew, hopefully git-svn would work. Unfortunately go... | Finally I figure it out!!!
Open the `git-svn` file (perl script, in my case file location is `/usr/local/opt/git/libexec/git-core/git-svn`), change the first line `#!/usr/bin/perl` to `#!/usr/local/bin/perl`
And it works!
I guess system perl doesn't include perl SVN/Core, but brew perl has it (dependency of brew svn... |
51964552 | delete remote branch origin | 12 | 2018-08-22 10:10:22 | <p>I deleted a branch with :</p>
<pre><code>git branch -d branch_name
</code></pre>
<p>And I pushed, but when I list the branches with : </p>
<pre><code>git branch -avv
</code></pre>
<p>I see that the branch is always present with the name <code>remotes/origin/branch_name</code>.</p>
<p>How can I delete the branc... | 11,452 | 6,060,601 | 2020-09-23 08:48:11 | 51,964,951 | 24 | 2018-08-22 10:36:09 | 7,322,100 | 2020-09-23 08:48:11 | https://stackoverflow.com/q/51964552 | https://stackoverflow.com/a/51964951 | <p>When you delete a branch with <code>git branch -d branch_name</code> you just delete the local one. Push will not affect the status of the remote, so origin/branch_name will remain. If you want to delete it you should do <code>git push <remote_name> --delete <branch_name></code> as explained in the post ... | <p>When you delete a branch with <code>git branch -d branch_name</code> you just delete the local one. Push will not affect the status of the remote, so origin/branch_name will remain. If you want to delete it you should do <code>git push <remote_name> --delete <branch_name></code> as explained in the post ... | 119, 1879, 76220 | branch, git, git-branch | <h1>delete remote branch origin</h1>
<p>I deleted a branch with :</p>
<pre><code>git branch -d branch_name
</code></pre>
<p>And I pushed, but when I list the branches with : </p>
<pre><code>git branch -avv
</code></pre>
<p>I see that the branch is always present with the name <code>remotes/origin/branch_name</code... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,853 | git | # delete remote branch origin
I deleted a branch with :
```
git branch -d branch_name
```
And I pushed, but when I list the branches with :
```
git branch -avv
```
I see that the branch is always present with the name `remotes/origin/branch_name`.
How can I delete the branch from there? | When you delete a branch with `git branch -d branch_name` you just delete the local one. Push will not affect the status of the remote, so origin/branch_name will remain. If you want to delete it you should do `git push <remote_name> --delete <branch_name>` as explained in the post suggested as duplicate.
When someone... |
44494296 | show git branches with date of last commit | 12 | 2017-06-12 08:03:21 | <p>I was working on a branch a couple of weeks ago but I can't remember what the branch was called (there are many). I'd like to be able to do something like:</p>
<p><code>git branch --print-last-commit</code></p>
<p>and for it to output something like:</p>
<pre><code>branch 1 - 2017-02-12
branch 2 - 2016-12-30
</co... | 8,603 | 98,078 | 2023-04-06 09:06:05 | 44,494,345 | 24 | 2017-06-12 08:05:39 | 1,465,553 | 2020-10-13 01:58:52 | https://stackoverflow.com/q/44494296 | https://stackoverflow.com/a/44494345 | <p>This will print <strong>BranchName - CommitMessage - Date as (YYYY-MM-DD)</strong>. You can manipulate/edit this command line to suit your need.</p>
<pre><code>git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(co... | <p>This will print <strong>BranchName - CommitMessage - Date as (YYYY-MM-DD)</strong>. You can manipulate/edit this command line to suit your need.</p> <pre><code>git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(co... | 119, 456, 76220 | git, git-branch, version-control | <h1>show git branches with date of last commit</h1>
<p>I was working on a branch a couple of weeks ago but I can't remember what the branch was called (there are many). I'd like to be able to do something like:</p>
<p><code>git branch --print-last-commit</code></p>
<p>and for it to output something like:</p>
<pre><c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,854 | git | # show git branches with date of last commit
I was working on a branch a couple of weeks ago but I can't remember what the branch was called (there are many). I'd like to be able to do something like:
`git branch --print-last-commit`
and for it to output something like:
```
branch 1 - 2017-02-12
branch 2 - 2016-12-... | This will print **BranchName - CommitMessage - Date as (YYYY-MM-DD)**. You can manipulate/edit this command line to suit your need.
```
git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:... |
24803627 | Get a list of changed files and their status for a specific Git commit | 12 | 2014-07-17 12:29:47 | <p>I use the following Git command</p>
<pre><code>git diff-tree --no-commit-id --name-only -r <SHA>
</code></pre>
<p>to get a list of changed files.</p>
<p>Unfortunately, the list doesn't specify the type of change for each file: added, modified or deleted ... etc</p>
<p>How may I display a list of changes [t... | 41,995 | 202,940 | 2014-07-29 06:53:16 | 24,819,616 | 24 | 2014-07-18 07:36:23 | 2,282,634 | 2014-07-18 07:36:23 | https://stackoverflow.com/q/24803627 | https://stackoverflow.com/a/24819616 | <p>Use <code>--name-status</code> instead of <code>--name-only</code></p>
<pre><code>git diff-tree --no-commit-id --name-status -r <SHA>
</code></pre>
<p>This will show the filename with a status letter of (extracted from man): <code>Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R), have their type... | <p>Use <code>--name-status</code> instead of <code>--name-only</code></p> <pre><code>git diff-tree --no-commit-id --name-status -r <SHA> </code></pre> <p>This will show the filename with a status letter of (extracted from man): <code>Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R), have their type... | 119, 105913, 106016 | git, git-diff-tree, git-plumbing | <h1>Get a list of changed files and their status for a specific Git commit</h1>
<p>I use the following Git command</p>
<pre><code>git diff-tree --no-commit-id --name-only -r <SHA>
</code></pre>
<p>to get a list of changed files.</p>
<p>Unfortunately, the list doesn't specify the type of change for each file: a... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,855 | git | # Get a list of changed files and their status for a specific Git commit
I use the following Git command
```
git diff-tree --no-commit-id --name-only -r <SHA>
```
to get a list of changed files.
Unfortunately, the list doesn't specify the type of change for each file: added, modified or deleted ... etc
How may I d... | Use `--name-status` instead of `--name-only`
```
git diff-tree --no-commit-id --name-status -r <SHA>
```
This will show the filename with a status letter of (extracted from man): `Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R), have their type (i.e. regular file, symlink, submodule, ...) changed (T), a... |
14889017 | How to show local branch history? | 12 | 2013-02-15 05:49:20 | <p>I'm very new to git, I want to know how to track branch history?</p>
<p>For example:</p>
<pre><code>echo "update README in branch master" >> README.md
git commit -a -m"commit in branch master"
git checkout -b b1
echo "update README in branch b1" >> README.md
git commit -a -m"commit in branch b1"
git ch... | 38,532 | 2,038,901 | 2013-02-15 13:04:38 | 14,889,649 | 24 | 2013-02-15 06:55:23 | 300,238 | 2013-02-15 13:04:38 | https://stackoverflow.com/q/14889017 | https://stackoverflow.com/a/14889649 | <p>You're on the right track. Try using:</p>
<pre><code>git log --graph --all --oneline
</code></pre>
<p>Here's an example:</p>
<pre><code>* e96e246 H
| * c12759a G
|/
* 547058e F
|\
| * b81eb87 E
* | 26a34db D
| | * 47a536f C
| | * b8fa965 B
| |/
|/|
* | cd14ec4 A
</code></pre>
<p>I personally use an a... | <p>You're on the right track. Try using:</p> <pre><code>git log --graph --all --oneline </code></pre> <p>Here's an example:</p> <pre><code>* e96e246 H | * c12759a G |/ * 547058e F |\ | * b81eb87 E * | 26a34db D | | * 47a536f C | | * b8fa965 B | |/ |/| * | cd14ec4 A </code></pre> <p>I personally use an a... | 119 | git | <h1>How to show local branch history?</h1>
<p>I'm very new to git, I want to know how to track branch history?</p>
<p>For example:</p>
<pre><code>echo "update README in branch master" >> README.md
git commit -a -m"commit in branch master"
git checkout -b b1
echo "update README in branch b1" >> README.md
g... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,856 | git | # How to show local branch history?
I'm very new to git, I want to know how to track branch history?
For example:
```
echo "update README in branch master" >> README.md
git commit -a -m"commit in branch master"
git checkout -b b1
echo "update README in branch b1" >> README.md
git commit -a -m"commit in branch b1"
gi... | You're on the right track. Try using:
```
git log --graph --all --oneline
```
Here's an example:
```
* e96e246 H
| * c12759a G
|/
* 547058e F
|\
| * b81eb87 E
* | 26a34db D
| | * 47a536f C
| | * b8fa965 B
| |/
|/|
* | cd14ec4 A
```
I personally use an alais in .gitconfig,
```
[alias]
graph = log --g... |
7770364 | Git: Undo local changes; git add . + git rm? | 12 | 2011-10-14 16:03:01 | <p>Need help figuring out a couple common workflows with Github. I come from a VS TFS background, so forgive me.</p>
<p><strong>Undoing Pending Changes</strong></p>
<p>Let's say I have cloned of a git repository to my local file system. At this point, the project's local files match exactly what's in the remote repoi... | 13,179 | 979,672 | 2019-01-18 00:23:15 | 7,770,430 | 24 | 2011-10-14 16:09:00 | 526,535 | 2019-01-18 00:23:15 | https://stackoverflow.com/q/7770364 | https://stackoverflow.com/a/7770430 | <blockquote>
<p>How do I undo these local changes, restoring them to the current versions in the repository?`</p>
</blockquote>
<pre><code>git reset --hard
</code></pre>
<p>(this will reset your index and working directory to HEAD)</p>
<blockquote>
<p>Is there a git command that will <code>git add .</code> and <... | <blockquote> <p>How do I undo these local changes, restoring them to the current versions in the repository?`</p> </blockquote> <pre><code>git reset --hard </code></pre> <p>(this will reset your index and working directory to HEAD)</p> <blockquote> <p>Is there a git command that will <code>git add .</code> and <... | 119, 34792, 51381, 112901 | git, git-add, git-reset, git-rm | <h1>Git: Undo local changes; git add . + git rm?</h1>
<p>Need help figuring out a couple common workflows with Github. I come from a VS TFS background, so forgive me.</p>
<p><strong>Undoing Pending Changes</strong></p>
<p>Let's say I have cloned of a git repository to my local file system. At this point, the project'... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,857 | git | # Git: Undo local changes; git add . + git rm?
Need help figuring out a couple common workflows with Github. I come from a VS TFS background, so forgive me.
**Undoing Pending Changes**
Let's say I have cloned of a git repository to my local file system. At this point, the project's local files match exactly what's i... | > How do I undo these local changes, restoring them to the current versions in the repository?`
```
git reset --hard
```
(this will reset your index and working directory to HEAD)
> Is there a git command that will `git add .` and `git rm` any files I've deleted locally, in one step?`
```
git add -u
```
(it wont a... |
5607355 | how to show differences between some or all files? GIT | 12 | 2011-04-09 19:37:19 | <p>As in the subject: how to show differences betwen some or all files?</p>
<p>Sorry i've screwed up my question. I meant differences betwen branches for one or multiple or all files.</p>
| 21,084 | 170,961 | 2019-09-06 10:41:42 | 5,607,930 | 24 | 2011-04-09 21:08:39 | 85,371 | 2011-04-09 21:08:39 | https://stackoverflow.com/q/5607355 | https://stackoverflow.com/a/5607930 | <p>Or perhaps a bit more helpful:</p>
<pre><code>git diff <commit1> <commit2> -- path/to/file.cpp path/to/anotherfile.cpp path/to/subdir
</code></pre>
<p>You can also (in e.g. bash)</p>
<pre><code>git diff {<commit1>,<commit2>}:path/to/file.cpp
</code></pre>
<p>This way you can even</p>
<pr... | <p>Or perhaps a bit more helpful:</p> <pre><code>git diff <commit1> <commit2> -- path/to/file.cpp path/to/anotherfile.cpp path/to/subdir </code></pre> <p>You can also (in e.g. bash)</p> <pre><code>git diff {<commit1>,<commit2>}:path/to/file.cpp </code></pre> <p>This way you can even</p> <pr... | 119 | git | <h1>how to show differences between some or all files? GIT</h1>
<p>As in the subject: how to show differences betwen some or all files?</p>
<p>Sorry i've screwed up my question. I meant differences betwen branches for one or multiple or all files.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,858 | git | # how to show differences between some or all files? GIT
As in the subject: how to show differences betwen some or all files?
Sorry i've screwed up my question. I meant differences betwen branches for one or multiple or all files. | Or perhaps a bit more helpful:
```
git diff <commit1> <commit2> -- path/to/file.cpp path/to/anotherfile.cpp path/to/subdir
```
You can also (in e.g. bash)
```
git diff {<commit1>,<commit2>}:path/to/file.cpp
```
This way you can even
```
git diff <commit1>:path/to/file.cpp <commit2>:path/to/anotherfile.cpp
```
whi... |
1695925 | How do I import a third party lib into git? | 12 | 2009-11-08 10:01:15 | <p>I'm looking at how to import some third part code into a git repository.
The third party code is the "stm32f10x_stdperiph_lib" that is provided by ST. </p>
<p>The lib is actually a bunch of normal c-files (and header-files) that you just include and build with when you do a <a href="http://www.st.com/stonline/stapp... | 5,724 | 51,425 | 2016-01-18 13:24:31 | 1,698,115 | 24 | 2009-11-08 22:20:35 | 14,660 | 2016-01-18 13:24:31 | https://stackoverflow.com/q/1695925 | https://stackoverflow.com/a/1698115 | <p>What you're looking for is a "vendor branch". Assuming you want to work on this code and merge the vendor's updates with your own patches, here's how you make that easy.</p>
<pre><code>git checkout -b vendor # create a vendor branch and check it out
</code></pre>
<p>That's a one time thing. The vendor branch ... | <p>What you're looking for is a "vendor branch". Assuming you want to work on this code and merge the vendor's updates with your own patches, here's how you make that easy.</p> <pre><code>git checkout -b vendor # create a vendor branch and check it out </code></pre> <p>That's a one time thing. The vendor branch ... | 119, 432, 9608 | git, import, organization | <h1>How do I import a third party lib into git?</h1>
<p>I'm looking at how to import some third part code into a git repository.
The third party code is the "stm32f10x_stdperiph_lib" that is provided by ST. </p>
<p>The lib is actually a bunch of normal c-files (and header-files) that you just include and build with wh... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,859 | git | # How do I import a third party lib into git?
I'm looking at how to import some third part code into a git repository.
The third party code is the "stm32f10x_stdperiph_lib" that is provided by ST.
The lib is actually a bunch of normal c-files (and header-files) that you just include and build with when you do a [STM3... | What you're looking for is a "vendor branch". Assuming you want to work on this code and merge the vendor's updates with your own patches, here's how you make that easy.
```
git checkout -b vendor # create a vendor branch and check it out
```
That's a one time thing. The vendor branch and its ONLY going to contain... |
63646679 | SourceTree can't show GIT diff for big text file (or treats it as binary) | 11 | 2020-08-29 11:56:14 | <p>I'm trying to use GIT for tracking changes to a pretty big XML file (about 3 Mb). The file is in UTF-8, and CRLF line ending (I'm working in Windows 10). But for some reason GIT keeps thinking it's binary file and does not show any diff. Or just can't detect changes.</p>
<p>Diff in Sourcetree shows the message "... | 8,784 | 5,247,631 | 2024-08-01 18:48:55 | 63,656,754 | 24 | 2020-08-30 11:02:54 | 5,247,631 | 2024-08-01 18:48:55 | https://stackoverflow.com/q/63646679 | https://stackoverflow.com/a/63656754 | <p>The problem was not GIT options, but SourceTree settings Tools/Options/Diff. By default it has setting for internal Diff View - Size Limit for text files of 1024Kb.</p>
<p>I set it to a higher value and it resolved my problem.</p>
<p>I mistakenly interpreted SourceTree error message "<strong>No changes in this ... | <p>The problem was not GIT options, but SourceTree settings Tools/Options/Diff. By default it has setting for internal Diff View - Size Limit for text files of 1024Kb.</p> <p>I set it to a higher value and it resolved my problem.</p> <p>I mistakenly interpreted SourceTree error message "<strong>No changes in this ... | 119, 90056 | atlassian-sourcetree, git | <h1>SourceTree can't show GIT diff for big text file (or treats it as binary)</h1>
<p>I'm trying to use GIT for tracking changes to a pretty big XML file (about 3 Mb). The file is in UTF-8, and CRLF line ending (I'm working in Windows 10). But for some reason GIT keeps thinking it's binary file and does not show any di... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,861 | git | # SourceTree can't show GIT diff for big text file (or treats it as binary)
I'm trying to use GIT for tracking changes to a pretty big XML file (about 3 Mb). The file is in UTF-8, and CRLF line ending (I'm working in Windows 10). But for some reason GIT keeps thinking it's binary file and does not show any diff. Or ju... | The problem was not GIT options, but SourceTree settings Tools/Options/Diff. By default it has setting for internal Diff View - Size Limit for text files of 1024Kb.
I set it to a higher value and it resolved my problem.
I mistakenly interpreted SourceTree error message "**No changes in this file detected, or it is a ... |
35150186 | Getting git-revision hash with webpack | 11 | 2016-02-02 09:59:10 | <p>I'm trying to create archive with webpack with suffix by git-revision. Could you tell me please what is good way to do it?</p>
| 3,081 | 274,500 | 2016-02-02 11:38:39 | 35,150,907 | 24 | 2016-02-02 10:29:35 | 5,338,489 | 2016-02-02 10:37:49 | https://stackoverflow.com/q/35150186 | https://stackoverflow.com/a/35150907 | <p>You can get git revision in webpack in this way:</p>
<pre><code>var childProcess = require('child_process'),
VERSION = childProcess.execSync('git rev-parse HEAD').toString();
</code></pre>
| <p>You can get git revision in webpack in this way:</p> <pre><code>var childProcess = require('child_process'), VERSION = childProcess.execSync('git rev-parse HEAD').toString(); </code></pre> | 102241, 117536 | git-revision, webpack | <h1>Getting git-revision hash with webpack</h1>
<p>I'm trying to create archive with webpack with suffix by git-revision. Could you tell me please what is good way to do it?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,863 | git | # Getting git-revision hash with webpack
I'm trying to create archive with webpack with suffix by git-revision. Could you tell me please what is good way to do it? | You can get git revision in webpack in this way:
```
var childProcess = require('child_process'),
VERSION = childProcess.execSync('git rev-parse HEAD').toString();
``` |
10325586 | How to nest git repositories; fetch and merge | 10 | 2012-04-26 00:14:03 | <p>So I have two git repos. The first is our framework (think db abstraction, functions) and then another git repo for our new project.</p>
<p>I want to include the framework git repo into the project git, and according to GitHub Help, this should work:</p>
<pre><code> cd /project
git remote add framework git://gith... | 6,107 | 425,964 | 2013-12-28 01:10:47 | 10,325,603 | 24 | 2012-04-26 00:15:45 | 147,356 | 2013-12-28 01:10:47 | https://stackoverflow.com/q/10325586 | https://stackoverflow.com/a/10325603 | <p>You may want to look into Git's <a href="http://git-scm.com/book/en/Git-Tools-Submodules" rel="noreferrer">submodule</a> support. A submodule lets you embed one git repository inside another git repository. There are <a href="https://github.com/apenwarr/git-subtree" rel="noreferrer">alternative solutions</a> to th... | <p>You may want to look into Git's <a href="http://git-scm.com/book/en/Git-Tools-Submodules" rel="noreferrer">submodule</a> support. A submodule lets you embed one git repository inside another git repository. There are <a href="https://github.com/apenwarr/git-subtree" rel="noreferrer">alternative solutions</a> to th... | 119, 456, 28897, 33720 | git, git-fetch, git-merge, version-control | <h1>How to nest git repositories; fetch and merge</h1>
<p>So I have two git repos. The first is our framework (think db abstraction, functions) and then another git repo for our new project.</p>
<p>I want to include the framework git repo into the project git, and according to GitHub Help, this should work:</p>
<pre>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,869 | git | # How to nest git repositories; fetch and merge
So I have two git repos. The first is our framework (think db abstraction, functions) and then another git repo for our new project.
I want to include the framework git repo into the project git, and according to GitHub Help, this should work:
```
cd /project
git rem... | You may want to look into Git's [submodule](http://git-scm.com/book/en/Git-Tools-Submodules) support. A submodule lets you embed one git repository inside another git repository. There are [alternative solutions](https://github.com/apenwarr/git-subtree) to this sort of thing, but I haven't used them myself.
An example... |
1391732 | git says everything-up-to-date when pushing changes to a remote branch | 10 | 2009-09-08 02:49:06 | <p>i have commits that are in a remote repository (origin/master) which i want to put in a branch created from that repository (origin/remote_branch).</p>
<p>when i checkout to that remote branch</p>
<pre><code>git checkout -b mybranch origin/remote_branch
</code></pre>
<p>then cherry-picked the commits that i made<... | 12,887 | 167,646 | 2019-12-31 17:28:42 | 1,391,781 | 24 | 2009-09-08 03:17:23 | 825 | 2009-09-08 03:17:23 | https://stackoverflow.com/q/1391732 | https://stackoverflow.com/a/1391781 | <p>Depending on your version of Git, it may be trying to push branches with matching names, i.e., <code>master</code> to <code>origin/master</code> and <code>remote_branch</code> to <code>origin/remote_branch</code>. If your origin repository doesn't have a branch named <code>mybranch</code> then it thinks there's not... | <p>Depending on your version of Git, it may be trying to push branches with matching names, i.e., <code>master</code> to <code>origin/master</code> and <code>remote_branch</code> to <code>origin/remote_branch</code>. If your origin repository doesn't have a branch named <code>mybranch</code> then it thinks there's not... | 119, 4236, 36489, 37230 | cherry-pick, git, git-checkout, push | <h1>git says everything-up-to-date when pushing changes to a remote branch</h1>
<p>i have commits that are in a remote repository (origin/master) which i want to put in a branch created from that repository (origin/remote_branch).</p>
<p>when i checkout to that remote branch</p>
<pre><code>git checkout -b mybranch or... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,870 | git | # git says everything-up-to-date when pushing changes to a remote branch
i have commits that are in a remote repository (origin/master) which i want to put in a branch created from that repository (origin/remote_branch).
when i checkout to that remote branch
```
git checkout -b mybranch origin/remote_branch
```
the... | Depending on your version of Git, it may be trying to push branches with matching names, i.e., `master` to `origin/master` and `remote_branch` to `origin/remote_branch`. If your origin repository doesn't have a branch named `mybranch` then it thinks there's nothing to update.
To override this default, you can explicit... |
44337154 | How to ungit a directory? | 9 | 2017-06-02 20:42:54 | <p>I have accidentally put my home folder under git version control. How can I undo this? I am running Ubuntu 16.04.</p>
<p>Interestingly, running</p>
<pre><code>$ git status
</code></pre>
<p>Informs me that the Mozilla Firefox cache has been altered.</p>
<p><a href="https://i.sstatic.net/Mou4p.png" rel="noreferrer... | 22,163 | 8,105,136 | 2017-06-02 22:29:48 | 44,337,218 | 24 | 2017-06-02 20:48:12 | 6,051,261 | 2017-06-02 20:48:12 | https://stackoverflow.com/q/44337154 | https://stackoverflow.com/a/44337218 | <p>Try removing the <code>.git</code> directory and <code>.gitignore</code> if exist: <code>rm -Rf .git .gitignore</code></p>
| <p>Try removing the <code>.git</code> directory and <code>.gitignore</code> if exist: <code>rm -Rf .git .gitignore</code></p> | 119 | git | <h1>How to ungit a directory?</h1>
<p>I have accidentally put my home folder under git version control. How can I undo this? I am running Ubuntu 16.04.</p>
<p>Interestingly, running</p>
<pre><code>$ git status
</code></pre>
<p>Informs me that the Mozilla Firefox cache has been altered.</p>
<p><a href="https://i.sst... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,873 | git | # How to ungit a directory?
I have accidentally put my home folder under git version control. How can I undo this? I am running Ubuntu 16.04.
Interestingly, running
```
$ git status
```
Informs me that the Mozilla Firefox cache has been altered.
[Screenshot of terminal](https://i.sstatic.net/Mou4p.png)
---
Relat... | Try removing the `.git` directory and `.gitignore` if exist: `rm -Rf .git .gitignore` |
19280472 | git review doesn't work? but I am able to see my changes when I do a push. What am I doing wrong? | 9 | 2013-10-09 19:05:45 | <p>I am using git and gerrit. After changing my files, I do the following:</p>
<ol>
<li>git status</li>
<li>git add -> the modified files.</li>
<li>git commit -m "the commit message"</li>
<li>git review</li>
<li>git push</li>
</ol>
<p>When I go git review: I get the following error message "No '.gitreview' file found... | 25,660 | 2,506,131 | 2017-09-26 10:45:24 | 36,462,923 | 24 | 2016-04-06 21:44:17 | 3,799,093 | 2016-04-06 21:44:17 | https://stackoverflow.com/q/19280472 | https://stackoverflow.com/a/36462923 | <p>The gerrit command <code>git review</code> expects that you have a remote repository set up named <code>gerrit</code>. If you already have your repository as a remote named origin (the default from a <code>git clone</code>), you can rename it to what git review expects with this:</p>
<p><code>git remote rename orig... | <p>The gerrit command <code>git review</code> expects that you have a remote repository set up named <code>gerrit</code>. If you already have your repository as a remote named origin (the default from a <code>git clone</code>), you can rename it to what git review expects with this:</p> <p><code>git remote rename orig... | 119 | git | <h1>git review doesn't work? but I am able to see my changes when I do a push. What am I doing wrong?</h1>
<p>I am using git and gerrit. After changing my files, I do the following:</p>
<ol>
<li>git status</li>
<li>git add -> the modified files.</li>
<li>git commit -m "the commit message"</li>
<li>git review</li>
<li>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,874 | git | # git review doesn't work? but I am able to see my changes when I do a push. What am I doing wrong?
I am using git and gerrit. After changing my files, I do the following:
1. git status
2. git add -> the modified files.
3. git commit -m "the commit message"
4. git review
5. git push
When I go git review: I get the f... | The gerrit command `git review` expects that you have a remote repository set up named `gerrit`. If you already have your repository as a remote named origin (the default from a `git clone`), you can rename it to what git review expects with this:
`git remote rename origin gerrit` |
17366006 | fatal: remote heroku already exists | 8 | 2013-06-28 13:37:36 | <p>I am running the following commands and get <code>fatal: remote heroku already exists.</code> error.</p>
<p>I dont know what is wrong here, it used to work without errors before.</p>
<pre><code>git init
git add .
git commit -m 'Initial commit'
git remote add heroku git@heroku.com:myapp.git
</code></pre>
| 14,022 | 123,506 | 2019-12-29 17:20:52 | 23,257,044 | 24 | 2014-04-23 23:30:22 | 3,539,889 | 2014-04-23 23:30:22 | https://stackoverflow.com/q/17366006 | https://stackoverflow.com/a/23257044 | <p>Open .git/config, you will find</p>
<pre><code>[remote "heroku"]
url = git@heroku.com:xxx.git
fetch = +refs/heads/*:refs/remotes/heroku/*
</code></pre>
<p>Change xxx to the app name you want to push. Then </p>
<pre><code>git push heroku master
</code></pre>
<p>It works for me. You can have a try.</p>
| <p>Open .git/config, you will find</p> <pre><code>[remote "heroku"] url = git@heroku.com:xxx.git fetch = +refs/heads/*:refs/remotes/heroku/* </code></pre> <p>Change xxx to the app name you want to push. Then </p> <pre><code>git push heroku master </code></pre> <p>It works for me. You can have a try.</p> | 119, 8279 | git, heroku | <h1>fatal: remote heroku already exists</h1>
<p>I am running the following commands and get <code>fatal: remote heroku already exists.</code> error.</p>
<p>I dont know what is wrong here, it used to work without errors before.</p>
<pre><code>git init
git add .
git commit -m 'Initial commit'
git remote add heroku git@... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,877 | git | # fatal: remote heroku already exists
I am running the following commands and get `fatal: remote heroku already exists.` error.
I dont know what is wrong here, it used to work without errors before.
```
git init
git add .
git commit -m 'Initial commit'
git remote add heroku git@heroku.com:myapp.git
``` | Open .git/config, you will find
```
[remote "heroku"]
url = git@heroku.com:xxx.git
fetch = +refs/heads/*:refs/remotes/heroku/*
```
Change xxx to the app name you want to push. Then
```
git push heroku master
```
It works for me. You can have a try. |
14448326 | git commit stopped working - Error building trees | 118 | 2013-01-21 22:25:09 | <p>I can not commit a change:</p>
<pre><code>$ git commit
error: invalid object 100644 13da9eeff5a9150cf2135aaed4d2e337f97b8114 for 'spec/routing/splits_routing_spec.rb'
error: Error building trees
</code></pre>
<p>I tried so far:</p>
<pre><code>$ git fsck | grep 13da
missing blob 13da9eeff5a9150cf2135aaed4d2e337f97... | 95,914 | 313,522 | 2024-12-12 22:53:38 | 14,453,729 | 23 | 2013-01-22 07:40:10 | 214,373 | 2013-01-22 07:40:10 | https://stackoverflow.com/q/14448326 | https://stackoverflow.com/a/14453729 | <p>You might have a corrupted object in your git repository.</p>
<p>If you have a remote, or other clones of this repository, you could grab from there the problematic file and just replace it on your local repo.</p>
<p>The file you want would be in:</p>
<pre><code>/repo/.git/objects/13/da9eeff5a9150cf2135aaed4d2e33... | <p>You might have a corrupted object in your git repository.</p> <p>If you have a remote, or other clones of this repository, you could grab from there the problematic file and just replace it on your local repo.</p> <p>The file you want would be in:</p> <pre><code>/repo/.git/objects/13/da9eeff5a9150cf2135aaed4d2e33... | 119 | git | <h1>git commit stopped working - Error building trees</h1>
<p>I can not commit a change:</p>
<pre><code>$ git commit
error: invalid object 100644 13da9eeff5a9150cf2135aaed4d2e337f97b8114 for 'spec/routing/splits_routing_spec.rb'
error: Error building trees
</code></pre>
<p>I tried so far:</p>
<pre><code>$ git fsck |... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,881 | git | # git commit stopped working - Error building trees
I can not commit a change:
```
$ git commit
error: invalid object 100644 13da9eeff5a9150cf2135aaed4d2e337f97b8114 for 'spec/routing/splits_routing_spec.rb'
error: Error building trees
```
I tried so far:
```
$ git fsck | grep 13da
missing blob 13da9eeff5a9150cf213... | You might have a corrupted object in your git repository.
If you have a remote, or other clones of this repository, you could grab from there the problematic file and just replace it on your local repo.
The file you want would be in:
```
/repo/.git/objects/13/da9eeff5a9150cf2135aaed4d2e337f97b8114
``` |
866218 | How to rebase many branches (with the same base commit) at once? | 79 | 2009-05-14 22:36:12 | <p>I have a master branch in my project, that I use to pull changes from other people. From that, I usually have several topic branches on which I'm currently working.</p>
<p>My question is: Is there a way for me to pull new changes into my master and then rebase ALL of my topic branches onto that at once?</p>
<p>This ... | 25,604 | 107,367 | 2022-09-14 04:14:35 | 866,353 | 23 | 2009-05-14 23:19:43 | 85,134 | 2009-05-14 23:19:43 | https://stackoverflow.com/q/866218 | https://stackoverflow.com/a/866353 | <p>I'm fairly sure that there isn't a way to automatically do this. Remember that "git rebase master" can also drop you back to the shell needing you to resolve merge conflicts, so if you want to write a script to automate all this you need to take that into account.</p>
<p>You can fairly easily track which branches n... | <p>I'm fairly sure that there isn't a way to automatically do this. Remember that "git rebase master" can also drop you back to the shell needing you to resolve merge conflicts, so if you want to write a script to automate all this you need to take that into account.</p> <p>You can fairly easily track which branches n... | 119, 8974, 29934 | git, git-rebase, rebase | <h1>How to rebase many branches (with the same base commit) at once?</h1>
<p>I have a master branch in my project, that I use to pull changes from other people. From that, I usually have several topic branches on which I'm currently working.</p>
<p>My question is: Is there a way for me to pull new changes into my maste... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,882 | git | # How to rebase many branches (with the same base commit) at once?
I have a master branch in my project, that I use to pull changes from other people. From that, I usually have several topic branches on which I'm currently working.
My question is: Is there a way for me to pull new changes into my master and then reba... | I'm fairly sure that there isn't a way to automatically do this. Remember that "git rebase master" can also drop you back to the shell needing you to resolve merge conflicts, so if you want to write a script to automate all this you need to take that into account.
You can fairly easily track which branches need updati... |
4123077 | Merge Git branch without commit log | 62 | 2010-11-08 10:38:39 | <p>Currently when I'm using Git, I create a branch for each job and make various commits before I'm finished. I then merge back with my master branch and push upstream. I'm likely to have several branches at any one time and also flick between them mid-job as things crop up.</p>
<p>But most of these commits are just sa... | 55,926 | 398,970 | 2023-10-18 05:16:11 | 4,123,102 | 23 | 2010-11-08 10:43:31 | 112,968 | 2023-10-18 05:16:11 | https://stackoverflow.com/q/4123077 | https://stackoverflow.com/a/4123102 | <p>There is, but it is nonsense. Why do you want to do that? You'll lose all branch history and information.</p>
<p>You could use <code>g</code>'s commit message for your merge commit and then browse history with the <code>--first-parent</code> option.</p>
<p>If you really want to lose history from your branch use <cod... | <p>There is, but it is nonsense. Why do you want to do that? You'll lose all branch history and information.</p> <p>You could use <code>g</code>'s commit message for your merge commit and then browse history with the <code>--first-parent</code> option.</p> <p>If you really want to lose history from your branch use <cod... | 119, 717 | git, merge | <h1>Merge Git branch without commit log</h1>
<p>Currently when I'm using Git, I create a branch for each job and make various commits before I'm finished. I then merge back with my master branch and push upstream. I'm likely to have several branches at any one time and also flick between them mid-job as things crop up.... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,884 | git | # Merge Git branch without commit log
Currently when I'm using Git, I create a branch for each job and make various commits before I'm finished. I then merge back with my master branch and push upstream. I'm likely to have several branches at any one time and also flick between them mid-job as things crop up.
But mos... | There is, but it is nonsense. Why do you want to do that? You'll lose all branch history and information.
You could use `g`'s commit message for your merge commit and then browse history with the `--first-parent` option.
If you really want to lose history from your branch use `git merge --squash`, I do not recommend ... |
16447690 | Can't do a git pull | 58 | 2013-05-08 18:28:40 | <p>I'm trying to do a <strong>git pull</strong> and get the error message:</p>
<pre><code>error: The following untracked working tree files would be overwritten by merge:
<myFileName>
Please move or remove them before you can merge.
</code></pre>
<p>So, I try to remove the file using the command <strong>git rm ... | 86,885 | 1,299,026 | 2016-01-29 11:15:19 | 16,447,786 | 23 | 2013-05-08 18:34:12 | 908,269 | 2013-05-08 18:34:12 | https://stackoverflow.com/q/16447690 | https://stackoverflow.com/a/16447786 | <p>You have untracked files in the way of the pull. You can't remove them with <code>git rm --cached</code> because they are untracked. They don't appear in the index. You need to remove them with plain old <code>rm</code></p>
| <p>You have untracked files in the way of the pull. You can't remove them with <code>git rm --cached</code> because they are untracked. They don't appear in the index. You need to remove them with plain old <code>rm</code></p> | 119 | git | <h1>Can't do a git pull</h1>
<p>I'm trying to do a <strong>git pull</strong> and get the error message:</p>
<pre><code>error: The following untracked working tree files would be overwritten by merge:
<myFileName>
Please move or remove them before you can merge.
</code></pre>
<p>So, I try to remove the file usin... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,885 | git | # Can't do a git pull
I'm trying to do a **git pull** and get the error message:
```
error: The following untracked working tree files would be overwritten by merge:
<myFileName>
Please move or remove them before you can merge.
```
So, I try to remove the file using the command **git rm --cache** which results in t... | You have untracked files in the way of the pull. You can't remove them with `git rm --cached` because they are untracked. They don't appear in the index. You need to remove them with plain old `rm` |
36927956 | How to do a forced-push to another branch in Git | 51 | 2016-04-29 01:09:24 | <p>Doing a forced push is done by:</p>
<pre class="lang-sh prettyprint-override"><code>git push origin +branch
</code></pre>
<p>Doing a push to a differently-named remote branch is done by:</p>
<pre class="lang-sh prettyprint-override"><code>git push origin local:remote
</code></pre>
<p>How does one do a forced pus... | 57,557 | 2,319,794 | 2020-06-11 21:08:45 | 36,928,149 | 23 | 2016-04-29 01:35:52 | 1,256,452 | 2020-03-16 17:59:21 | https://stackoverflow.com/q/36927956 | https://stackoverflow.com/a/36928149 | <p>Some people are not reading <a href="https://stackoverflow.com/a/36927977/1256452">Jeff Puckett's answer</a> first. Do that! This answer is about the use of the <code>+</code> force-push character, not about force-pushing in general.</p>
<hr>
<p>Just to be a bit more complete than the accepted answer: the syntax... | <p>Some people are not reading <a href="https://stackoverflow.com/a/36927977/1256452">Jeff Puckett's answer</a> first. Do that! This answer is about the use of the <code>+</code> force-push character, not about force-pushing in general.</p> <hr> <p>Just to be a bit more complete than the accepted answer: the syntax... | 119 | git | <h1>How to do a forced-push to another branch in Git</h1>
<p>Doing a forced push is done by:</p>
<pre class="lang-sh prettyprint-override"><code>git push origin +branch
</code></pre>
<p>Doing a push to a differently-named remote branch is done by:</p>
<pre class="lang-sh prettyprint-override"><code>git push origin l... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,887 | git | # How to do a forced-push to another branch in Git
Doing a forced push is done by:
```
git push origin +branch
```
Doing a push to a differently-named remote branch is done by:
```
git push origin local:remote
```
How does one do a forced push to a differently-named remote branch?
I tried:
```
git push origin lo... | Some people are not reading [Jeff Puckett's answer](https://stackoverflow.com/a/36927977/1256452) first. Do that! This answer is about the use of the `+` force-push character, not about force-pushing in general.
---
Just to be a bit more complete than the accepted answer: the syntax for a refspec is `[+][src][:dst]`,... |
56326940 | How to get Git Tag in Azure Pipelines | 45 | 2019-05-27 13:21:25 | <p>In Azure Pipelines, I have enabled git tags to trigger pipelines like so:</p>
<pre><code>trigger:
branches:
include:
- '*'
tags:
include:
- '*'
</code></pre>
<p>Now I want to know if there is a way to determine programmatically:</p>
<ol>
<li>Was the pipeline started from a git commit or git ta... | 42,417 | 1,212,017 | 2023-01-11 16:14:52 | 57,277,526 | 23 | 2019-07-30 18:00:48 | 3,369,879 | 2019-12-03 23:25:32 | https://stackoverflow.com/q/56326940 | https://stackoverflow.com/a/57277526 | <p>To check if the commit was from a tag, use:</p>
<pre><code>startsWith(variables['Build.SourceBranch'], 'refs/tags/')
</code></pre>
<p>From James Thurley:</p>
<blockquote>
<p>Get the name of the tag with:</p>
</blockquote>
<pre><code>$tags = git tag --sort=-creatordate
$tag = $tags[0]
</code></pre>
<blockquote... | <p>To check if the commit was from a tag, use:</p> <pre><code>startsWith(variables['Build.SourceBranch'], 'refs/tags/') </code></pre> <p>From James Thurley:</p> <blockquote> <p>Get the name of the tag with:</p> </blockquote> <pre><code>$tags = git tag --sort=-creatordate $tag = $tags[0] </code></pre> <blockquote... | 119, 60718, 116537, 119596 | azure-devops, azure-pipelines, git, git-tag | <h1>How to get Git Tag in Azure Pipelines</h1>
<p>In Azure Pipelines, I have enabled git tags to trigger pipelines like so:</p>
<pre><code>trigger:
branches:
include:
- '*'
tags:
include:
- '*'
</code></pre>
<p>Now I want to know if there is a way to determine programmatically:</p>
<ol>
<li>Was t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,888 | git | # How to get Git Tag in Azure Pipelines
In Azure Pipelines, I have enabled git tags to trigger pipelines like so:
```
trigger:
branches:
include:
- '*'
tags:
include:
- '*'
```
Now I want to know if there is a way to determine programmatically:
1. Was the pipeline started from a git commit or gi... | To check if the commit was from a tag, use:
```
startsWith(variables['Build.SourceBranch'], 'refs/tags/')
```
From James Thurley:
> Get the name of the tag with:
```
$tags = git tag --sort=-creatordate
$tag = $tags[0]
```
> This sorts the tags correctly for both annotated and unannotated tags,
> and so the first r... |
22388811 | Show git diff, ignoring file permission changes? | 44 | 2014-03-13 19:20:51 | <p>I have run several <code>chmod</code> in my live server. Right now when I do a <code>git diff</code> there, I see lots of <code>old mode 100644 new mode 100755</code></p>
<p>I have also changed some files there. But I would just git diff just to show the changes on the files, ignoring the file permissions changes.<... | 24,672 | 1,196,150 | 2020-05-01 09:09:24 | 22,388,985 | 23 | 2014-03-13 19:29:16 | 1,083,286 | 2014-03-13 19:29:16 | https://stackoverflow.com/q/22388811 | https://stackoverflow.com/a/22388985 | <p>This will tell git to ignore permissions:</p>
<pre><code>git config core.filemode false
</code></pre>
<p>to filter them in result of <code>diff</code> but not ignore them</p>
<pre><code>git filter-branch -f --tree-filter 'find * -type f | xargs chmod 644 ' -- --all
</code></pre>
| <p>This will tell git to ignore permissions:</p> <pre><code>git config core.filemode false </code></pre> <p>to filter them in result of <code>diff</code> but not ignore them</p> <pre><code>git filter-branch -f --tree-filter 'find * -type f | xargs chmod 644 ' -- --all </code></pre> | 119, 606, 9033 | diff, git, git-diff | <h1>Show git diff, ignoring file permission changes?</h1>
<p>I have run several <code>chmod</code> in my live server. Right now when I do a <code>git diff</code> there, I see lots of <code>old mode 100644 new mode 100755</code></p>
<p>I have also changed some files there. But I would just git diff just to show the cha... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,889 | git | # Show git diff, ignoring file permission changes?
I have run several `chmod` in my live server. Right now when I do a `git diff` there, I see lots of `old mode 100644 new mode 100755`
I have also changed some files there. But I would just git diff just to show the changes on the files, ignoring the file permissions ... | This will tell git to ignore permissions:
```
git config core.filemode false
```
to filter them in result of `diff` but not ignore them
```
git filter-branch -f --tree-filter 'find * -type f | xargs chmod 644 ' -- --all
``` |
9815416 | Preserve git --assume-unchanged files between branch checkouts | 44 | 2012-03-22 01:54:08 | <p>I've been using <code>git --assume-unchanged yacs/settings/development.py</code> to ignore my local database configuration file in my dev branch. But when I want to switch branches (for deployments), I get an error that I still have changes pending:</p>
<pre><code>% git checkout production
error: Your local changes... | 13,600 | 138,122 | 2019-12-09 18:57:08 | 9,816,844 | 23 | 2012-03-22 05:18:51 | 6,309 | 2019-12-09 18:57:08 | https://stackoverflow.com/q/9815416 | https://stackoverflow.com/a/9816844 | <p>You can try (<a href="http://linux.die.net/man/1/git-update-index" rel="nofollow noreferrer">git update-index man page</a>):</p>
<pre><code>git update-index --skip-worktree -- path
</code></pre>
<blockquote>
<p>Skip-worktree bit can be defined in one (long) sentence: When reading an entry, if it is marked as ski... | <p>You can try (<a href="http://linux.die.net/man/1/git-update-index" rel="nofollow noreferrer">git update-index man page</a>):</p> <pre><code>git update-index --skip-worktree -- path </code></pre> <blockquote> <p>Skip-worktree bit can be defined in one (long) sentence: When reading an entry, if it is marked as ski... | 119 | git | <h1>Preserve git --assume-unchanged files between branch checkouts</h1>
<p>I've been using <code>git --assume-unchanged yacs/settings/development.py</code> to ignore my local database configuration file in my dev branch. But when I want to switch branches (for deployments), I get an error that I still have changes pend... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,890 | git | # Preserve git --assume-unchanged files between branch checkouts
I've been using `git --assume-unchanged yacs/settings/development.py` to ignore my local database configuration file in my dev branch. But when I want to switch branches (for deployments), I get an error that I still have changes pending:
```
% git chec... | You can try ([git update-index man page](http://linux.die.net/man/1/git-update-index)):
```
git update-index --skip-worktree -- path
```
> Skip-worktree bit can be defined in one (long) sentence: When reading an entry, if it is marked as skip-worktree, then Git pretends its working directory version is up to date and... |
11005688 | git status shows modifications even with autocrlf=false | 43 | 2012-06-12 22:18:36 | <p>I'm experiencing the same issues as in this question: <a href="https://stackoverflow.com/questions/2016404/git-status-shows-modifications-git-checkout-file-doesnt-remove-them">git status shows modifications, git checkout -- <file> doesn't remove them</a></p>
<p>Git continues to show working directory modi... | 16,781 | 58,391 | 2023-05-10 22:24:25 | 15,161,420 | 23 | 2013-03-01 15:39:37 | 438,249 | 2015-09-11 18:14:25 | https://stackoverflow.com/q/11005688 | https://stackoverflow.com/a/15161420 | <p>This seems like a bug in msysgit indeed. As a workaround, try creating a <a href="https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html" rel="noreferrer">.gitattributes</a> file containing</p>
<pre><code>* -text
</code></pre>
<p>This will tell git not to perform EOL conversions on any files.</p>
| <p>This seems like a bug in msysgit indeed. As a workaround, try creating a <a href="https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html" rel="noreferrer">.gitattributes</a> file containing</p> <pre><code>* -text </code></pre> <p>This will tell git not to perform EOL conversions on any files.</p> | 119, 12309, 54839, 59139 | core.autocrlf, git, git-status, revert | <h1>git status shows modifications even with autocrlf=false</h1>
<p>I'm experiencing the same issues as in this question: <a href="https://stackoverflow.com/questions/2016404/git-status-shows-modifications-git-checkout-file-doesnt-remove-them">git status shows modifications, git checkout -- <file> doesn't rem... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,891 | git | # git status shows modifications even with autocrlf=false
I'm experiencing the same issues as in this question: [git status shows modifications, git checkout -- <file> doesn't remove them](https://stackoverflow.com/questions/2016404/git-status-shows-modifications-git-checkout-file-doesnt-remove-them)
Git continues to... | This seems like a bug in msysgit indeed. As a workaround, try creating a [.gitattributes](https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html) file containing
```
* -text
```
This will tell git not to perform EOL conversions on any files. |
15072125 | "git add" returning "fatal: outside repository" error | 43 | 2013-02-25 16:54:54 | <p>I'm just entering into the wonderful world of git.
I have to submit a bunch of changes that I've made on my program, located in a directory called <code>/var/www/myapp</code>.</p>
<p>I created a new directory <code>/home/mylogin/gitclone</code>. From this directory, I did a <code>git clone</code> against the publ... | 125,581 | 1,078,009 | 2021-02-18 06:57:20 | 15,072,198 | 23 | 2013-02-25 16:57:55 | 1,977,626 | 2020-09-09 17:58:34 | https://stackoverflow.com/q/15072125 | https://stackoverflow.com/a/15072198 | <p>First in the clone folder you can create a Branch (so the master stay untouched)</p>
<pre><code>git branch [branch_name]
</code></pre>
<p>After, just copy the files you want from your old folder to the clone folder.</p>
<p>When you are done, just add / commit your change and <a href="http://git-scm.com/book/en/Git-B... | <p>First in the clone folder you can create a Branch (so the master stay untouched)</p> <pre><code>git branch [branch_name] </code></pre> <p>After, just copy the files you want from your old folder to the clone folder.</p> <p>When you are done, just add / commit your change and <a href="http://git-scm.com/book/en/Git-B... | 58, 119, 7330 | git, linux, repository | <h1>"git add" returning "fatal: outside repository" error</h1>
<p>I'm just entering into the wonderful world of git.
I have to submit a bunch of changes that I've made on my program, located in a directory called <code>/var/www/myapp</code>.</p>
<p>I created a new directory <code>/home/mylogin/gitclone</code>. From ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,892 | git | # "git add" returning "fatal: outside repository" error
I'm just entering into the wonderful world of git.
I have to submit a bunch of changes that I've made on my program, located in a directory called `/var/www/myapp`.
I created a new directory `/home/mylogin/gitclone`. From this directory, I did a `git clone` agai... | First in the clone folder you can create a Branch (so the master stay untouched)
```
git branch [branch_name]
```
After, just copy the files you want from your old folder to the clone folder.
When you are done, just add / commit your change and [Merge your branch](http://git-scm.com/book/en/Git-Branching-Basic-Branc... |
58522318 | GIT error in Azure DEVOPS - SSL certificate problem: self signed certificate in certificate chain Pushing | 42 | 2019-10-23 11:55:39 | <p>When pushing a commit to Azure Devops I am getting this error.</p>
<blockquote>
<p>Error encountered while pushing to the remote repository: Git failed
with a fatal error. unable to access
'https://xx@dev.azure.com/xx/Lulo/_git/LuloBackend/': SSL certificate
problem: self signed certificate in certificate chain Push... | 89,089 | 1,014,217 | 2023-10-05 04:32:11 | 58,536,752 | 23 | 2019-10-24 07:58:28 | 12,044,291 | 2019-10-24 07:58:28 | https://stackoverflow.com/q/58522318 | https://stackoverflow.com/a/58536752 | <p>According to the error message, you can use <code>git config --global http.sslVerify false</code> to resolve the error.</p>
| <p>According to the error message, you can use <code>git config --global http.sslVerify false</code> to resolve the error.</p> | 119, 33953, 116537 | azure-devops, git, visual-studio | <h1>GIT error in Azure DEVOPS - SSL certificate problem: self signed certificate in certificate chain Pushing</h1>
<p>When pushing a commit to Azure Devops I am getting this error.</p>
<blockquote>
<p>Error encountered while pushing to the remote repository: Git failed
with a fatal error. unable to access
'https://xx@d... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,893 | git | # GIT error in Azure DEVOPS - SSL certificate problem: self signed certificate in certificate chain Pushing
When pushing a commit to Azure Devops I am getting this error.
> Error encountered while pushing to the remote repository: Git failed
> with a fatal error. unable to access
> 'https://xx@dev.azure.com/xx/Lulo/_... | According to the error message, you can use `git config --global http.sslVerify false` to resolve the error. |
9870632 | How do I configure Git in Xcode to work with BitBucket | 39 | 2012-03-26 10:39:44 | <p>I have a project which I have been on for ages which is not connected to any source code repository.</p>
<p>I want to start using BitBucket now, however I am not sure how to go about it. I have created a project in BitBucket.</p>
<p>Should I now clone and check out in Xcode or should I add a repository in xcode. ... | 65,706 | 351,126 | 2021-11-01 12:32:05 | 48,065,931 | 23 | 2018-01-02 18:24:25 | 6,136,287 | 2018-01-02 18:24:25 | https://stackoverflow.com/q/9870632 | https://stackoverflow.com/a/48065931 | <p>As of 2017, xCode now automatically creates repositories for new projects. To push to a new BitBucket repo, go to 'Source Control' > 'Commit...' in xCode and make your first local commit.</p>
<p>Next open a terminal and navigate to to the top-level directory of your project. If you <code>ls -a</code> in here you sh... | <p>As of 2017, xCode now automatically creates repositories for new projects. To push to a new BitBucket repo, go to 'Source Control' > 'Commit...' in xCode and make your first local commit.</p> <p>Next open a terminal and navigate to to the top-level directory of your project. If you <code>ls -a</code> in here you sh... | 119, 154, 908, 8337 | bitbucket, git, iphone, xcode | <h1>How do I configure Git in Xcode to work with BitBucket</h1>
<p>I have a project which I have been on for ages which is not connected to any source code repository.</p>
<p>I want to start using BitBucket now, however I am not sure how to go about it. I have created a project in BitBucket.</p>
<p>Should I now clon... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,895 | git | # How do I configure Git in Xcode to work with BitBucket
I have a project which I have been on for ages which is not connected to any source code repository.
I want to start using BitBucket now, however I am not sure how to go about it. I have created a project in BitBucket.
Should I now clone and check out in Xcode... | As of 2017, xCode now automatically creates repositories for new projects. To push to a new BitBucket repo, go to 'Source Control' > 'Commit...' in xCode and make your first local commit.
Next open a terminal and navigate to to the top-level directory of your project. If you `ls -a` in here you should see the `.git/` ... |
5012086 | Does git support wildcards in paths? | 39 | 2011-02-16 03:01:49 | <p>I have looked, searched, and read documentation and can't really find anything about this.</p>
<p>Basically, I want to be able to do this:</p>
<pre><code>git reset -- *.exe
</code></pre>
<p>or</p>
<pre><code>git reset -- */some_executable.exe
</code></pre>
<p>Instead of this:</p>
<pre><code>git reset -- some/v... | 37,603 | 295,901 | 2024-09-25 14:45:03 | 5,012,124 | 23 | 2011-02-16 03:10:14 | 2,726 | 2011-02-16 03:10:14 | https://stackoverflow.com/q/5012086 | https://stackoverflow.com/a/5012124 | <p>Git does support some pathspec globbing, but you need to be careful to shell-escape the characters so they aren't interpreted by in your case, msys bash, which doesn't support more sophisticated wildcard expansion.</p>
<p>EDIT: Also, for your reset example, you can just pass the directory as an argument to git rese... | <p>Git does support some pathspec globbing, but you need to be careful to shell-escape the characters so they aren't interpreted by in your case, msys bash, which doesn't support more sophisticated wildcard expansion.</p> <p>EDIT: Also, for your reset example, you can just pass the directory as an argument to git rese... | 119, 21628 | git, msysgit | <h1>Does git support wildcards in paths?</h1>
<p>I have looked, searched, and read documentation and can't really find anything about this.</p>
<p>Basically, I want to be able to do this:</p>
<pre><code>git reset -- *.exe
</code></pre>
<p>or</p>
<pre><code>git reset -- */some_executable.exe
</code></pre>
<p>Instea... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,896 | git | # Does git support wildcards in paths?
I have looked, searched, and read documentation and can't really find anything about this.
Basically, I want to be able to do this:
```
git reset -- *.exe
```
or
```
git reset -- */some_executable.exe
```
Instead of this:
```
git reset -- some/very/long/path/some_executable... | Git does support some pathspec globbing, but you need to be careful to shell-escape the characters so they aren't interpreted by in your case, msys bash, which doesn't support more sophisticated wildcard expansion.
EDIT: Also, for your reset example, you can just pass the directory as an argument to git reset and git ... |
49715421 | Does the order of Git merging matter? | 36 | 2018-04-08 07:13:46 | <p>Suppose I have two branches, <code>A</code> and <code>B</code>. Do the following properties hold?</p>
<ul>
<li>Merging <code>A</code> into <code>B</code> conflicts if and only if merging <code>B</code> into <code>A</code> conflicts.</li>
<li>The contents of my files after merging <code>A</code> into <code>B</code>... | 10,476 | 997,606 | 2018-04-10 00:25:20 | 49,721,107 | 23 | 2018-04-08 18:10:59 | 1,256,452 | 2018-04-08 19:59:14 | https://stackoverflow.com/q/49715421 | https://stackoverflow.com/a/49721107 | <p><a href="https://stackoverflow.com/a/49716037/1256452">cmaster's answer</a> is correct, with caveats. Let's start by noting these items / assumptions:</p>
<ul>
<li>There is always a single merge base commit. Let's call this commit <em>B</em>, for base.</li>
<li>The other two inputs are also single commits. Let's... | <p><a href="https://stackoverflow.com/a/49716037/1256452">cmaster's answer</a> is correct, with caveats. Let's start by noting these items / assumptions:</p> <ul> <li>There is always a single merge base commit. Let's call this commit <em>B</em>, for base.</li> <li>The other two inputs are also single commits. Let's... | 119, 28897 | git, git-merge | <h1>Does the order of Git merging matter?</h1>
<p>Suppose I have two branches, <code>A</code> and <code>B</code>. Do the following properties hold?</p>
<ul>
<li>Merging <code>A</code> into <code>B</code> conflicts if and only if merging <code>B</code> into <code>A</code> conflicts.</li>
<li>The contents of my files a... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,898 | git | # Does the order of Git merging matter?
Suppose I have two branches, `A` and `B`. Do the following properties hold?
- Merging `A` into `B` conflicts if and only if merging `B` into `A` conflicts.
- The contents of my files after merging `A` into `B` is the same as the contents of my files after merging `B` into `A`. | [cmaster's answer](https://stackoverflow.com/a/49716037/1256452) is correct, with caveats. Let's start by noting these items / assumptions:
- There is always a single merge base commit. Let's call this commit *B*, for base.
- The other two inputs are also single commits. Let's call them *L* for left / local (`--ours`)... |
24966271 | Why doesn't `git diff` invoke external diff tool? | 35 | 2014-07-26 00:17:56 | <p>In my repository, if I type</p>
<pre><code>$ git diff some-file
</code></pre>
<p>or</p>
<pre><code>$ git difftool some-file
</code></pre>
<p>I get the in-terminal diff display. I think this should not happen, because I have set up an external diff tool, as shown by the output of <code>git config -l</code>:</p>
... | 21,301 | 2,665,591 | 2021-08-04 17:59:10 | 24,967,334 | 23 | 2014-07-26 03:45:21 | 6,309 | 2021-08-04 17:59:10 | https://stackoverflow.com/q/24966271 | https://stackoverflow.com/a/24967334 | <blockquote>
<p>I get the in-terminal diff display. I this should not happen, because I have set up an external diff tool</p>
</blockquote>
<p>Yes, it should: diff.external <em>is</em> for "in-terminal diff display".</p>
<p>(from <a href="http://git-scm.com/docs/git-config/2.0.0" rel="nofollow noreferrer"><co... | <blockquote> <p>I get the in-terminal diff display. I this should not happen, because I have set up an external diff tool</p> </blockquote> <p>Yes, it should: diff.external <em>is</em> for "in-terminal diff display".</p> <p>(from <a href="http://git-scm.com/docs/git-config/2.0.0" rel="nofollow noreferrer"><co... | 119, 606, 13630 | diff, git, meld | <h1>Why doesn't `git diff` invoke external diff tool?</h1>
<p>In my repository, if I type</p>
<pre><code>$ git diff some-file
</code></pre>
<p>or</p>
<pre><code>$ git difftool some-file
</code></pre>
<p>I get the in-terminal diff display. I think this should not happen, because I have set up an external diff tool, ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,899 | git | # Why doesn't `git diff` invoke external diff tool?
In my repository, if I type
```
$ git diff some-file
```
or
```
$ git difftool some-file
```
I get the in-terminal diff display. I think this should not happen, because I have set up an external diff tool, as shown by the output of `git config -l`:
```
$ git con... | > I get the in-terminal diff display. I this should not happen, because I have set up an external diff tool
Yes, it should: diff.external *is* for "in-terminal diff display".
(from [`git config` man page](http://git-scm.com/docs/git-config/2.0.0))
```
diff.external
```
> If this config variable is set, **diff gener... |
52256490 | Package Manager vs. Git Submodule/Subtree | 33 | 2018-09-10 11:07:43 | <p>Are there any reasons to use a package manager rather than git submodules/subtrees, or vice versa? The git solutions seem to be a lot more hassle than a simple package manager.</p>
<p>Assume that the space-saving benefit of git submodules is not important.</p>
| 15,281 | 8,076,767 | 2023-08-02 11:24:43 | 53,894,550 | 23 | 2018-12-22 09:37:09 | 6,309 | 2020-05-10 16:42:00 | https://stackoverflow.com/q/52256490 | https://stackoverflow.com/a/53894550 | <blockquote>
<p>The git solutions seem to be a lot more hassle than a simple package manager.</p>
</blockquote>
<p>This is not about <em>hassle</em>.</p>
<p>This is about two different ways to build a project:</p>
<ol>
<li>through binary dependencies, with a package manager (<a href="https://www.sonatype.com/nexus... | <blockquote> <p>The git solutions seem to be a lot more hassle than a simple package manager.</p> </blockquote> <p>This is not about <em>hassle</em>.</p> <p>This is about two different ways to build a project:</p> <ol> <li>through binary dependencies, with a package manager (<a href="https://www.sonatype.com/nexus... | 119, 8335, 24170, 41612, 68200 | dependency-management, git, git-submodules, git-subtree, package-managers | <h1>Package Manager vs. Git Submodule/Subtree</h1>
<p>Are there any reasons to use a package manager rather than git submodules/subtrees, or vice versa? The git solutions seem to be a lot more hassle than a simple package manager.</p>
<p>Assume that the space-saving benefit of git submodules is not important.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,900 | git | # Package Manager vs. Git Submodule/Subtree
Are there any reasons to use a package manager rather than git submodules/subtrees, or vice versa? The git solutions seem to be a lot more hassle than a simple package manager.
Assume that the space-saving benefit of git submodules is not important. | > The git solutions seem to be a lot more hassle than a simple package manager.
This is not about *hassle*.
This is about two different ways to build a project:
1. through binary dependencies, with a package manager ([Nexus](https://www.sonatype.com/nexus-repository-sonatype), or [Conan for C++](https://conan.io/): ... |
8333870 | Is there an advantage to using --no-metadata in git svn clone? | 32 | 2011-11-30 22:27:34 | <p>I'm doing a one-way convert from an SVN repository to a Git repository using <code>git svn clone</code>. Most examples do this with the <code>--no-metadata</code> flag - is there an advantage to using this flag?</p>
<p>I understand that the flag removes the SVN revision numbers. I can think of reasons why it may ... | 14,582 | 546,561 | 2015-07-30 13:13:38 | 31,724,831 | 23 | 2015-07-30 13:13:38 | 42,473 | 2015-07-30 13:13:38 | https://stackoverflow.com/q/8333870 | https://stackoverflow.com/a/31724831 | <p>One argument for using <code>--no-metadata</code> is that it doesn't change your commit messages. So even if you fetch from different locations, the commit messages will be the same and thus the commit hashes will be the same.</p>
<p>As an example, if I <code>git svn init</code> a repo from a local <code>file:</cod... | <p>One argument for using <code>--no-metadata</code> is that it doesn't change your commit messages. So even if you fetch from different locations, the commit messages will be the same and thus the commit hashes will be the same.</p> <p>As an example, if I <code>git svn init</code> a repo from a local <code>file:</cod... | 63, 119, 456, 6452 | git, git-svn, svn, version-control | <h1>Is there an advantage to using --no-metadata in git svn clone?</h1>
<p>I'm doing a one-way convert from an SVN repository to a Git repository using <code>git svn clone</code>. Most examples do this with the <code>--no-metadata</code> flag - is there an advantage to using this flag?</p>
<p>I understand that the fl... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,902 | git | # Is there an advantage to using --no-metadata in git svn clone?
I'm doing a one-way convert from an SVN repository to a Git repository using `git svn clone`. Most examples do this with the `--no-metadata` flag - is there an advantage to using this flag?
I understand that the flag removes the SVN revision numbers. I ... | One argument for using `--no-metadata` is that it doesn't change your commit messages. So even if you fetch from different locations, the commit messages will be the same and thus the commit hashes will be the same.
As an example, if I `git svn init` a repo from a local `file:` URL and later pull from an `https:` URL,... |
1685228 | How to "cat" a file in JGit? | 31 | 2009-11-06 03:28:38 | <p>A while back I was looking for an <a href="https://stackoverflow.com/questions/177469/embeddable-distributed-version-control-system-in-java">embeddable distributed version control system in Java</a>,
and I think I have found it in <a href="http://www.eclipse.org/egit/" rel="noreferrer">JGit</a>, which is a pure Java... | 15,706 | 14,955 | 2020-04-03 03:59:23 | 7,427,658 | 23 | 2011-09-15 08:05:41 | 412,409 | 2012-07-04 17:58:34 | https://stackoverflow.com/q/1685228 | https://stackoverflow.com/a/7427658 | <p>Unfortunately Thilo's answer does not work with the latest JGit API. Here is the solution I found:</p>
<pre><code>File repoDir = new File("test-git");
// open the repository
Repository repository = new Repository(repoDir);
// find the HEAD
ObjectId lastCommitId = repository.resolve(Constants.HEAD);
// now we have t... | <p>Unfortunately Thilo's answer does not work with the latest JGit API. Here is the solution I found:</p> <pre><code>File repoDir = new File("test-git"); // open the repository Repository repository = new Repository(repoDir); // find the HEAD ObjectId lastCommitId = repository.resolve(Constants.HEAD); // now we have t... | 17, 119, 61058 | git, java, jgit | <h1>How to "cat" a file in JGit?</h1>
<p>A while back I was looking for an <a href="https://stackoverflow.com/questions/177469/embeddable-distributed-version-control-system-in-java">embeddable distributed version control system in Java</a>,
and I think I have found it in <a href="http://www.eclipse.org/egit/" rel="nore... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,904 | git | # How to "cat" a file in JGit?
A while back I was looking for an [embeddable distributed version control system in Java](https://stackoverflow.com/questions/177469/embeddable-distributed-version-control-system-in-java),
and I think I have found it in [JGit](http://www.eclipse.org/egit/), which is a pure Java implement... | Unfortunately Thilo's answer does not work with the latest JGit API. Here is the solution I found:
```
File repoDir = new File("test-git");
// open the repository
Repository repository = new Repository(repoDir);
// find the HEAD
ObjectId lastCommitId = repository.resolve(Constants.HEAD);
// now we have to get the comm... |
3553270 | How to config git to pull from http and push through ssh in one 'remote'? | 31 | 2010-08-24 02:59:13 | <p>Pulling from http to escape authentication(so I don't need to type password if I'm not using ssh.keygen).</p>
<p>Pushing through ssh with authentication.</p>
| 13,511 | 398,646 | 2022-04-22 19:35:39 | 3,553,289 | 23 | 2010-08-24 03:05:21 | 148,870 | 2010-08-24 03:05:21 | https://stackoverflow.com/q/3553270 | https://stackoverflow.com/a/3553289 | <p>From the <a href="http://git-scm.com/docs/git-config" rel="noreferrer"><code>git-config</code> man page</a>:</p>
<blockquote>
<p><code>remote.<name>.url</code> The URL of a remote
repository. See git-fetch(1) or
git-push(1).</p>
<p><code>remote.<name>.pushurl</code> The push URL of
a remote... | <p>From the <a href="http://git-scm.com/docs/git-config" rel="noreferrer"><code>git-config</code> man page</a>:</p> <blockquote> <p><code>remote.<name>.url</code> The URL of a remote repository. See git-fetch(1) or git-push(1).</p> <p><code>remote.<name>.pushurl</code> The push URL of a remote... | 119, 183, 28896, 28898 | authentication, git, git-pull, git-push | <h1>How to config git to pull from http and push through ssh in one 'remote'?</h1>
<p>Pulling from http to escape authentication(so I don't need to type password if I'm not using ssh.keygen).</p>
<p>Pushing through ssh with authentication.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,905 | git | # How to config git to pull from http and push through ssh in one 'remote'?
Pulling from http to escape authentication(so I don't need to type password if I'm not using ssh.keygen).
Pushing through ssh with authentication. | From the [`git-config` man page](http://git-scm.com/docs/git-config):
> `remote.<name>.url` The URL of a remote
> repository. See git-fetch(1) or
> git-push(1).
>
> `remote.<name>.pushurl` The push URL of
> a remote repository. See git-push(1).
Try setting the former to an `http:` url and the latter to a `git+ssh:` (... |
8382212 | How to create a branch in a bare repository in Git | 30 | 2011-12-05 07:33:15 | <p>I current have a bare repo thats acts as a central repo for my team. The bare repo currently only have a branch "master". How can I create more branches on the bare repo? </p>
| 27,015 | 1,081,105 | 2019-08-05 01:36:30 | 8,382,243 | 23 | 2011-12-05 07:36:54 | 421,223 | 2011-12-05 18:36:48 | https://stackoverflow.com/q/8382212 | https://stackoverflow.com/a/8382243 | <p>Usually you don't create branches directly in the bare repository, but you push branches from one work repository to the bare</p>
<pre><code>git push origin myBranch
</code></pre>
<p>Update: Worth to mention</p>
<p>Like Paul Pladijs mentioned in the comments with</p>
<pre><code>git push origin localBranchName:re... | <p>Usually you don't create branches directly in the bare repository, but you push branches from one work repository to the bare</p> <pre><code>git push origin myBranch </code></pre> <p>Update: Worth to mention</p> <p>Like Paul Pladijs mentioned in the comments with</p> <pre><code>git push origin localBranchName:re... | 119 | git | <h1>How to create a branch in a bare repository in Git</h1>
<p>I current have a bare repo thats acts as a central repo for my team. The bare repo currently only have a branch "master". How can I create more branches on the bare repo? </p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,907 | git | # How to create a branch in a bare repository in Git
I current have a bare repo thats acts as a central repo for my team. The bare repo currently only have a branch "master". How can I create more branches on the bare repo? | Usually you don't create branches directly in the bare repository, but you push branches from one work repository to the bare
```
git push origin myBranch
```
Update: Worth to mention
Like Paul Pladijs mentioned in the comments with
```
git push origin localBranchName:remoteBranchName
```
you push (and create, if ... |
2082296 | How do patches work in Git? | 30 | 2010-01-17 19:30:35 | <p>I'm new to Git, but familiar with SVN. As a test I made a repository in a local directory with <code>git init</code>. Then I cloned the empty repository (over SSH using 127.0.0.1, which is another thing I wanted to test) to another local directory. I added some files in repository 2, I did <code>git add *</code> and... | 20,763 | 217,649 | 2022-05-26 15:59:02 | 2,082,307 | 23 | 2010-01-17 19:33:54 | 82,865 | 2010-01-17 19:33:54 | https://stackoverflow.com/q/2082296 | https://stackoverflow.com/a/2082307 | <p>Create your patch via:</p>
<pre><code>$ git format-patch master --stdout > patch.diff
</code></pre>
<p>then patch.diff will contain the diff, which you can then send to someone else to apply using:</p>
<pre><code>$ git am < patch.diff
</code></pre>
<p>Sometimes, when the manuals are a little dense, it make... | <p>Create your patch via:</p> <pre><code>$ git format-patch master --stdout > patch.diff </code></pre> <p>then patch.diff will contain the diff, which you can then send to someone else to apply using:</p> <pre><code>$ git am < patch.diff </code></pre> <p>Sometimes, when the manuals are a little dense, it make... | 119, 2132 | git, patch | <h1>How do patches work in Git?</h1>
<p>I'm new to Git, but familiar with SVN. As a test I made a repository in a local directory with <code>git init</code>. Then I cloned the empty repository (over SSH using 127.0.0.1, which is another thing I wanted to test) to another local directory. I added some files in repositor... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,908 | git | # How do patches work in Git?
I'm new to Git, but familiar with SVN. As a test I made a repository in a local directory with `git init`. Then I cloned the empty repository (over SSH using 127.0.0.1, which is another thing I wanted to test) to another local directory. I added some files in repository 2, I did `git add ... | Create your patch via:
```
$ git format-patch master --stdout > patch.diff
```
then patch.diff will contain the diff, which you can then send to someone else to apply using:
```
$ git am < patch.diff
```
Sometimes, when the manuals are a little dense, it makes sense to look for a tutorial:
<http://luhman.org/blog/... |
26049272 | Git won't add modified file | 29 | 2014-09-25 22:36:30 | <p>No idea why this is happening:</p>
<pre><code>git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in subm... | 45,232 | 2,069,715 | 2022-10-13 11:23:44 | 26,051,233 | 23 | 2014-09-26 02:40:04 | 4,049,331 | 2014-09-26 09:01:29 | https://stackoverflow.com/q/26049272 | https://stackoverflow.com/a/26051233 | <p>I think maybe Jubobs' comment is correct. Is your "file" a submodule?</p>
<p>This line <em>(commit or discard the untracked or modified content in submodules)</em> should not appear for normal files.</p>
<p>Here is what I get from git status:</p>
<pre><code>$ git status
On branch master
Changes not staged for com... | <p>I think maybe Jubobs' comment is correct. Is your "file" a submodule?</p> <p>This line <em>(commit or discard the untracked or modified content in submodules)</em> should not appear for normal files.</p> <p>Here is what I get from git status:</p> <pre><code>$ git status On branch master Changes not staged for com... | 119, 34792 | git, git-add | <h1>Git won't add modified file</h1>
<p>No idea why this is happening:</p>
<pre><code>git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,909 | git | # Git won't add modified file
No idea why this is happening:
```
git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in... | I think maybe Jubobs' comment is correct. Is your "file" a submodule?
This line *(commit or discard the untracked or modified content in submodules)* should not appear for normal files.
Here is what I get from git status:
```
$ git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to ... |
7301289 | Conflicts in Gemfile.lock while rebasing | 29 | 2011-09-04 18:28:30 | <p>What strategies do people have for resolving Gemfile.lock conflicts while rebasing in Git?</p>
<p>I am having to do this a lot in a recent project, and not only is it tedious, it's not always clear how to do the merge.</p>
| 5,913 | 261,184 | 2014-01-17 20:20:15 | 7,301,359 | 23 | 2011-09-04 18:39:52 | 6,309 | 2013-01-14 07:42:00 | https://stackoverflow.com/q/7301289 | https://stackoverflow.com/a/7301359 | <p>you could relock it on every merge, through a <strong>merge driver</strong> (that I usually use to <a href="https://stackoverflow.com/questions/928646/how-do-i-tell-git-to-always-select-my-local-version-for-conflicted-merges-on-a-sp">always keep the local version of a file during a merge</a>).</p>
<p>See "<a hr... | <p>you could relock it on every merge, through a <strong>merge driver</strong> (that I usually use to <a href="https://stackoverflow.com/questions/928646/how-do-i-tell-git-to-always-select-my-local-version-for-conflicted-merges-on-a-sp">always keep the local version of a file during a merge</a>).</p> <p>See "<a hr... | 119, 3146, 8974, 43112, 64108 | bundler, conflict, git, rebase, ruby-on-rails-3 | <h1>Conflicts in Gemfile.lock while rebasing</h1>
<p>What strategies do people have for resolving Gemfile.lock conflicts while rebasing in Git?</p>
<p>I am having to do this a lot in a recent project, and not only is it tedious, it's not always clear how to do the merge.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,910 | git | # Conflicts in Gemfile.lock while rebasing
What strategies do people have for resolving Gemfile.lock conflicts while rebasing in Git?
I am having to do this a lot in a recent project, and not only is it tedious, it's not always clear how to do the merge. | you could relock it on every merge, through a **merge driver** (that I usually use to [always keep the local version of a file during a merge](https://stackoverflow.com/questions/928646/how-do-i-tell-git-to-always-select-my-local-version-for-conflicted-merges-on-a-sp)).
See "[Auto Merge Gemfile.lock](http://bitfission... |
3953497 | What's the best way to have a "temporary" commit in git? | 28 | 2010-10-17 13:54:18 | <p>Say I have a project with two branches master and dev. I have a bunch of commits on dev for a special event which once tested are merged into master. Then after the event is over I want to remove the event specific code. However a git reset won't do since other commits have been made since the event code was added.<... | 41,034 | 268,366 | 2017-01-06 04:54:29 | 3,953,521 | 23 | 2010-10-17 13:58:37 | 210 | 2010-10-17 13:58:37 | https://stackoverflow.com/q/3953497 | https://stackoverflow.com/a/3953521 | <p>Take master and create a branch: <code>git checkout -b special-event</code>, make/apply your changes. Once the event is over, simply switch back to master and abandon/delete the branch.</p>
<p>In order to continue making changes, make them on master and merge them into the special branch as you go. <code>git checko... | <p>Take master and create a branch: <code>git checkout -b special-event</code>, make/apply your changes. Once the event is over, simply switch back to master and abandon/delete the branch.</p> <p>In order to continue making changes, make them on master and merge them into the special branch as you go. <code>git checko... | 119, 6710 | git, temporary | <h1>What's the best way to have a "temporary" commit in git?</h1>
<p>Say I have a project with two branches master and dev. I have a bunch of commits on dev for a special event which once tested are merged into master. Then after the event is over I want to remove the event specific code. However a git reset won't do s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,912 | git | # What's the best way to have a "temporary" commit in git?
Say I have a project with two branches master and dev. I have a bunch of commits on dev for a special event which once tested are merged into master. Then after the event is over I want to remove the event specific code. However a git reset won't do since othe... | Take master and create a branch: `git checkout -b special-event`, make/apply your changes. Once the event is over, simply switch back to master and abandon/delete the branch.
In order to continue making changes, make them on master and merge them into the special branch as you go. `git checkout master` ... make change... |
48652545 | Setting credentials for https git clone in AWS CodeBuild | 27 | 2018-02-06 21:49:30 | <p>I am running a CodeBuild on a project that has private requirements stored in CodeCommit.</p>
<p>I need to add a command in <code>buildspec.yml</code> that loads the https git credentials so <code>git clone</code> works when CodeBuild runs <code>pip install</code>. </p>
<p>The build fails with <code>fatal: could n... | 23,969 | 6,946,673 | 2022-02-07 14:01:38 | 48,653,554 | 23 | 2018-02-06 23:21:16 | 5,095,975 | 2018-08-09 16:21:32 | https://stackoverflow.com/q/48652545 | https://stackoverflow.com/a/48653554 | <p>Since the CodeBuild environment uses an IAM role for credentials (not a username and password), you will need to configure the <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-unixes.html#setting-up-https-unixes-credential-helper" rel="noreferrer">CodeCommit credential helper</a> in ... | <p>Since the CodeBuild environment uses an IAM role for credentials (not a username and password), you will need to configure the <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-unixes.html#setting-up-https-unixes-credential-helper" rel="noreferrer">CodeCommit credential helper</a> in ... | 119, 32868, 33388, 123484 | amazon-web-services, aws-codebuild, git, git-config | <h1>Setting credentials for https git clone in AWS CodeBuild</h1>
<p>I am running a CodeBuild on a project that has private requirements stored in CodeCommit.</p>
<p>I need to add a command in <code>buildspec.yml</code> that loads the https git credentials so <code>git clone</code> works when CodeBuild runs <code>pip ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,914 | git | # Setting credentials for https git clone in AWS CodeBuild
I am running a CodeBuild on a project that has private requirements stored in CodeCommit.
I need to add a command in `buildspec.yml` that loads the https git credentials so `git clone` works when CodeBuild runs `pip install`.
The build fails with `fatal: cou... | Since the CodeBuild environment uses an IAM role for credentials (not a username and password), you will need to configure the [CodeCommit credential helper](https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-unixes.html#setting-up-https-unixes-credential-helper) in your buildspec:
```
phases:
... |
10200307 | How to git fetch and checkout without creating a remote branch locally? | 27 | 2012-04-17 22:46:25 | <p>Use Case: I have some repo on GitHub, someone forked it and added new feature and initiated pull request.
I can't automatically merge it because there are some minor problems I would like to fix first. </p>
<p>It's one-time activity I'll never need this remote repository, so I don't want to create local <code>remo... | 8,365 | 231,624 | 2019-08-28 13:44:50 | 10,200,358 | 23 | 2012-04-17 22:52:12 | 184,050 | 2018-04-05 19:23:53 | https://stackoverflow.com/q/10200307 | https://stackoverflow.com/a/10200358 | <p>You want to use <code>FETCH_HEAD</code>.</p>
<p>whenever you run <code>git fetch ...</code> a magic reference called <code>FETCH_HEAD</code> is created.</p>
<p>Try for example:</p>
<pre><code>git fetch git://github.com/xxx/xxx.git branch_name && git merge FETCH_HEAD
</code></pre>
| <p>You want to use <code>FETCH_HEAD</code>.</p> <p>whenever you run <code>git fetch ...</code> a magic reference called <code>FETCH_HEAD</code> is created.</p> <p>Try for example:</p> <pre><code>git fetch git://github.com/xxx/xxx.git branch_name && git merge FETCH_HEAD </code></pre> | 119, 717, 4860, 33720, 37230 | git, git-checkout, git-fetch, merge, pull | <h1>How to git fetch and checkout without creating a remote branch locally?</h1>
<p>Use Case: I have some repo on GitHub, someone forked it and added new feature and initiated pull request.
I can't automatically merge it because there are some minor problems I would like to fix first. </p>
<p>It's one-time activity I... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,916 | git | # How to git fetch and checkout without creating a remote branch locally?
Use Case: I have some repo on GitHub, someone forked it and added new feature and initiated pull request.
I can't automatically merge it because there are some minor problems I would like to fix first.
It's one-time activity I'll never need thi... | You want to use `FETCH_HEAD`.
whenever you run `git fetch ...` a magic reference called `FETCH_HEAD` is created.
Try for example:
```
git fetch git://github.com/xxx/xxx.git branch_name && git merge FETCH_HEAD
``` |
2003491 | How to commit one file at a time using Git? | 27 | 2010-01-05 01:08:17 | <p>Say there are several files modified and I just want one files committed each time. How to do that? Given an example with status looks like below. Thanks!!</p>
<p>Ex:</p>
<pre><code>> git status
# modified: file01.txt
# modified: file02.txt
# modified: file03.txt
# modified: file04.txt
# modified: fil... | 31,744 | 207,419 | 2013-08-08 09:49:52 | 2,003,518 | 23 | 2010-01-05 01:14:55 | 229,761 | 2010-01-05 01:14:55 | https://stackoverflow.com/q/2003491 | https://stackoverflow.com/a/2003518 | <p>There are a few ways, but the simplest is probably:</p>
<pre><code>git commit file01.txt
git commit file02.txt
...
</code></pre>
<p>Any paths you list after the commit command will be committed regardless of whether they're staged to be committed. Alternatively, you can stage each one, and then commit:</p>
<pre><... | <p>There are a few ways, but the simplest is probably:</p> <pre><code>git commit file01.txt git commit file02.txt ... </code></pre> <p>Any paths you list after the commit command will be committed regardless of whether they're staged to be committed. Alternatively, you can stage each one, and then commit:</p> <pre><... | 119 | git | <h1>How to commit one file at a time using Git?</h1>
<p>Say there are several files modified and I just want one files committed each time. How to do that? Given an example with status looks like below. Thanks!!</p>
<p>Ex:</p>
<pre><code>> git status
# modified: file01.txt
# modified: file02.txt
# modified: ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,917 | git | # How to commit one file at a time using Git?
Say there are several files modified and I just want one files committed each time. How to do that? Given an example with status looks like below. Thanks!!
Ex:
```
> git status
# modified: file01.txt
# modified: file02.txt
# modified: file03.txt
# modified: file0... | There are a few ways, but the simplest is probably:
```
git commit file01.txt
git commit file02.txt
...
```
Any paths you list after the commit command will be committed regardless of whether they're staged to be committed. Alternatively, you can stage each one, and then commit:
```
git add file01.txt
git commit
gi... |
50332885 | How do I install and use gpg-agent on Windows? | 26 | 2018-05-14 14:32:56 | <p>I'm trying to start signing Git commits. I setup a GPG key with keybase.io and have it synced on my local machine and on my Git server. Now, I'm trying to solve the problem of typing the key passphrase on <em>every single commit</em>.</p>
<pre><code>PS> git commit -m "testing" --allow-empty
You need a passphras... | 34,998 | 3,619 | 2021-03-27 05:00:15 | 50,412,924 | 23 | 2018-05-18 13:55:34 | 3,619 | 2018-05-18 15:33:29 | https://stackoverflow.com/q/50332885 | https://stackoverflow.com/a/50412924 | <p>I needed to inform <code>git</code> of the gpg program that I've installed, which itself knows about the gpg-agent that it should use.</p>
<pre><code>PS> git config --global gpg.program $(Resolve-Path (Get-Command gpg | Select-Object -Expand Source) | Select-Object -Expand Path)
</code></pre>
<p>After setting t... | <p>I needed to inform <code>git</code> of the gpg program that I've installed, which itself knows about the gpg-agent that it should use.</p> <pre><code>PS> git config --global gpg.program $(Resolve-Path (Get-Command gpg | Select-Object -Expand Source) | Select-Object -Expand Path) </code></pre> <p>After setting t... | 64, 119, 6735, 124001 | git, gnupg, gpg-agent, windows | <h1>How do I install and use gpg-agent on Windows?</h1>
<p>I'm trying to start signing Git commits. I setup a GPG key with keybase.io and have it synced on my local machine and on my Git server. Now, I'm trying to solve the problem of typing the key passphrase on <em>every single commit</em>.</p>
<pre><code>PS> git... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,918 | git | # How do I install and use gpg-agent on Windows?
I'm trying to start signing Git commits. I setup a GPG key with keybase.io and have it synced on my local machine and on my Git server. Now, I'm trying to solve the problem of typing the key passphrase on *every single commit*.
```
PS> git commit -m "testing" --allow-e... | I needed to inform `git` of the gpg program that I've installed, which itself knows about the gpg-agent that it should use.
```
PS> git config --global gpg.program $(Resolve-Path (Get-Command gpg | Select-Object -Expand Source) | Select-Object -Expand Path)
```
After setting this configuration, the "PIN Entry" dialog... |
21054148 | Why does git checkout with explicit refs/heads/branch give detached HEAD? | 26 | 2014-01-10 20:48:38 | <p>If I checkout a branch using just the branch name, <code>HEAD</code> is updated to point at that branch.</p>
<pre><code>$ git checkout branch
Switched to branch 'branch'
</code></pre>
<p>If I checkout a branch by using <code>refs/heads/branch</code> or <code>heads/branch</code>, <code>HEAD</code> becomes detached.... | 16,391 | 2,449,192 | 2020-06-30 20:46:06 | 21,055,585 | 23 | 2014-01-10 22:24:43 | 1,256,452 | 2020-06-30 20:46:06 | https://stackoverflow.com/q/21054148 | https://stackoverflow.com/a/21055585 | <p>The <code>checkout</code> command distinguishes between two cases (well, actually "many", but let's start with just the two :-) ):</p>
<ul>
<li>"I want to βget on a branchβ; here's a branch name": e.g., <code>git checkout branch</code>.</li>
<li>"I want to look at some particular revision, a... | <p>The <code>checkout</code> command distinguishes between two cases (well, actually "many", but let's start with just the two :-) ):</p> <ul> <li>"I want to βget on a branchβ; here's a branch name": e.g., <code>git checkout branch</code>.</li> <li>"I want to look at some particular revision, a... | 119, 37230 | git, git-checkout | <h1>Why does git checkout with explicit refs/heads/branch give detached HEAD?</h1>
<p>If I checkout a branch using just the branch name, <code>HEAD</code> is updated to point at that branch.</p>
<pre><code>$ git checkout branch
Switched to branch 'branch'
</code></pre>
<p>If I checkout a branch by using <code>refs/he... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,919 | git | # Why does git checkout with explicit refs/heads/branch give detached HEAD?
If I checkout a branch using just the branch name, `HEAD` is updated to point at that branch.
```
$ git checkout branch
Switched to branch 'branch'
```
If I checkout a branch by using `refs/heads/branch` or `heads/branch`, `HEAD` becomes det... | The `checkout` command distinguishes between two cases (well, actually "many", but let's start with just the two :-) ):
- "I want to βget on a branchβ; here's a branch name": e.g., `git checkout branch`.
- "I want to look at some particular revision, and get *off* any branch; here's a branch-identifier that is not a b... |
36876512 | How can I fix a Git error broken link from tree to tree? | 25 | 2016-04-26 21:56:30 | <p>I got a transaction interrupted and when I try again I was having error with objects that were empty or corrupted, following another question I delete all the empty files and when I run</p>
<pre><code>git fsck --full
</code></pre>
<p>I got this error:</p>
<pre><code>Checking object directories: 100% (256/256), done.... | 46,013 | 1,887,967 | 2024-03-29 14:23:54 | 38,598,015 | 23 | 2016-07-26 19:07:06 | 6,309 | 2024-03-12 19:34:44 | https://stackoverflow.com/q/36876512 | https://stackoverflow.com/a/38598015 | <p>To address the broken link from tree to tree error in Git, you need to identify the missing objects and attempt to recover them or remove references to them.</p>
<pre><code>Git Repository Structure
ββπ .git/
β ββπ objects/
β β ββπ broken link from tree 4bf48692... to tree df084ac4...
β β ββπ broken link from tre... | <p>To address the broken link from tree to tree error in Git, you need to identify the missing objects and attempt to recover them or remove references to them.</p> <pre><code>Git Repository Structure ββπ .git/ β ββπ objects/ β β ββπ broken link from tree 4bf48692... to tree df084ac4... β β ββπ broken link from tre... | 119 | git | <h1>How can I fix a Git error broken link from tree to tree?</h1>
<p>I got a transaction interrupted and when I try again I was having error with objects that were empty or corrupted, following another question I delete all the empty files and when I run</p>
<pre><code>git fsck --full
</code></pre>
<p>I got this error:... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,920 | git | # How can I fix a Git error broken link from tree to tree?
I got a transaction interrupted and when I try again I was having error with objects that were empty or corrupted, following another question I delete all the empty files and when I run
```
git fsck --full
```
I got this error:
```
Checking object directori... | To address the broken link from tree to tree error in Git, you need to identify the missing objects and attempt to recover them or remove references to them.
```
Git Repository Structure
ββπ .git/
β ββπ objects/
β β ββπ broken link from tree 4bf48692... to tree df084ac4...
β β ββπ broken link from tree 4bf48692...... |
19210770 | How can I tell git to ignore LibreOffice lock files? | 25 | 2013-10-06 15:55:05 | <p>I have a git repo which contains some XSLX files. I edit them with LibreOffice every once in a while. Sometimes LibreOffice won't remove the lock files ( <code>./folder/.~lock.filename.xslx#</code>). This causes those files to be liested as new on every <code>git status</code>. </p>
<p>I would like git to ignore th... | 10,249 | 103,190 | 2024-06-11 11:30:34 | 19,212,291 | 23 | 2013-10-06 18:24:32 | 1,290,731 | 2024-06-11 11:30:34 | https://stackoverflow.com/q/19210770 | https://stackoverflow.com/a/19212291 | <p>To test patterns for <code>.gitignore</code>,</p>
<pre><code><a href="https://www.kernel.org/pub/software/scm/git/docs/git-ls-files.html" rel="nofollow noreferrer">git ls-files</a> -iocx '.~lock*'</code></pre>
<p>To see if any cached aka staged aka tracked aka added files match ignore patterns (and so may have been ... | <p>To test patterns for <code>.gitignore</code>,</p> <pre><code><a href="https://www.kernel.org/pub/software/scm/git/docs/git-ls-files.html" rel="nofollow noreferrer">git ls-files</a> -iocx '.~lock*'</code></pre> <p>To see if any cached aka staged aka tracked aka added files match ignore patterns (and so may have been ... | 119, 25056, 67264 | git, gitignore, libreoffice | <h1>How can I tell git to ignore LibreOffice lock files?</h1>
<p>I have a git repo which contains some XSLX files. I edit them with LibreOffice every once in a while. Sometimes LibreOffice won't remove the lock files ( <code>./folder/.~lock.filename.xslx#</code>). This causes those files to be liested as new on every <... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,921 | git | # How can I tell git to ignore LibreOffice lock files?
I have a git repo which contains some XSLX files. I edit them with LibreOffice every once in a while. Sometimes LibreOffice won't remove the lock files ( `./folder/.~lock.filename.xslx#`). This causes those files to be liested as new on every `git status`.
I woul... | To test patterns for `.gitignore`,
```
git ls-files -iocx '.~lock*'
```
To see if any cached aka staged aka tracked aka added files match ignore patterns (and so may have been added in error),
```
git ls-files -ic --exclude-standard
```
As @NevikRehnel pointed out, git won't ignore tracked files. To un-track a file... |
4086896 | Including the current branch name in the commit template | 25 | 2010-11-03 12:11:25 | <p>I have a commit template set up for git, and I would like to include the name of the current branch in it. I usually set up the branch to be the bug id, and it would help me with filling in boilerplate such as:</p>
<pre><code>Bug : $BUG
</code></pre>
<p>How can I perform such a substitution with the git comment te... | 13,570 | 112,671 | 2011-10-27 09:34:57 | 4,091,005 | 23 | 2010-11-03 19:45:04 | 119,963 | 2010-11-29 19:07:00 | https://stackoverflow.com/q/4086896 | https://stackoverflow.com/a/4091005 | <p>I'd probably just use the <a href="http://git-scm.com/docs/githooks#_prepare_commit_msg" rel="noreferrer"><code>prepare-commit-msg</code></a> hook to add that to the file. From the (linked) manpage:</p>
<blockquote>
<p>This hook is invoked by git commit right after preparing the default log message, and before the e... | <p>I'd probably just use the <a href="http://git-scm.com/docs/githooks#_prepare_commit_msg" rel="noreferrer"><code>prepare-commit-msg</code></a> hook to add that to the file. From the (linked) manpage:</p> <blockquote> <p>This hook is invoked by git commit right after preparing the default log message, and before the e... | 119 | git | <h1>Including the current branch name in the commit template</h1>
<p>I have a commit template set up for git, and I would like to include the name of the current branch in it. I usually set up the branch to be the bug id, and it would help me with filling in boilerplate such as:</p>
<pre><code>Bug : $BUG
</code></pre>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,922 | git | # Including the current branch name in the commit template
I have a commit template set up for git, and I would like to include the name of the current branch in it. I usually set up the branch to be the bug id, and it would help me with filling in boilerplate such as:
```
Bug : $BUG
```
How can I perform such a sub... | I'd probably just use the [`prepare-commit-msg`](http://git-scm.com/docs/githooks#_prepare_commit_msg) hook to add that to the file. From the (linked) manpage:
> This hook is invoked by git commit right after preparing the default log message, and before the editor is started.
>
> It takes one to three parameters. The... |
38454532 | Remove duplicate commits introduced after bad rebase(s) | 24 | 2016-07-19 09:28:33 | <p>I have 2 branches, <code>master</code> & <code>feature</code>. Master occasionally receives small tweaks that are needed to go live quickly. Once these tweaks are done, <code>master</code> is rebased into <code>feature</code> so that feature is kept up to date.</p>
<p>The files changed on master are generally n... | 27,939 | 2,072,075 | 2021-11-19 00:49:25 | 38,457,832 | 23 | 2016-07-19 11:54:46 | 2,072,075 | 2016-07-29 09:02:37 | https://stackoverflow.com/q/38454532 | https://stackoverflow.com/a/38457832 | <p>To remove the duplicate commits you must go through the list generated by <code>git rebase master -i</code> and drop the duplicates by navigating up and down the list using the arrow keys pressing <kbd>d</kbd> on the commits you want to <code>drop</code>.</p>
<p><em>(<code>master</code> can be replaced with a commm... | <p>To remove the duplicate commits you must go through the list generated by <code>git rebase master -i</code> and drop the duplicates by navigating up and down the list using the arrow keys pressing <kbd>d</kbd> on the commits you want to <code>drop</code>.</p> <p><em>(<code>master</code> can be replaced with a commm... | 119, 456, 8974 | git, rebase, version-control | <h1>Remove duplicate commits introduced after bad rebase(s)</h1>
<p>I have 2 branches, <code>master</code> & <code>feature</code>. Master occasionally receives small tweaks that are needed to go live quickly. Once these tweaks are done, <code>master</code> is rebased into <code>feature</code> so that feature is kep... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,924 | git | # Remove duplicate commits introduced after bad rebase(s)
I have 2 branches, `master` & `feature`. Master occasionally receives small tweaks that are needed to go live quickly. Once these tweaks are done, `master` is rebased into `feature` so that feature is kept up to date.
The files changed on master are generally ... | To remove the duplicate commits you must go through the list generated by `git rebase master -i` and drop the duplicates by navigating up and down the list using the arrow keys pressing `d` on the commits you want to `drop`.
*(`master` can be replaced with a commmit hash or any valid re-base point)*
Once you have del... |
11458926 | git checkout -- <files> doesn't discard changes? | 24 | 2012-07-12 19:10:32 | <p>I have changes in my working directory that I'm trying to discard (reset to the current indexed version of the files), however, <code>git checkout -- <file></code> will not discard the changes.
I've attempted to manually remove the files (<code>rm -r files</code>) then run <code>git checkout -- .</code>, which... | 24,921 | 463,038 | 2018-05-17 14:26:14 | 11,461,069 | 23 | 2012-07-12 21:36:31 | 463,038 | 2012-07-12 21:36:31 | https://stackoverflow.com/q/11458926 | https://stackoverflow.com/a/11461069 | <p>The cause for this was due to multiple files with the same name but different cases. In OSX, which is case-insensitive, doesn't like multiple files with the same name but different cases. It views them as the same file.
To fix this, I ran <code>git mv</code> (or just <code>mv</code>) to a temporary filename, added t... | <p>The cause for this was due to multiple files with the same name but different cases. In OSX, which is case-insensitive, doesn't like multiple files with the same name but different cases. It views them as the same file. To fix this, I ran <code>git mv</code> (or just <code>mv</code>) to a temporary filename, added t... | 119, 369, 37230 | git, git-checkout, macos | <h1>git checkout -- <files> doesn't discard changes?</h1>
<p>I have changes in my working directory that I'm trying to discard (reset to the current indexed version of the files), however, <code>git checkout -- <file></code> will not discard the changes.
I've attempted to manually remove the files (<code>rm -r fi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,926 | git | # git checkout -- doesn't discard changes?
I have changes in my working directory that I'm trying to discard (reset to the current indexed version of the files), however, `git checkout -- <file>` will not discard the changes.
I've attempted to manually remove the files (`rm -r files`) then run `git checkout -- .`, whi... | The cause for this was due to multiple files with the same name but different cases. In OSX, which is case-insensitive, doesn't like multiple files with the same name but different cases. It views them as the same file.
To fix this, I ran `git mv` (or just `mv`) to a temporary filename, added the temp files, which allo... |
7077016 | How Can I Resolve:"can not open 'git-upload-pack' " error in eclipse? | 24 | 2011-08-16 10:50:46 | <p>I am building an android app with the facebook api and I need to import the facebook android sdk. When I want to import this file from github it throws the .."can not list the available branches..'can not open git-upload-pack'"...the detailed error was now:</p>
<pre><code>https://github.com/facebook/facebook-androi... | 156,150 | 820,572 | 2021-08-20 05:33:00 | 7,077,226 | 23 | 2011-08-16 11:07:40 | 112,968 | 2011-08-16 11:07:40 | https://stackoverflow.com/q/7077016 | https://stackoverflow.com/a/7077226 | <p>You are using the wrong URL (you are using the URL for the html webpage). Try either of these instead:</p>
<ul>
<li><code>https://github.com/facebook/facebook-android-sdk.git</code></li>
<li><code>git://github.com/facebook/facebook-android-sdk.git</code></li>
</ul>
| <p>You are using the wrong URL (you are using the URL for the html webpage). Try either of these instead:</p> <ul> <li><code>https://github.com/facebook/facebook-android-sdk.git</code></li> <li><code>git://github.com/facebook/facebook-android-sdk.git</code></li> </ul> | 119 | git | <h1>How Can I Resolve:"can not open 'git-upload-pack' " error in eclipse?</h1>
<p>I am building an android app with the facebook api and I need to import the facebook android sdk. When I want to import this file from github it throws the .."can not list the available branches..'can not open git-upload-pack'"...the deta... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 19,927 | git | # How Can I Resolve:"can not open 'git-upload-pack' " error in eclipse?
I am building an android app with the facebook api and I need to import the facebook android sdk. When I want to import this file from github it throws the .."can not list the available branches..'can not open git-upload-pack'"...the detailed erro... | You are using the wrong URL (you are using the URL for the html webpage). Try either of these instead:
- `https://github.com/facebook/facebook-android-sdk.git`
- `git://github.com/facebook/facebook-android-sdk.git` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.