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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
930612 | git remove oldest revisions of a file | 20 | 2009-05-30 21:03:05 | <p>I have a 33 MB large file where I want to permanently delete the oldest revisions of that file, so I only the latest X revisions are kept around. How to do it?</p>
<p>My bare repository has grow huge because of it. </p>
<p>I have tried the following.. but it removes the file entirely</p>
<pre><code>git filter-bra... | 6,875 | 78,336 | 2011-02-16 15:39:15 | 931,054 | 16 | 2009-05-31 01:47:27 | 95,706 | 2011-02-16 15:39:15 | https://stackoverflow.com/q/930612 | https://stackoverflow.com/a/931054 | <p>I think you are on the right track with the <code>git filter-branch</code> command you tried. The problem is you haven't told it to keep the file in any commits, so it is removed from all of them. Now, I don't think there is a way to <em>directly</em> tell <code>git-filter-branch</code> to skip any commits. However,... | <p>I think you are on the right track with the <code>git filter-branch</code> command you tried. The problem is you haven't told it to keep the file in any commits, so it is removed from all of them. Now, I don't think there is a way to <em>directly</em> tell <code>git-filter-branch</code> to skip any commits. However,... | 119 | git | <h1>git remove oldest revisions of a file</h1>
<p>I have a 33 MB large file where I want to permanently delete the oldest revisions of that file, so I only the latest X revisions are kept around. How to do it?</p>
<p>My bare repository has grow huge because of it. </p>
<p>I have tried the following.. but it removes t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,508 | git | # git remove oldest revisions of a file
I have a 33 MB large file where I want to permanently delete the oldest revisions of that file, so I only the latest X revisions are kept around. How to do it?
My bare repository has grow huge because of it.
I have tried the following.. but it removes the file entirely
```
gi... | I think you are on the right track with the `git filter-branch` command you tried. The problem is you haven't told it to keep the file in any commits, so it is removed from all of them. Now, I don't think there is a way to *directly* tell `git-filter-branch` to skip any commits. However, since the commands are run in a... |
43138569 | how to get git log -p to show changes in merge commits | 19 | 2017-03-31 10:35:16 | <p>I have a branch with a function definition missing but the function is still being used causing a crash. The function definition must have been deleted during a merge. I have done 'git log -p' and searched for the function definition and I can see it being defined but couldn't find it being deleted later on. This le... | 10,646 | 1,030,287 | 2022-09-14 20:28:57 | 43,149,838 | 16 | 2017-03-31 21:20:47 | 1,256,452 | 2017-03-31 21:20:47 | https://stackoverflow.com/q/43138569 | https://stackoverflow.com/a/43149838 | <blockquote>
<p>This leads me to believe that 'git log -p' doesn't show merge changes? How can I get this functionality?</p>
</blockquote>
<p>You are correct: by default, <code>git log -p</code> shows you the merge commit, but does not even <em>attempt</em> to show a diff for it.</p>
<p>As <a href="https://stackove... | <blockquote> <p>This leads me to believe that 'git log -p' doesn't show merge changes? How can I get this functionality?</p> </blockquote> <p>You are correct: by default, <code>git log -p</code> shows you the merge commit, but does not even <em>attempt</em> to show a diff for it.</p> <p>As <a href="https://stackove... | 119 | git | <h1>how to get git log -p to show changes in merge commits</h1>
<p>I have a branch with a function definition missing but the function is still being used causing a crash. The function definition must have been deleted during a merge. I have done 'git log -p' and searched for the function definition and I can see it be... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,510 | git | # how to get git log -p to show changes in merge commits
I have a branch with a function definition missing but the function is still being used causing a crash. The function definition must have been deleted during a merge. I have done 'git log -p' and searched for the function definition and I can see it being defin... | > This leads me to believe that 'git log -p' doesn't show merge changes? How can I get this functionality?
You are correct: by default, `git log -p` shows you the merge commit, but does not even *attempt* to show a diff for it.
As [odradek wrote in a comment](https://stackoverflow.com/questions/43138569/how-to-get-gi... |
19548659 | Migrate from tfs to git on visualstudio.com | 19 | 2013-10-23 17:39:34 | <p>I have a remote repository on visualstudio.com (a free account) but its on tfs, and I want to move it to git for visualstudio.com</p>
<p>Has anyone tried this yet?</p>
<p>I found this tutorial: </p>
<blockquote>
<p><a href="http://gitstack.com/how-to-migrate-from-tfs-to-git/">http://gitstack.com/how-to-migrate-... | 14,098 | 1,158,845 | 2017-04-05 06:40:52 | 19,563,367 | 16 | 2013-10-24 10:27:33 | 1,158,845 | 2013-10-24 10:27:33 | https://stackoverflow.com/q/19548659 | https://stackoverflow.com/a/19563367 | <p>Got it working, correct command is to use <code>https</code> without project name after DefaultCollection here for example:</p>
<pre><code>git-tfs clone --username=mumair85 --password=xxxx https://mumair85.visualstudio.com/DefaultCollection $/uGen
</code></pre>
| <p>Got it working, correct command is to use <code>https</code> without project name after DefaultCollection here for example:</p> <pre><code>git-tfs clone --username=mumair85 --password=xxxx https://mumair85.visualstudio.com/DefaultCollection $/uGen </code></pre> | 119, 733, 116537 | azure-devops, git, tfs | <h1>Migrate from tfs to git on visualstudio.com</h1>
<p>I have a remote repository on visualstudio.com (a free account) but its on tfs, and I want to move it to git for visualstudio.com</p>
<p>Has anyone tried this yet?</p>
<p>I found this tutorial: </p>
<blockquote>
<p><a href="http://gitstack.com/how-to-migrate-... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,511 | git | # Migrate from tfs to git on visualstudio.com
I have a remote repository on visualstudio.com (a free account) but its on tfs, and I want to move it to git for visualstudio.com
Has anyone tried this yet?
I found this tutorial:
> <http://gitstack.com/how-to-migrate-from-tfs-to-git/>
But in that there is a command `g... | Got it working, correct command is to use `https` without project name after DefaultCollection here for example:
```
git-tfs clone --username=mumair85 --password=xxxx https://mumair85.visualstudio.com/DefaultCollection $/uGen
``` |
9972540 | Do I have to commit a merge to make git-rerere record my conflict resolution? | 19 | 2012-04-02 07:41:00 | <p>I'm using <code>git-rerere</code> for its intended purpose, to record conflict resolutions between two branches (master and a topic branch) incrementally as those branches develop, without creating unnecessary merge commits. However, even after reading the git-rerere manpage I'm a little unclear on when rerere actua... | 1,521 | 125,921 | 2018-09-22 21:02:14 | 10,018,939 | 16 | 2012-04-04 20:42:59 | 223,267 | 2012-04-04 20:42:59 | https://stackoverflow.com/q/9972540 | https://stackoverflow.com/a/10018939 | <p>From the manpage:</p>
<pre><code>Running the git rerere command immediately after a conflicted automerge
records the conflicted working tree files, with the usual conflict
markers <<<<<<<, =======, and >>>>>>> in them. Later, after you are
done resolving the conflicts, runn... | <p>From the manpage:</p> <pre><code>Running the git rerere command immediately after a conflicted automerge records the conflicted working tree files, with the usual conflict markers <<<<<<<, =======, and >>>>>>> in them. Later, after you are done resolving the conflicts, runn... | 119, 62599, 83367 | git, git-rerere, merge-conflict-resolution | <h1>Do I have to commit a merge to make git-rerere record my conflict resolution?</h1>
<p>I'm using <code>git-rerere</code> for its intended purpose, to record conflict resolutions between two branches (master and a topic branch) incrementally as those branches develop, without creating unnecessary merge commits. Howev... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,512 | git | # Do I have to commit a merge to make git-rerere record my conflict resolution?
I'm using `git-rerere` for its intended purpose, to record conflict resolutions between two branches (master and a topic branch) incrementally as those branches develop, without creating unnecessary merge commits. However, even after readi... | From the manpage:
```
Running the git rerere command immediately after a conflicted automerge
records the conflicted working tree files, with the usual conflict
markers <<<<<<<, =======, and >>>>>>> in them. Later, after you are
done resolving the conflicts, running git rerere again will record the
resolved state of t... |
7984986 | git merging branches in a bare repository | 19 | 2011-11-02 17:51:50 | <p>I would like to create the following setup for my git repos:</p>
<p>I currently have a local git repo with all my working files. I would like to be able to setup a central bare repository, and two other non-bare repositories -- one for a live application and one for a testing version.</p>
<p>I would like to be ab... | 11,945 | 480,029 | 2023-03-27 09:11:39 | 7,985,045 | 16 | 2011-11-02 17:56:52 | 216,074 | 2011-11-02 17:56:52 | https://stackoverflow.com/q/7984986 | https://stackoverflow.com/a/7985045 | <p><code>git checkout</code> checks out a branch into the working tree – how do you think this should have worked without a working tree? And <code>git merge</code> and most other commands don’t work, because there is no HEAD inside of a bare repository.</p>
<p>To answer your question: You don’t work within the bare r... | <p><code>git checkout</code> checks out a branch into the working tree – how do you think this should have worked without a working tree? And <code>git merge</code> and most other commands don’t work, because there is no HEAD inside of a bare repository.</p> <p>To answer your question: You don’t work within the bare r... | 119, 717, 64465 | git, git-bare, merge | <h1>git merging branches in a bare repository</h1>
<p>I would like to create the following setup for my git repos:</p>
<p>I currently have a local git repo with all my working files. I would like to be able to setup a central bare repository, and two other non-bare repositories -- one for a live application and one f... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,513 | git | # git merging branches in a bare repository
I would like to create the following setup for my git repos:
I currently have a local git repo with all my working files. I would like to be able to setup a central bare repository, and two other non-bare repositories -- one for a live application and one for a testing vers... | `git checkout` checks out a branch into the working tree – how do you think this should have worked without a working tree? And `git merge` and most other commands don’t work, because there is no HEAD inside of a bare repository.
To answer your question: You don’t work within the bare repository. A bare repository is ... |
1974373 | How to view complete commits when tracking history of a single file in Git? | 19 | 2009-12-29 12:21:06 | <p>I have a Git repository with about a two years of history in it. I have single file in it, for which I wish to find all the commits, and for each commit: all the other files that were committed in it. Let's assume this file is named file.txt. I can run gitk with this file as argument:</p>
<pre><code>gitk file.txt
<... | 11,902 | 14,690 | 2015-04-17 01:42:33 | 1,974,385 | 16 | 2009-12-29 12:25:36 | 119,005 | 2015-04-17 01:42:33 | https://stackoverflow.com/q/1974373 | https://stackoverflow.com/a/1974385 | <p>In the command line,</p>
<pre><code>git log -p --full-diff file.txt
</code></pre>
<p>will output what you want.</p>
<p>If you must see it in gitk, invoke it with <em>no</em> arguments, find commit "touching path" file.txt, and the commit contains that file will be bold. And you can use the "up" and "down" buttons... | <p>In the command line,</p> <pre><code>git log -p --full-diff file.txt </code></pre> <p>will output what you want.</p> <p>If you must see it in gitk, invoke it with <em>no</em> arguments, find commit "touching path" file.txt, and the commit contains that file will be bold. And you can use the "up" and "down" buttons... | 119, 30785 | git, gitk | <h1>How to view complete commits when tracking history of a single file in Git?</h1>
<p>I have a Git repository with about a two years of history in it. I have single file in it, for which I wish to find all the commits, and for each commit: all the other files that were committed in it. Let's assume this file is named... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,514 | git | # How to view complete commits when tracking history of a single file in Git?
I have a Git repository with about a two years of history in it. I have single file in it, for which I wish to find all the commits, and for each commit: all the other files that were committed in it. Let's assume this file is named file.txt... | In the command line,
```
git log -p --full-diff file.txt
```
will output what you want.
If you must see it in gitk, invoke it with *no* arguments, find commit "touching path" file.txt, and the commit contains that file will be bold. And you can use the "up" and "down" buttons to traverse through it. |
19713622 | What is $(prefix) on $(prefix)/etc/gitconfig? | 18 | 2013-10-31 18:02:49 | <p><a href="https://www.kernel.org/pub/software/scm/git/docs/git-config.html#FILES" rel="noreferrer">gitconfig(1)</a>:</p>
<blockquote>
<p>If not set explicitly with --file, there are four files where git config will search for configuration options:</p>
<p>...</p>
<p><strong>$(prefix)</strong>/etc/gitconf... | 5,578 | 1,316,620 | 2020-08-14 07:48:50 | 19,713,647 | 16 | 2013-10-31 18:04:23 | 127,059 | 2020-08-14 07:48:50 | https://stackoverflow.com/q/19713622 | https://stackoverflow.com/a/19713647 | <p>The <code>prefix</code> environment variable git was compiled with. Usually, it's <code>/usr/local</code>, so the path is <code>/usr/local/etc/gitconfig</code>.</p>
<p>More information can be found in the <code>INSTALL</code> file in the git repository.</p>
| <p>The <code>prefix</code> environment variable git was compiled with. Usually, it's <code>/usr/local</code>, so the path is <code>/usr/local/etc/gitconfig</code>.</p> <p>More information can be found in the <code>INSTALL</code> file in the git repository.</p> | 119, 725, 12669, 32868 | configuration, git, git-config, prefix | <h1>What is $(prefix) on $(prefix)/etc/gitconfig?</h1>
<p><a href="https://www.kernel.org/pub/software/scm/git/docs/git-config.html#FILES" rel="noreferrer">gitconfig(1)</a>:</p>
<blockquote>
<p>If not set explicitly with --file, there are four files where git config will search for configuration options:</p>
<p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,517 | git | # What is $(prefix) on $(prefix)/etc/gitconfig?
[gitconfig(1)](https://www.kernel.org/pub/software/scm/git/docs/git-config.html#FILES):
> If not set explicitly with --file, there are four files where git config will search for configuration options:
>
> ...
>
> **$(prefix)**/etc/gitconfig
>
> System-wide configur... | The `prefix` environment variable git was compiled with. Usually, it's `/usr/local`, so the path is `/usr/local/etc/gitconfig`.
More information can be found in the `INSTALL` file in the git repository. |
18917137 | How does CocoaPods work | 18 | 2013-09-20 12:44:54 | <p>I used CocoaPods for some of my projects. It's cool and easy to keep updated with my dependencies/open source frameworks.</p>
<p>But I have some doubts regarding the inner workings of CocoaPods.</p>
<p>In our Podfile we are giving only the the name of pods, sometimes the version also,like</p>
<pre><code>pod "AFNe... | 8,133 | 899,573 | 2024-04-14 08:53:54 | 18,919,959 | 16 | 2013-09-20 15:01:10 | 902,968 | 2013-09-20 15:01:10 | https://stackoverflow.com/q/18917137 | https://stackoverflow.com/a/18919959 | <p>CocoaPods does a whole lot behind the scenes to make everything you're talking about work. On a relatively high level the actual 'Pods' are managed in a repo that lives on Github <a href="https://github.com/cocoapods/specs">here</a>. This is where 3rd party library vendors submit their 'Pods' to work with CocoaPods.... | <p>CocoaPods does a whole lot behind the scenes to make everything you're talking about work. On a relatively high level the actual 'Pods' are managed in a repo that lives on Github <a href="https://github.com/cocoapods/specs">here</a>. This is where 3rd party library vendors submit their 'Pods' to work with CocoaPods.... | 119, 277, 24170, 77741 | cocoapods, debugging, dependency-management, git | <h1>How does CocoaPods work</h1>
<p>I used CocoaPods for some of my projects. It's cool and easy to keep updated with my dependencies/open source frameworks.</p>
<p>But I have some doubts regarding the inner workings of CocoaPods.</p>
<p>In our Podfile we are giving only the the name of pods, sometimes the version al... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,518 | git | # How does CocoaPods work
I used CocoaPods for some of my projects. It's cool and easy to keep updated with my dependencies/open source frameworks.
But I have some doubts regarding the inner workings of CocoaPods.
In our Podfile we are giving only the the name of pods, sometimes the version also,like
```
pod "AFNet... | CocoaPods does a whole lot behind the scenes to make everything you're talking about work. On a relatively high level the actual 'Pods' are managed in a repo that lives on Github [here](https://github.com/cocoapods/specs). This is where 3rd party library vendors submit their 'Pods' to work with CocoaPods. You'll notice... |
18873297 | Self-host remote git repository on Windows server | 18 | 2013-09-18 13:15:39 | <p>We have a computer on our local network designated as 'the server', that runs Windows XP, where we keep the shared folders and stuff that should be visible to all.</p>
<p>How do I create a remote Git repository on it, and setup it so different people on different computers on the local network can pull/push?</p>
<... | 25,167 | 492,336 | 2014-11-27 08:12:17 | 18,890,410 | 16 | 2013-09-19 09:03:05 | 492,336 | 2014-11-27 08:12:17 | https://stackoverflow.com/q/18873297 | https://stackoverflow.com/a/18890410 | <p><strong>Edit:</strong> I recently found about <a href="http://bonobogitserver.com/">Bonobo Git Server</a> - it is a free and open-source Git Server for Windows and IIS, licensed with an MIT license. I haven't tested it myself yet, but you can give it a try.</p>
<p>There is also this CodeProject article - <a href="h... | <p><strong>Edit:</strong> I recently found about <a href="http://bonobogitserver.com/">Bonobo Git Server</a> - it is a free and open-source Git Server for Windows and IIS, licensed with an MIT license. I haven't tested it myself yet, but you can give it a try.</p> <p>There is also this CodeProject article - <a href="h... | 64, 119 | git, windows | <h1>Self-host remote git repository on Windows server</h1>
<p>We have a computer on our local network designated as 'the server', that runs Windows XP, where we keep the shared folders and stuff that should be visible to all.</p>
<p>How do I create a remote Git repository on it, and setup it so different people on dif... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,519 | git | # Self-host remote git repository on Windows server
We have a computer on our local network designated as 'the server', that runs Windows XP, where we keep the shared folders and stuff that should be visible to all.
How do I create a remote Git repository on it, and setup it so different people on different computers... | **Edit:** I recently found about [Bonobo Git Server](http://bonobogitserver.com/) - it is a free and open-source Git Server for Windows and IIS, licensed with an MIT license. I haven't tested it myself yet, but you can give it a try.
There is also this CodeProject article - [Step by Step Setup Git Server on Windows wi... |
8407126 | Getting current Git commit version from within Rails app? | 18 | 2011-12-06 21:30:19 | <p>How can I retrieve the current Git commit version from within a Ruby on Rails app? </p>
<p>Want to display the Git version (or maybe the last 6 letters or so) to serve as an App version.</p>
| 12,863 | 796,004 | 2019-04-22 11:13:53 | 8,407,170 | 16 | 2011-12-06 21:34:50 | 229,044 | 2011-12-06 21:34:50 | https://stackoverflow.com/q/8407126 | https://stackoverflow.com/a/8407170 | <p>You can invoke the <code>git</code> command from within your script:</p>
<pre><code>commit = `git show --pretty=%H`
puts commit
</code></pre>
<p>Depending on your environment you may want to use the full path to the git binary, and possibly specify the GIT_DIR via an environment variable or <code>--git-dir</code>.... | <p>You can invoke the <code>git</code> command from within your script:</p> <pre><code>commit = `git show --pretty=%H` puts commit </code></pre> <p>Depending on your environment you may want to use the full path to the git binary, and possibly specify the GIT_DIR via an environment variable or <code>--git-dir</code>.... | 119, 64108, 68616 | git, ruby-on-rails-3, ruby-on-rails-3.1 | <h1>Getting current Git commit version from within Rails app?</h1>
<p>How can I retrieve the current Git commit version from within a Ruby on Rails app? </p>
<p>Want to display the Git version (or maybe the last 6 letters or so) to serve as an App version.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,521 | git | # Getting current Git commit version from within Rails app?
How can I retrieve the current Git commit version from within a Ruby on Rails app?
Want to display the Git version (or maybe the last 6 letters or so) to serve as an App version. | You can invoke the `git` command from within your script:
```
commit = `git show --pretty=%H`
puts commit
```
Depending on your environment you may want to use the full path to the git binary, and possibly specify the GIT_DIR via an environment variable or `--git-dir`. |
2293212 | Capistrano + Git : repository local to production server | 18 | 2010-02-19 00:08:04 | <p>I am trying to do 'deploy:cold' for my app. The git repo is local to
my deployment server (i.e. I only have one server for everything and I
don't host my code on github).</p>
<p>Here is the transcript (replaced my app name with "myapp" for privacy)</p>
<pre><code> * executing `deploy:cold'
* executing `deploy:u... | 20,055 | 134,484 | 2013-07-18 15:51:24 | 2,350,064 | 16 | 2010-02-28 04:15:42 | 282,954 | 2011-11-26 20:57:36 | https://stackoverflow.com/q/2293212 | https://stackoverflow.com/a/2350064 | <p>Just ran into the same problem. The key is to not use deploy_via copy but rather set :local_repository </p>
<p>This should be set to the URL you use to access the repository from your development computer/laptop.</p>
<p>So mine has</p>
<pre><code>set :repository, "file:///srv/git/myapp.git"
set :local_repository,... | <p>Just ran into the same problem. The key is to not use deploy_via copy but rather set :local_repository </p> <p>This should be set to the URL you use to access the repository from your development computer/laptop.</p> <p>So mine has</p> <pre><code>set :repository, "file:///srv/git/myapp.git" set :local_repository,... | 119, 190, 2831, 4984 | capistrano, deployment, git, ruby-on-rails | <h1>Capistrano + Git : repository local to production server</h1>
<p>I am trying to do 'deploy:cold' for my app. The git repo is local to
my deployment server (i.e. I only have one server for everything and I
don't host my code on github).</p>
<p>Here is the transcript (replaced my app name with "myapp" for privacy)</... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,522 | git | # Capistrano + Git : repository local to production server
I am trying to do 'deploy:cold' for my app. The git repo is local to
my deployment server (i.e. I only have one server for everything and I
don't host my code on github).
Here is the transcript (replaced my app name with "myapp" for privacy)
```
* executin... | Just ran into the same problem. The key is to not use deploy_via copy but rather set :local_repository
This should be set to the URL you use to access the repository from your development computer/laptop.
So mine has
```
set :repository, "file:///srv/git/myapp.git"
set :local_repository, "nameOfHostFromSSHConfig:/sr... |
1422496 | Copying git local branch between machines? | 18 | 2009-09-14 16:04:45 | <p>OK so I'm tracking a remote repo on two machines so both have the master branch. I also made a local branch on my laptop called development. Is there a way for me to copy that local branch over to my desktop computer? I'd use my laptop but for some reason I'm having trouble with gdb and emacs...</p>
<p>Edit: Thi... | 15,118 | 157,525 | 2022-02-22 09:50:34 | 1,423,443 | 16 | 2009-09-14 19:28:36 | 46,058 | 2009-09-14 19:28:36 | https://stackoverflow.com/q/1422496 | https://stackoverflow.com/a/1423443 | <p>Let's assume that you have both repository on 'desktop' machine and repository on 'laptop' machine set up in such way that you can fetch on 'desktop' from 'laptop' and vice versa (e.g. via SSH, or via <code>git://</code> protocol i.e. via git-daemon, or perhaps via simple HTTP).</p>
<p>Both 'desktop' and 'laptop' m... | <p>Let's assume that you have both repository on 'desktop' machine and repository on 'laptop' machine set up in such way that you can fetch on 'desktop' from 'laptop' and vice versa (e.g. via SSH, or via <code>git://</code> protocol i.e. via git-daemon, or perhaps via simple HTTP).</p> <p>Both 'desktop' and 'laptop' m... | 119 | git | <h1>Copying git local branch between machines?</h1>
<p>OK so I'm tracking a remote repo on two machines so both have the master branch. I also made a local branch on my laptop called development. Is there a way for me to copy that local branch over to my desktop computer? I'd use my laptop but for some reason I'm ha... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,523 | git | # Copying git local branch between machines?
OK so I'm tracking a remote repo on two machines so both have the master branch. I also made a local branch on my laptop called development. Is there a way for me to copy that local branch over to my desktop computer? I'd use my laptop but for some reason I'm having trouble... | Let's assume that you have both repository on 'desktop' machine and repository on 'laptop' machine set up in such way that you can fetch on 'desktop' from 'laptop' and vice versa (e.g. via SSH, or via `git://` protocol i.e. via git-daemon, or perhaps via simple HTTP).
Both 'desktop' and 'laptop' machine have 'master' ... |
59365751 | Magit: Is there a way I can toggle --ignore-all-space option for the default magit-status buffer? | 17 | 2019-12-16 23:43:38 | <p>In the magit-status buffer I can press <code>d-wd</code> on a file to open a magit-diff buffer with the diff of that specific file without whitespace changes. When I go back to magit-status though, the diffs there still show the original whitespace changes. I'm not sure if this is built into magit already but what I... | 2,914 | 2,807,904 | 2021-08-20 10:08:04 | 59,366,095 | 16 | 2019-12-17 00:36:47 | 326,516 | 2019-12-17 17:22:06 | https://stackoverflow.com/q/59365751 | https://stackoverflow.com/a/59366095 | <p>In <code>magit-status</code>, enter the <em>diff mode</em> by pressing <code>d</code> like you've done. Make your <code>-w</code> change. Then press <code>C-x</code> to see that there is an extended magit menu with more available items. You'll then see that <strong><code>C-s</code> is a means to Save the settings... | <p>In <code>magit-status</code>, enter the <em>diff mode</em> by pressing <code>d</code> like you've done. Make your <code>-w</code> change. Then press <code>C-x</code> to see that there is an extended magit menu with more available items. You'll then see that <strong><code>C-s</code> is a means to Save the settings... | 371, 41829 | emacs, magit | <h1>Magit: Is there a way I can toggle --ignore-all-space option for the default magit-status buffer?</h1>
<p>In the magit-status buffer I can press <code>d-wd</code> on a file to open a magit-diff buffer with the diff of that specific file without whitespace changes. When I go back to magit-status though, the diffs th... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,524 | git | # Magit: Is there a way I can toggle --ignore-all-space option for the default magit-status buffer?
In the magit-status buffer I can press `d-wd` on a file to open a magit-diff buffer with the diff of that specific file without whitespace changes. When I go back to magit-status though, the diffs there still show the o... | In `magit-status`, enter the *diff mode* by pressing `d` like you've done. Make your `-w` change. Then press `C-x` to see that there is an extended magit menu with more available items. You'll then see that **`C-s` is a means to Save the settings** you've made (e.g., `--ignore-all-space`) for future sessions. |
55368503 | No author information was supplied by the version control system | 17 | 2019-03-27 01:31:43 | <p>I just updated my Xcode to <strong>version 10.2</strong> (10E125).</p>
<p>A moment I want to commit, I get this message:</p>
<p><a href="https://i.sstatic.net/xWh0D.png" rel="noreferrer"><img src="https://i.sstatic.net/xWh0D.png" alt="enter image description here"></a></p>
<p>After I click on fix:</p>
<p><a href... | 22,197 | 5,561,496 | 2023-04-09 17:00:08 | 55,370,815 | 16 | 2019-03-27 06:09:47 | 8,591,160 | 2019-03-27 06:09:47 | https://stackoverflow.com/q/55368503 | https://stackoverflow.com/a/55370815 | <p>You can set the author information using Terminal. It might be possible that xCode has the author data but it's not actually set in Git config.</p>
<h3>Setting your Git username for every repository on your computer</h3>
<p>1) Open Terminal.</p>
<p>2) Set a Git username:</p>
<pre><code>$ git config --global user... | <p>You can set the author information using Terminal. It might be possible that xCode has the author data but it's not actually set in Git config.</p> <h3>Setting your Git username for every repository on your computer</h3> <p>1) Open Terminal.</p> <p>2) Set a Git username:</p> <pre><code>$ git config --global user... | 119, 908, 133169 | git, xcode, xcode10 | <h1>No author information was supplied by the version control system</h1>
<p>I just updated my Xcode to <strong>version 10.2</strong> (10E125).</p>
<p>A moment I want to commit, I get this message:</p>
<p><a href="https://i.sstatic.net/xWh0D.png" rel="noreferrer"><img src="https://i.sstatic.net/xWh0D.png" alt="enter ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,525 | git | # No author information was supplied by the version control system
I just updated my Xcode to **version 10.2** (10E125).
A moment I want to commit, I get this message:
[](https://i.sstatic.net/xWh0D.png)
After I click on fix:
[).
### Git as simp... |
30392969 | fetch and checkout a remote git branch in just one command | 17 | 2015-05-22 09:22:04 | <p>If</p>
<ul>
<li>I have local repo with a remote <code>$REMOTE</code> already set up</li>
<li>and a new branch <code>$BRANCH</code> exists on the remote repo that I haven't fetched, yet</li>
</ul>
<p>can I fetch that branch <strong>and</strong> check it out into a tracking local branch of the same name <strong>in a s... | 7,837 | 674,064 | 2021-05-17 17:57:12 | 33,493,042 | 16 | 2015-11-03 06:52:47 | 112,968 | 2015-11-06 16:45:17 | https://stackoverflow.com/q/30392969 | https://stackoverflow.com/a/33493042 | <p>There is no builtin command, but you could define an alias in your <code>~/.gitconfig</code>:</p>
<pre><code>[alias]
fetch-checkout = !sh -c 'git fetch $1 $2 && git checkout $2' -
</code></pre>
| <p>There is no builtin command, but you could define an alias in your <code>~/.gitconfig</code>:</p> <pre><code>[alias] fetch-checkout = !sh -c 'git fetch $1 $2 && git checkout $2' - </code></pre> | 119, 33720, 37230, 76220 | git, git-branch, git-checkout, git-fetch | <h1>fetch and checkout a remote git branch in just one command</h1>
<p>If</p>
<ul>
<li>I have local repo with a remote <code>$REMOTE</code> already set up</li>
<li>and a new branch <code>$BRANCH</code> exists on the remote repo that I haven't fetched, yet</li>
</ul>
<p>can I fetch that branch <strong>and</strong> check... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,530 | git | # fetch and checkout a remote git branch in just one command
If
- I have local repo with a remote `$REMOTE` already set up
- and a new branch `$BRANCH` exists on the remote repo that I haven't fetched, yet
can I fetch that branch **and** check it out into a tracking local branch of the same name **in a single comman... | There is no builtin command, but you could define an alias in your `~/.gitconfig`:
```
[alias]
fetch-checkout = !sh -c 'git fetch $1 $2 && git checkout $2' -
``` |
31660263 | Bitbucket ssh public key is being denied but their ssh test connects with no issue | 17 | 2015-07-27 18:10:20 | <p>A quite probably relevant piece of information is that I have a custom ssh config set up for bitbucket. In my '.ssh/config' file I have the following:</p>
<pre><code>[ivanna@comp]$ cat ~/.ssh/config
Host bitbucket
Hostname bitbucket.org
IdentityFile /home/ivanna/.ssh/id_rsa_bitbucket
Identiti... | 35,808 | 5,130,863 | 2023-02-05 23:54:43 | 31,660,669 | 16 | 2015-07-27 18:34:05 | 216,074 | 2015-07-27 18:34:05 | https://stackoverflow.com/q/31660263 | https://stackoverflow.com/a/31660669 | <pre><code>ssh -T hg@bitbucket
</code></pre>
<p>You use <code>hg@bitbucket</code> when logging in via SSH, but in the remote URL you add to Git, you don’t specify a username. Since the configuration also does not include one, Git won’t know what username to log in with.</p>
<p>Change the URL to this:</p>
<pre><code>... | <pre><code>ssh -T hg@bitbucket </code></pre> <p>You use <code>hg@bitbucket</code> when logging in via SSH, but in the remote URL you add to Git, you don’t specify a username. Since the configuration also does not include one, Git won’t know what username to log in with.</p> <p>Change the URL to this:</p> <pre><code>... | 119, 386, 8337, 25308 | bitbucket, git, ssh, ssh-keys | <h1>Bitbucket ssh public key is being denied but their ssh test connects with no issue</h1>
<p>A quite probably relevant piece of information is that I have a custom ssh config set up for bitbucket. In my '.ssh/config' file I have the following:</p>
<pre><code>[ivanna@comp]$ cat ~/.ssh/config
Host bitbucket
Hostn... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,531 | git | # Bitbucket ssh public key is being denied but their ssh test connects with no issue
A quite probably relevant piece of information is that I have a custom ssh config set up for bitbucket. In my '.ssh/config' file I have the following:
```
[ivanna@comp]$ cat ~/.ssh/config
Host bitbucket
Hostname bitbucket... | ```
ssh -T hg@bitbucket
```
You use `hg@bitbucket` when logging in via SSH, but in the remote URL you add to Git, you don’t specify a username. Since the configuration also does not include one, Git won’t know what username to log in with.
Change the URL to this:
```
git remote add origin git@bitbucket:ivanna/my-rep... |
23692747 | Specifying SSH key for JGit | 17 | 2014-05-16 04:40:51 | <p>I'm wondering how I can use jgit to connect to github using a specified ssh key file (i.e. one not in <code>~/.ssh/</code>).</p>
<p>Unfortunately, I'm not sure how to use <code>JschConfigSessionFactory</code> properly. I've tried creating a setup just like the one in this article: <a href="https://stackoverflow.com... | 27,119 | 3,643,254 | 2020-05-14 14:31:41 | 23,695,111 | 16 | 2014-05-16 12:23:56 | 2,986,905 | 2016-04-07 07:44:17 | https://stackoverflow.com/q/23692747 | https://stackoverflow.com/a/23695111 | <p>GitHub uses password authentication for https URLs and public-key authentication for SSH URLs (see <a href="https://gist.github.com/grawity/4392747" rel="noreferrer">https://gist.github.com/grawity/4392747</a>).</p>
<p>The <code>SshSessionFactory</code> is only consulted for SSH URLs like git@github.com:user/repo.g... | <p>GitHub uses password authentication for https URLs and public-key authentication for SSH URLs (see <a href="https://gist.github.com/grawity/4392747" rel="noreferrer">https://gist.github.com/grawity/4392747</a>).</p> <p>The <code>SshSessionFactory</code> is only consulted for SSH URLs like git@github.com:user/repo.g... | 17, 119, 386, 12269, 61058 | git, java, jgit, jsch, ssh | <h1>Specifying SSH key for JGit</h1>
<p>I'm wondering how I can use jgit to connect to github using a specified ssh key file (i.e. one not in <code>~/.ssh/</code>).</p>
<p>Unfortunately, I'm not sure how to use <code>JschConfigSessionFactory</code> properly. I've tried creating a setup just like the one in this articl... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,532 | git | # Specifying SSH key for JGit
I'm wondering how I can use jgit to connect to github using a specified ssh key file (i.e. one not in `~/.ssh/`).
Unfortunately, I'm not sure how to use `JschConfigSessionFactory` properly. I've tried creating a setup just like the one in this article: [Using Keys with JGit to Access a G... | GitHub uses password authentication for https URLs and public-key authentication for SSH URLs (see <https://gist.github.com/grawity/4392747>).
The `SshSessionFactory` is only consulted for SSH URLs like git@github.com:user/repo.git. To authenticate for an https URL you can use the `CredentialsProvider`. The base class... |
16164624 | vim syntax highlighting for git commit messages - custom commentchar | 17 | 2013-04-23 08:34:09 | <p>As mentioned <a href="https://stackoverflow.com/a/14931661/835945">in this answer</a>, since Git 1.8.2 you can use <code>core.commentchar</code> config value to change commit message comments to something else than the default <code>#</code> (hashmark or hashsign).</p>
<p>That is a life-saver e.g. if your commit me... | 5,789 | 835,945 | 2013-04-23 14:02:56 | 16,165,424 | 16 | 2013-04-23 09:11:36 | 513,198 | 2013-04-23 14:02:56 | https://stackoverflow.com/q/16164624 | https://stackoverflow.com/a/16165424 | <p>You should try to run <code>:verbose syntax</code>. The active syntax file is probably <code>$VIMRUNTIME\syntax\gitcommit.vim</code> (<a href="https://github.com/tpope/vim-git/blob/master/syntax/gitcommit.vim">github version</a> which is likely in your <code>.vim</code>).</p>
<p>It will tell you which syntax line ... | <p>You should try to run <code>:verbose syntax</code>. The active syntax file is probably <code>$VIMRUNTIME\syntax\gitcommit.vim</code> (<a href="https://github.com/tpope/vim-git/blob/master/syntax/gitcommit.vim">github version</a> which is likely in your <code>.vim</code>).</p> <p>It will tell you which syntax line ... | 119, 370, 1966, 4717 | comments, git, syntax-highlighting, vim | <h1>vim syntax highlighting for git commit messages - custom commentchar</h1>
<p>As mentioned <a href="https://stackoverflow.com/a/14931661/835945">in this answer</a>, since Git 1.8.2 you can use <code>core.commentchar</code> config value to change commit message comments to something else than the default <code>#</cod... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,533 | git | # vim syntax highlighting for git commit messages - custom commentchar
As mentioned [in this answer](https://stackoverflow.com/a/14931661/835945), since Git 1.8.2 you can use `core.commentchar` config value to change commit message comments to something else than the default `#` (hashmark or hashsign).
That is a life... | You should try to run `:verbose syntax`. The active syntax file is probably `$VIMRUNTIME\syntax\gitcommit.vim` ([github version](https://github.com/tpope/vim-git/blob/master/syntax/gitcommit.vim) which is likely in your `.vim`).
It will tell you which syntax line will trigger the formatting as comment.
You'll probabl... |
11027683 | git blame on a line modified multiple times? | 17 | 2012-06-14 06:19:41 | <p>if a line is modified back and forth between 2 versions several times,
git blame seems to show only the latest commits on that line.</p>
<p>would it be possible to let it show all commits on that line?</p>
| 5,753 | 933,882 | 2017-05-09 08:31:06 | 11,027,841 | 16 | 2012-06-14 06:33:22 | 6,236 | 2015-03-02 14:33:45 | https://stackoverflow.com/q/11027683 | https://stackoverflow.com/a/11027841 | <p><code>git blame</code> can't do that itself (but see below for a workaround).</p>
<p>But <a href="http://git-scm.com/docs/git-gui" rel="noreferrer"><code>git gui</code></a> has a blame mode that allows you to drill down into commits.</p>
<p>Invoke it with <code>git gui blame <filename></code> once installed.... | <p><code>git blame</code> can't do that itself (but see below for a workaround).</p> <p>But <a href="http://git-scm.com/docs/git-gui" rel="noreferrer"><code>git gui</code></a> has a blame mode that allows you to drill down into commits.</p> <p>Invoke it with <code>git gui blame <filename></code> once installed.... | 119, 21455 | blame, git | <h1>git blame on a line modified multiple times?</h1>
<p>if a line is modified back and forth between 2 versions several times,
git blame seems to show only the latest commits on that line.</p>
<p>would it be possible to let it show all commits on that line?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,535 | git | # git blame on a line modified multiple times?
if a line is modified back and forth between 2 versions several times,
git blame seems to show only the latest commits on that line.
would it be possible to let it show all commits on that line? | `git blame` can't do that itself (but see below for a workaround).
But [`git gui`](http://git-scm.com/docs/git-gui) has a blame mode that allows you to drill down into commits.
Invoke it with `git gui blame <filename>` once installed. |
5991215 | How do I get the real config value in Git? | 17 | 2011-05-13 11:29:59 | <p>It seems that <code>git config</code> only returns value that I explicitly set and doesn't aware of the default values. For example when I run <code>git config commit.status</code> it outputs nothing.</p>
<p><a href="http://git-scm.com/docs/git-config" rel="noreferrer">http://git-scm.com/docs/git-config</a> helps b... | 2,738 | 752,270 | 2011-05-13 12:31:56 | 5,991,875 | 16 | 2011-05-13 12:31:56 | 223,092 | 2011-05-13 12:31:56 | https://stackoverflow.com/q/5991215 | https://stackoverflow.com/a/5991875 | <p>Unfortunately, I don't think this is possible. Perhaps someone more familiar with the git source code will correct me, but I think that the default values are typically hard-coded in the source files and overridden by the config variables. For example, the default for <code>gc.pruneExpire</code> is defined <a href... | <p>Unfortunately, I don't think this is possible. Perhaps someone more familiar with the git source code will correct me, but I think that the default values are typically hard-coded in the source files and overridden by the config variables. For example, the default for <code>gc.pruneExpire</code> is defined <a href... | 119 | git | <h1>How do I get the real config value in Git?</h1>
<p>It seems that <code>git config</code> only returns value that I explicitly set and doesn't aware of the default values. For example when I run <code>git config commit.status</code> it outputs nothing.</p>
<p><a href="http://git-scm.com/docs/git-config" rel="norefe... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,536 | git | # How do I get the real config value in Git?
It seems that `git config` only returns value that I explicitly set and doesn't aware of the default values. For example when I run `git config commit.status` it outputs nothing.
<http://git-scm.com/docs/git-config> helps but doesn't list all of the default values. | Unfortunately, I don't think this is possible. Perhaps someone more familiar with the git source code will correct me, but I think that the default values are typically hard-coded in the source files and overridden by the config variables. For example, the default for `gc.pruneExpire` is defined [here](https://github.c... |
4434787 | Git: How to "undo" a merge | 17 | 2010-12-14 00:21:25 | <p>The situation:
Starting with the Master at <code>A</code> I branched and made some changes at <code>B</code> then merged that branch back in <code>(C)</code>. After making some more changes I was at <code>D</code> but found I needed to deploy the code without the changes that happened in the branch. If I hand't merg... | 13,769 | 246,265 | 2012-05-22 02:09:01 | 4,438,310 | 16 | 2010-12-14 10:45:03 | 108,802 | 2010-12-14 12:57:29 | https://stackoverflow.com/q/4434787 | https://stackoverflow.com/a/4438310 | <p>You can use rebase to do that in one step:</p>
<pre><code>git rebase --onto A C D
</code></pre>
<p>I just tested this, with appropriate results:</p>
<pre><code>$ edit test.txt
$ git add .
$ git commit -mA
$ git checkout -b the_branch
$ edit test.txt
$ git commit -a -mB
$ git checkout master
$ git merge master the... | <p>You can use rebase to do that in one step:</p> <pre><code>git rebase --onto A C D </code></pre> <p>I just tested this, with appropriate results:</p> <pre><code>$ edit test.txt $ git add . $ git commit -mA $ git checkout -b the_branch $ edit test.txt $ git commit -a -mB $ git checkout master $ git merge master the... | 119, 28897, 76220 | git, git-branch, git-merge | <h1>Git: How to "undo" a merge</h1>
<p>The situation:
Starting with the Master at <code>A</code> I branched and made some changes at <code>B</code> then merged that branch back in <code>(C)</code>. After making some more changes I was at <code>D</code> but found I needed to deploy the code without the changes that happ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,537 | git | # Git: How to "undo" a merge
The situation:
Starting with the Master at `A` I branched and made some changes at `B` then merged that branch back in `(C)`. After making some more changes I was at `D` but found I needed to deploy the code without the changes that happened in the branch. If I hand't merged it that would ... | You can use rebase to do that in one step:
```
git rebase --onto A C D
```
I just tested this, with appropriate results:
```
$ edit test.txt
$ git add .
$ git commit -mA
$ git checkout -b the_branch
$ edit test.txt
$ git commit -a -mB
$ git checkout master
$ git merge master the_branch --no-ff
$ edit test.txt
$ git ... |
50199354 | An unexpected version directory Classes was encountered | 16 | 2018-05-06 11:48:53 | <p>I get an error while create a private repo. This are the steps I take:</p>
<ol>
<li>Create folder, run pod lint create <code>PrivateRepo</code> and set the values</li>
<li>Create private repo in BitBucket</li>
<li>Run this command in the PrivateRepo folder:</li>
</ol>
<p>commands:</p>
<pre><code>git add .
git com... | 8,413 | 7,715,250 | 2023-06-13 07:28:25 | 54,769,122 | 16 | 2019-02-19 14:57:51 | 9,226,349 | 2019-04-08 14:55:44 | https://stackoverflow.com/q/50199354 | https://stackoverflow.com/a/54769122 | <p>It looks like you're almost there, but just haven't set up your podspec repo (which is a recommended step: <a href="https://guides.cocoapods.org/making/private-cocoapods.html" rel="noreferrer">https://guides.cocoapods.org/making/private-cocoapods.html</a>).</p>
<p>In your Podfile, try replacing the source URL of yo... | <p>It looks like you're almost there, but just haven't set up your podspec repo (which is a recommended step: <a href="https://guides.cocoapods.org/making/private-cocoapods.html" rel="noreferrer">https://guides.cocoapods.org/making/private-cocoapods.html</a>).</p> <p>In your Podfile, try replacing the source URL of yo... | 119, 8337, 77741 | bitbucket, cocoapods, git | <h1>An unexpected version directory Classes was encountered</h1>
<p>I get an error while create a private repo. This are the steps I take:</p>
<ol>
<li>Create folder, run pod lint create <code>PrivateRepo</code> and set the values</li>
<li>Create private repo in BitBucket</li>
<li>Run this command in the PrivateRepo f... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,543 | git | # An unexpected version directory Classes was encountered
I get an error while create a private repo. This are the steps I take:
1. Create folder, run pod lint create `PrivateRepo` and set the values
2. Create private repo in BitBucket
3. Run this command in the PrivateRepo folder:
commands:
```
git add .
git commi... | It looks like you're almost there, but just haven't set up your podspec repo (which is a recommended step: <https://guides.cocoapods.org/making/private-cocoapods.html>).
In your Podfile, try replacing the source URL of your repo to that of your spec instead. Eg:
```
source 'https://username@bitbucket.org/username/pri... |
49577952 | Mercurial: enable git subrepo | 16 | 2018-03-30 16:31:34 | <p>Recently this behavior was disabled by default. The message prompts you to check the help page but it's not helpful, at least it didn't help me.</p>
<pre><code> "subrepos"
----------
This section contains options that control the behavior of the
subrepositories feature. See also 'hg help subrepos'.
... | 3,998 | 198,108 | 2019-05-07 18:43:31 | 50,158,089 | 16 | 2018-05-03 14:55:59 | 4,994,744 | 2018-05-03 14:55:59 | https://stackoverflow.com/q/49577952 | https://stackoverflow.com/a/50158089 | <p>In your <code>.hgrc</code> file, you must add:</p>
<pre><code>[subrepos]
git:allowed = true
</code></pre>
| <p>In your <code>.hgrc</code> file, you must add:</p> <pre><code>[subrepos] git:allowed = true </code></pre> | 119, 725, 802 | configuration, git, mercurial | <h1>Mercurial: enable git subrepo</h1>
<p>Recently this behavior was disabled by default. The message prompts you to check the help page but it's not helpful, at least it didn't help me.</p>
<pre><code> "subrepos"
----------
This section contains options that control the behavior of the
subrepositories fe... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,544 | git | # Mercurial: enable git subrepo
Recently this behavior was disabled by default. The message prompts you to check the help page but it's not helpful, at least it didn't help me.
```
"subrepos"
----------
This section contains options that control the behavior of the
subrepositories feature. See also 'hg ... | In your `.hgrc` file, you must add:
```
[subrepos]
git:allowed = true
``` |
46770453 | Java error when using git-credential-manager in Mac on OSX? | 16 | 2017-10-16 12:33:47 | <p>I have installed and configured git-credential-manager on Mac OSX according to these instructions:</p>
<p><a href="https://github.com/Microsoft/Git-Credential-Manager-for-Mac-and-Linux/blob/master/Install.md" rel="noreferrer">https://github.com/Microsoft/Git-Credential-Manager-for-Mac-and-Linux/blob/master/Install.... | 4,498 | 6,620,662 | 2019-06-13 04:24:36 | 46,782,697 | 16 | 2017-10-17 04:51:43 | 6,309 | 2018-10-20 04:09:16 | https://stackoverflow.com/q/46770453 | https://stackoverflow.com/a/46782697 | <p>Oct. 2017: That is tracked with <a href="https://github.com/Microsoft/Git-Credential-Manager-for-Mac-and-Linux/issues/69" rel="noreferrer">Microsoft/Git-Credential-Manager-for-Mac-and-Linux issues/69</a></p>
<blockquote>
<p>I dumped Java 9 and installed Java 8, and everything worked just fine.</p>
</blockquote>
... | <p>Oct. 2017: That is tracked with <a href="https://github.com/Microsoft/Git-Credential-Manager-for-Mac-and-Linux/issues/69" rel="noreferrer">Microsoft/Git-Credential-Manager-for-Mac-and-Linux issues/69</a></p> <blockquote> <p>I dumped Java 9 and installed Java 8, and everything worked just fine.</p> </blockquote> ... | 119, 369 | git, macos | <h1>Java error when using git-credential-manager in Mac on OSX?</h1>
<p>I have installed and configured git-credential-manager on Mac OSX according to these instructions:</p>
<p><a href="https://github.com/Microsoft/Git-Credential-Manager-for-Mac-and-Linux/blob/master/Install.md" rel="noreferrer">https://github.com/Mi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,545 | git | # Java error when using git-credential-manager in Mac on OSX?
I have installed and configured git-credential-manager on Mac OSX according to these instructions:
<https://github.com/Microsoft/Git-Credential-Manager-for-Mac-and-Linux/blob/master/Install.md>
The brew install complained about a missing Java requirement ... | Oct. 2017: That is tracked with [Microsoft/Git-Credential-Manager-for-Mac-and-Linux issues/69](https://github.com/Microsoft/Git-Credential-Manager-for-Mac-and-Linux/issues/69)
> I dumped Java 9 and installed Java 8, and everything worked just fine.
```
brew cask remove java
```
Reinstall git-credential-manager
```
... |
36247793 | Git start branch from another branch without tracking | 16 | 2016-03-27 13:19:57 | <p>I want to create a branch <code>foo</code> (and have it checked out) that'll start on the same commit as <code>origin/bar</code>, but I don't currently have <code>origin/bar</code> checked out. Is there a one-liner that does this?</p>
| 6,816 | 76,701 | 2016-03-27 17:49:59 | 36,247,894 | 16 | 2016-03-27 13:30:50 | null | 2016-03-27 13:30:50 | https://stackoverflow.com/q/36247793 | https://stackoverflow.com/a/36247894 | <p>You can do it in a single command: <code>git checkout</code> allows <code>git branch</code>'s <code>--no-track</code> option to be specified directly.</p>
<pre><code>git checkout -b foo --no-track origin/bar
</code></pre>
| <p>You can do it in a single command: <code>git checkout</code> allows <code>git branch</code>'s <code>--no-track</code> option to be specified directly.</p> <pre><code>git checkout -b foo --no-track origin/bar </code></pre> | 119 | git | <h1>Git start branch from another branch without tracking</h1>
<p>I want to create a branch <code>foo</code> (and have it checked out) that'll start on the same commit as <code>origin/bar</code>, but I don't currently have <code>origin/bar</code> checked out. Is there a one-liner that does this?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,546 | git | # Git start branch from another branch without tracking
I want to create a branch `foo` (and have it checked out) that'll start on the same commit as `origin/bar`, but I don't currently have `origin/bar` checked out. Is there a one-liner that does this? | You can do it in a single command: `git checkout` allows `git branch`'s `--no-track` option to be specified directly.
```
git checkout -b foo --no-track origin/bar
``` |
19406988 | How does git --no-merged option work | 16 | 2013-10-16 15:06:17 | <p>How does the <code>git branch -r --no-merged</code> work?</p>
<p>Does it check to see if all commits in one branch already exist in the original parent branch?</p>
<p>And what about cherry picks? Is it smart enough to say that a commit from 1 branch has already been cherry picked back into the original parent bran... | 125,156 | 1,086,117 | 2013-10-16 17:14:41 | 19,409,617 | 16 | 2013-10-16 17:14:41 | 1,174,076 | 2013-10-16 17:14:41 | https://stackoverflow.com/q/19406988 | https://stackoverflow.com/a/19409617 | <p>Well, that comments from @Hasturkun says it all to be honest, but you have 3 questions:</p>
<p><strong>1. Does it check to see if all commits in one branch already exist in the original parent branch?</strong></p>
<p>Not trying to be repetitive @Hasturkun quote says: <em>"Only list branches whose tips are not reac... | <p>Well, that comments from @Hasturkun says it all to be honest, but you have 3 questions:</p> <p><strong>1. Does it check to see if all commits in one branch already exist in the original parent branch?</strong></p> <p>Not trying to be repetitive @Hasturkun quote says: <em>"Only list branches whose tips are not reac... | 119 | git | <h1>How does git --no-merged option work</h1>
<p>How does the <code>git branch -r --no-merged</code> work?</p>
<p>Does it check to see if all commits in one branch already exist in the original parent branch?</p>
<p>And what about cherry picks? Is it smart enough to say that a commit from 1 branch has already been ch... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,547 | git | # How does git --no-merged option work
How does the `git branch -r --no-merged` work?
Does it check to see if all commits in one branch already exist in the original parent branch?
And what about cherry picks? Is it smart enough to say that a commit from 1 branch has already been cherry picked back into the original... | Well, that comments from @Hasturkun says it all to be honest, but you have 3 questions:
**1. Does it check to see if all commits in one branch already exist in the original parent branch?**
Not trying to be repetitive @Hasturkun quote says: *"Only list branches whose tips are not reachable from the specified commit".... |
16490547 | What is the right way to merge branches when `git diff` shows changes but `git merge` does nothing | 16 | 2013-05-10 20:44:02 | <p>I get stumped when <code>git diff other_branch</code> shows differences and <code>git merge other_branch</code> does nothing. What's the right way to incorporate that "missing" code into <code>my_branch</code>?</p>
<p>This <a href="https://stackoverflow.com/a/1408064/623735">SO answer</a> diagramed a situation simi... | 8,317 | 623,735 | 2018-06-15 18:12:08 | 16,494,788 | 16 | 2013-05-11 07:18:06 | 1,761,499 | 2013-05-11 07:37:32 | https://stackoverflow.com/q/16490547 | https://stackoverflow.com/a/16494788 | <p>You seem to have two issues here at the same time.</p>
<p>Assuming a history like the one you described:</p>
<pre><code> my_branch
v
----A---B---C-------G
\ \ /
--*D*---E---F
^
other_branch
</code></pre>
<hr>
<p><strong>Why... | <p>You seem to have two issues here at the same time.</p> <p>Assuming a history like the one you described:</p> <pre><code> my_branch v ----A---B---C-------G \ \ / --*D*---E---F ^ other_branch </code></pre> <hr> <p><strong>Why... | 119, 9033, 28897 | git, git-diff, git-merge | <h1>What is the right way to merge branches when `git diff` shows changes but `git merge` does nothing</h1>
<p>I get stumped when <code>git diff other_branch</code> shows differences and <code>git merge other_branch</code> does nothing. What's the right way to incorporate that "missing" code into <code>my_branch</code>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,548 | git | # What is the right way to merge branches when `git diff` shows changes but `git merge` does nothing
I get stumped when `git diff other_branch` shows differences and `git merge other_branch` does nothing. What's the right way to incorporate that "missing" code into `my_branch`?
This [SO answer](https://stackoverflow.... | You seem to have two issues here at the same time.
Assuming a history like the one you described:
```
my_branch
v
----A---B---C-------G
\ \ /
--*D*---E---F
^
other_branch
```
---
**Why the diff is not empty:**
This situation... |
16354707 | Using `git checkout -b` with and without a branch starting point | 16 | 2013-05-03 08:39:25 | <p>I am new to Git, I want to know the difference between two commands.</p>
<pre><code>`git checkout -b <branch-name>`
`git checkout -b <branch-name> origin/master`
</code></pre>
<p>If I execute the first command, how does Git create the branch? Will the branch be created from local master or remote maste... | 7,528 | 646,276 | 2020-01-12 23:21:08 | 16,354,849 | 16 | 2013-05-03 08:46:58 | 635,608 | 2013-05-03 08:46:58 | https://stackoverflow.com/q/16354707 | https://stackoverflow.com/a/16354849 | <p>If you don't specify a starting point, the new branch is created from what you currently have checked out (the current <code>HEAD</code>).</p>
<p><a href="https://www.kernel.org/pub/software/scm/git/docs/git-checkout.html" rel="noreferrer"><code>git-checkout</code></a>:</p>
<blockquote>
<p><code>git checkout -b|-B &... | <p>If you don't specify a starting point, the new branch is created from what you currently have checked out (the current <code>HEAD</code>).</p> <p><a href="https://www.kernel.org/pub/software/scm/git/docs/git-checkout.html" rel="noreferrer"><code>git-checkout</code></a>:</p> <blockquote> <p><code>git checkout -b|-B &... | 119 | git | <h1>Using `git checkout -b` with and without a branch starting point</h1>
<p>I am new to Git, I want to know the difference between two commands.</p>
<pre><code>`git checkout -b <branch-name>`
`git checkout -b <branch-name> origin/master`
</code></pre>
<p>If I execute the first command, how does Git creat... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,549 | git | # Using `git checkout -b` with and without a branch starting point
I am new to Git, I want to know the difference between two commands.
```
`git checkout -b <branch-name>`
`git checkout -b <branch-name> origin/master`
```
If I execute the first command, how does Git create the branch? Will the branch be created from... | If you don't specify a starting point, the new branch is created from what you currently have checked out (the current `HEAD`).
[`git-checkout`](https://www.kernel.org/pub/software/scm/git/docs/git-checkout.html):
> `git checkout -b|-B <new_branch> [<start point>]`
>
> Specifying `-b` causes a new branch to be create... |
12681936 | git - default push to --recurse-submodules=check | 16 | 2012-10-01 22:19:47 | <p>I always forget to push submodules. Sometimes I forget to add <code>--recurse-submodules=check</code> to <code>git push</code>. Even worse, others on my team might do the same. Is there a <code>git config</code> option we can set to make <code>check</code> the default?</p>
| 3,208 | 12,034 | 2016-01-05 15:52:19 | 12,682,052 | 16 | 2012-10-01 22:32:35 | 289,651 | 2012-10-02 12:51:16 | https://stackoverflow.com/q/12681936 | https://stackoverflow.com/a/12682052 | <p>You could try aliasing it.</p>
<pre><code>git config alias.ps "push --recurse-submodules=check"
</code></pre>
<p>Then use</p>
<pre><code>git ps
</code></pre>
| <p>You could try aliasing it.</p> <pre><code>git config alias.ps "push --recurse-submodules=check" </code></pre> <p>Then use</p> <pre><code>git ps </code></pre> | 119, 41612 | git, git-submodules | <h1>git - default push to --recurse-submodules=check</h1>
<p>I always forget to push submodules. Sometimes I forget to add <code>--recurse-submodules=check</code> to <code>git push</code>. Even worse, others on my team might do the same. Is there a <code>git config</code> option we can set to make <code>check</code> th... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,551 | git | # git - default push to --recurse-submodules=check
I always forget to push submodules. Sometimes I forget to add `--recurse-submodules=check` to `git push`. Even worse, others on my team might do the same. Is there a `git config` option we can set to make `check` the default? | You could try aliasing it.
```
git config alias.ps "push --recurse-submodules=check"
```
Then use
```
git ps
``` |
10606809 | Git equivalence of SVN Changelist? | 16 | 2012-05-15 18:36:53 | <p>Just curious if Git has something like Subversions Changelist feature, its something that I find quite handy working with on the fly, I know I could run something like:</p>
<pre><code>cat 'changelistfileimade' | xargs git update
</code></pre>
<p>but am curious if there's a built in method too?</p>
| 9,593 | 411,141 | 2025-08-02 20:56:56 | 10,607,010 | 16 | 2012-05-15 18:51:23 | 112,968 | 2012-05-15 18:57:02 | https://stackoverflow.com/q/10606809 | https://stackoverflow.com/a/10607010 | <p>I have never used <a href="http://www.subversion.org.cn/svnbook/nightly/svn.advanced.changelists.html" rel="noreferrer">SVN changelists</a> myself, but if I understand correctly, it allows you to <em>group</em> files into <em>changelists</em> and later separately commit those changelists. (Right?)</p>
<p>I don't th... | <p>I have never used <a href="http://www.subversion.org.cn/svnbook/nightly/svn.advanced.changelists.html" rel="noreferrer">SVN changelists</a> myself, but if I understand correctly, it allows you to <em>group</em> files into <em>changelists</em> and later separately commit those changelists. (Right?)</p> <p>I don't th... | 63, 119, 5608 | git, list, svn | <h1>Git equivalence of SVN Changelist?</h1>
<p>Just curious if Git has something like Subversions Changelist feature, its something that I find quite handy working with on the fly, I know I could run something like:</p>
<pre><code>cat 'changelistfileimade' | xargs git update
</code></pre>
<p>but am curious if there's... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,552 | git | # Git equivalence of SVN Changelist?
Just curious if Git has something like Subversions Changelist feature, its something that I find quite handy working with on the fly, I know I could run something like:
```
cat 'changelistfileimade' | xargs git update
```
but am curious if there's a built in method too? | I have never used [SVN changelists](http://www.subversion.org.cn/svnbook/nightly/svn.advanced.changelists.html) myself, but if I understand correctly, it allows you to *group* files into *changelists* and later separately commit those changelists. (Right?)
I don't think you really need such a feature with Git. You can... |
7418644 | Git revert of merge commit causes issues when merge is actually done. | 16 | 2011-09-14 15:09:18 | <p>We accidentally merged branch XYZ into DEV and pushed it to the origin repo. This was done with --no-ff to create a separate merge commit. As soon as I realized the wrong merge, I did a git revert to create a revert commit and pushed it out. Everything was good and there was much rejoicing...</p>
<p>Until we tried ... | 5,174 | 151,372 | 2017-05-26 05:04:53 | 7,418,878 | 16 | 2011-09-14 15:23:20 | 223,092 | 2017-05-26 05:04:53 | https://stackoverflow.com/q/7418644 | https://stackoverflow.com/a/7418878 | <blockquote>
<p>a) What's a good way to roll back commits, especially if they have been pushed out to other repos? git revert seemed the right thing to do, but after the merging issues I'm not so sure any more...</p>
</blockquote>
<p>If you've already shared the merged version with other developers who might have pu... | <blockquote> <p>a) What's a good way to roll back commits, especially if they have been pushed out to other repos? git revert seemed the right thing to do, but after the merging issues I'm not so sure any more...</p> </blockquote> <p>If you've already shared the merged version with other developers who might have pu... | 119 | git | <h1>Git revert of merge commit causes issues when merge is actually done.</h1>
<p>We accidentally merged branch XYZ into DEV and pushed it to the origin repo. This was done with --no-ff to create a separate merge commit. As soon as I realized the wrong merge, I did a git revert to create a revert commit and pushed it o... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,553 | git | # Git revert of merge commit causes issues when merge is actually done.
We accidentally merged branch XYZ into DEV and pushed it to the origin repo. This was done with --no-ff to create a separate merge commit. As soon as I realized the wrong merge, I did a git revert to create a revert commit and pushed it out. Every... | > a) What's a good way to roll back commits, especially if they have been pushed out to other repos? git revert seemed the right thing to do, but after the merging issues I'm not so sure any more...
If you've already shared the merged version with other developers who might have pulled that version, you are quite corr... |
6295449 | git untracked files - how to ignore | 16 | 2011-06-09 15:33:45 | <p>When I run <code>git status</code>, I see the "Untracked files" section has many files (some with a "." extension.)</p>
<p>I don't think I have to do anything, but it doesnt look good to see these files whenever I run <code>git status</code>. Is there any way to not to see these files?</p>
| 48,896 | 345,579 | 2018-11-22 22:06:14 | 6,295,474 | 16 | 2011-06-09 15:35:44 | 111,461 | 2011-06-09 15:35:44 | https://stackoverflow.com/q/6295449 | https://stackoverflow.com/a/6295474 | <p>You need to create one or several <code>.gitignore</code> files. They can be stored in git itself, or just kept local.</p>
| <p>You need to create one or several <code>.gitignore</code> files. They can be stored in git itself, or just kept local.</p> | 119, 456, 3346, 25056, 54839 | dvcs, git, gitignore, git-status, version-control | <h1>git untracked files - how to ignore</h1>
<p>When I run <code>git status</code>, I see the "Untracked files" section has many files (some with a "." extension.)</p>
<p>I don't think I have to do anything, but it doesnt look good to see these files whenever I run <code>git status</code>. Is there any way to not to s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,554 | git | # git untracked files - how to ignore
When I run `git status`, I see the "Untracked files" section has many files (some with a "." extension.)
I don't think I have to do anything, but it doesnt look good to see these files whenever I run `git status`. Is there any way to not to see these files? | You need to create one or several `.gitignore` files. They can be stored in git itself, or just kept local. |
2783086 | How does git-diff generate hunk descriptions? | 16 | 2010-05-06 17:24:50 | <p>(git version 1.6.5.7)</p>
<p>When I run <code>git diff</code> the output has a nice scope hint after the line numbers for my Python scripts, e.g.:</p>
<pre><code>diff --git a/file.py b/file.py
index 024f5bb..c3b5c56 100644
--- a/file.py
+++ b/file.py
@@ -14,6 +14,8 @@ TITF: Test Infrastructure Tags Format
...
@@ -... | 2,787 | 83,100 | 2019-12-12 20:23:29 | 2,783,188 | 16 | 2010-05-06 17:41:15 | 230,620 | 2018-02-22 13:12:39 | https://stackoverflow.com/q/2783086 | https://stackoverflow.com/a/2783188 | <p>Git uses a regular expression to find a suitable line for the hunk headers. Python's is built-in, but you should be able to define your own expression in your ~/.gitconfig:</p>
<pre><code>[diff "python"]
xfuncname = "<regex goes here>"
</code></pre>
<p>More about this <a href="https://www.kernel.org/... | <p>Git uses a regular expression to find a suitable line for the hunk headers. Python's is built-in, but you should be able to define your own expression in your ~/.gitconfig:</p> <pre><code>[diff "python"] xfuncname = "<regex goes here>" </code></pre> <p>More about this <a href="https://www.kernel.org/... | 16, 119, 606 | diff, git, python | <h1>How does git-diff generate hunk descriptions?</h1>
<p>(git version 1.6.5.7)</p>
<p>When I run <code>git diff</code> the output has a nice scope hint after the line numbers for my Python scripts, e.g.:</p>
<pre><code>diff --git a/file.py b/file.py
index 024f5bb..c3b5c56 100644
--- a/file.py
+++ b/file.py
@@ -14,6 ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,555 | git | # How does git-diff generate hunk descriptions?
(git version 1.6.5.7)
When I run `git diff` the output has a nice scope hint after the line numbers for my Python scripts, e.g.:
```
diff --git a/file.py b/file.py
index 024f5bb..c3b5c56 100644
--- a/file.py
+++ b/file.py
@@ -14,6 +14,8 @@ TITF: Test Infrastructure Tag... | Git uses a regular expression to find a suitable line for the hunk headers. Python's is built-in, but you should be able to define your own expression in your ~/.gitconfig:
```
[diff "python"]
xfuncname = "<regex goes here>"
```
More about this [here](https://www.kernel.org/pub/software/scm/git/docs/gitattrib... |
1348568 | Can I "disable" git-clone over http? | 16 | 2009-08-28 18:10:31 | <p>I'm using git to manage a tiny project. I've been performing all of my transactions (clone, push, pull, etc) through SSH, but recently ran git-update-server-info because I wanted to experiment with running git-clone over http. It worked great. Cool. Now I realize though that anyone can clone my repository over h... | 11,505 | 56,309 | 2024-04-01 18:25:47 | 1,348,632 | 16 | 2009-08-28 18:29:09 | 46,058 | 2009-08-28 18:29:09 | https://stackoverflow.com/q/1348568 | https://stackoverflow.com/a/1348632 | <p>For git repository to be available via HTTP transport, it needs to be "exported" by (any) web server. If your repository (to be more exact its <code>.git</code> directory) is visible from outside in a web browser, then it can be cloned or fetched anonymously via HTTP protocol. <a href="http://www.kernel.org/pub/so... | <p>For git repository to be available via HTTP transport, it needs to be "exported" by (any) web server. If your repository (to be more exact its <code>.git</code> directory) is visible from outside in a web browser, then it can be cloned or fetched anonymously via HTTP protocol. <a href="http://www.kernel.org/pub/so... | 119, 5210, 34099 | git, git-clone, http | <h1>Can I "disable" git-clone over http?</h1>
<p>I'm using git to manage a tiny project. I've been performing all of my transactions (clone, push, pull, etc) through SSH, but recently ran git-update-server-info because I wanted to experiment with running git-clone over http. It worked great. Cool. Now I realize tho... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,557 | git | # Can I "disable" git-clone over http?
I'm using git to manage a tiny project. I've been performing all of my transactions (clone, push, pull, etc) through SSH, but recently ran git-update-server-info because I wanted to experiment with running git-clone over http. It worked great. Cool. Now I realize though that anyo... | For git repository to be available via HTTP transport, it needs to be "exported" by (any) web server. If your repository (to be more exact its `.git` directory) is visible from outside in a web browser, then it can be cloned or fetched anonymously via HTTP protocol. [`git update-server-info`](http://www.kernel.org/pub/... |
941466 | In git, can you view the older commits applied to a file after it has been moved? | 16 | 2009-06-02 19:32:30 | <p>After I have moved a file in git (using <code>git mv</code>), looking at the log for that file only shows the commits including and after the move. </p>
<p>Is there any way to view the commits applied to the file under its old name? In the example, below, I'd like to see commits b04033bdc44f1 and 8ca40d563ce5d in <... | 2,886 | 32,866 | 2017-02-08 21:01:58 | 941,542 | 16 | 2009-06-02 19:48:55 | 6,309 | 2017-02-08 21:01:58 | https://stackoverflow.com/q/941466 | https://stackoverflow.com/a/941542 | <p>'<code>git-log -M</code>' will give the commit history with rename information, as mentioned <a href="https://git.wiki.kernel.org/index.php/GitFaq#Why_does_Git_not_.22track.22_renames.3F" rel="nofollow noreferrer">in GitFaq "Why does git not "track" renames ?"</a></p>
<p>The <code>diff</code> machinery in Git has s... | <p>'<code>git-log -M</code>' will give the commit history with rename information, as mentioned <a href="https://git.wiki.kernel.org/index.php/GitFaq#Why_does_Git_not_.22track.22_renames.3F" rel="nofollow noreferrer">in GitFaq "Why does git not "track" renames ?"</a></p> <p>The <code>diff</code> machinery in Git has s... | 119 | git | <h1>In git, can you view the older commits applied to a file after it has been moved?</h1>
<p>After I have moved a file in git (using <code>git mv</code>), looking at the log for that file only shows the commits including and after the move. </p>
<p>Is there any way to view the commits applied to the file under its ol... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,558 | git | # In git, can you view the older commits applied to a file after it has been moved?
After I have moved a file in git (using `git mv`), looking at the log for that file only shows the commits including and after the move.
Is there any way to view the commits applied to the file under its old name? In the example, belo... | '`git-log -M`' will give the commit history with rename information, as mentioned [in GitFaq "Why does git not "track" renames ?"](https://git.wiki.kernel.org/index.php/GitFaq#Why_does_Git_not_.22track.22_renames.3F)
The `diff` machinery in Git has support for automatically detecting renames, this is turned on by the ... |
78096800 | Make `git rebase -i` present and apply commits bottom to top | 15 | 2024-03-03 14:59:46 | <p>Git shows commits in the interactive-rebase todo list (produced by <code>git rebase -i</code>) in the opposite of the usual order: the most ancestral commit (typically, the oldest commit) is shown first, not last.</p>
<p>Can I get it the other way around, for consistency with the usual sort order of <code>git log</c... | 495 | 1,451,346 | 2024-03-17 00:08:23 | 78,169,397 | 16 | 2024-03-15 19:58:27 | 112,968 | 2024-03-17 00:08:23 | https://stackoverflow.com/q/78096800 | https://stackoverflow.com/a/78169397 | <p>You can use a custom <code>sequence.editor</code> config:</p>
<pre><code>git -c sequence.editor='tac "$1" > "$1.reverse" && "$(git config core.editor || echo "${GIT_EDITOR:-${EDITOR:-vi}}")" "$1.reverse" && tac "$1.reverse" > "$1&... | <p>You can use a custom <code>sequence.editor</code> config:</p> <pre><code>git -c sequence.editor='tac "$1" > "$1.reverse" && "$(git config core.editor || echo "${GIT_EDITOR:-${EDITOR:-vi}}")" "$1.reverse" && tac "$1.reverse" > "$1&... | 119, 8974, 84381 | git, git-interactive-rebase, rebase | <h1>Make `git rebase -i` present and apply commits bottom to top</h1>
<p>Git shows commits in the interactive-rebase todo list (produced by <code>git rebase -i</code>) in the opposite of the usual order: the most ancestral commit (typically, the oldest commit) is shown first, not last.</p>
<p>Can I get it the other way... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,559 | git | # Make `git rebase -i` present and apply commits bottom to top
Git shows commits in the interactive-rebase todo list (produced by `git rebase -i`) in the opposite of the usual order: the most ancestral commit (typically, the oldest commit) is shown first, not last.
Can I get it the other way around, for consistency w... | You can use a custom `sequence.editor` config:
```
git -c sequence.editor='tac "$1" > "$1.reverse" && "$(git config core.editor || echo "${GIT_EDITOR:-${EDITOR:-vi}}")" "$1.reverse" && tac "$1.reverse" > "$1"' rebase -i ...
```
It's easy to configure a reusable alias for that and use it:
```
git config alias.revbase... |
57115288 | Meaning of clock icon in VS Code source control | 15 | 2019-07-19 15:11:44 | <p>What does it mean when a blue clock icon is displayed over the VS Code source control icon? When I run the git status command, I get the message: "nothing to commit, working tree clean." I checked the VS Studio documentation, but I couldn't find anything on this topic.</p>
<p><a href="https://i.sstatic.net/yRzPp.pn... | 13,402 | 2,421,837 | 2025-03-09 02:57:47 | 60,894,755 | 16 | 2020-03-27 22:08:30 | 1,320,510 | 2020-03-27 22:08:30 | https://stackoverflow.com/q/57115288 | https://stackoverflow.com/a/60894755 | <ul>
<li>The clock icon is the progress marker, or 'VSCode is still working on
this...' marker. </li>
<li>The designer's expectation is that this would be a
momentary notification, not a long one. </li>
<li>When you open a new directory for
the first time, but do not have a <code>.gitignore</code> set up, this means it... | <ul> <li>The clock icon is the progress marker, or 'VSCode is still working on this...' marker. </li> <li>The designer's expectation is that this would be a momentary notification, not a long one. </li> <li>When you open a new directory for the first time, but do not have a <code>.gitignore</code> set up, this means it... | 119, 111608 | git, visual-studio-code | <h1>Meaning of clock icon in VS Code source control</h1>
<p>What does it mean when a blue clock icon is displayed over the VS Code source control icon? When I run the git status command, I get the message: "nothing to commit, working tree clean." I checked the VS Studio documentation, but I couldn't find anything on th... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,560 | git | # Meaning of clock icon in VS Code source control
What does it mean when a blue clock icon is displayed over the VS Code source control icon? When I run the git status command, I get the message: "nothing to commit, working tree clean." I checked the VS Studio documentation, but I couldn't find anything on this topic.... | - The clock icon is the progress marker, or 'VSCode is still working on
this...' marker.
- The designer's expectation is that this would be a
momentary notification, not a long one.
- When you open a new directory for
the first time, but do not have a `.gitignore` set up, this means it
wants to slurp your `node... |
48165922 | why moved code is not colored in git diff? | 15 | 2018-01-09 10:16:54 | <p>I install latest git and configure it to highlight moved code:</p>
<pre><code>$ git config diff.colormoved default
</code></pre>
<p>Here is how it looks when code is moved (see 1->2)
<a href="https://i.sstatic.net/y3wJJ.jpg" rel="noreferrer"><img src="https://i.sstatic.net/y3wJJ.jpg" alt="enter image description h... | 4,189 | 4,632,019 | 2024-08-10 19:10:57 | 48,166,435 | 16 | 2018-01-09 10:46:16 | 707,111 | 2018-01-09 10:46:16 | https://stackoverflow.com/q/48165922 | https://stackoverflow.com/a/48166435 | <p>See the documentation for <code>--color-moved</code>/<code>colormoved</code> in git-diff(1):</p>
<blockquote>
<p><code>--color-moved[=<mode>]</code></p>
<p>Moved lines of code are colored differently. It can be changed by the <code>diff.colorMoved</code> configuration setting. The <code><mode></c... | <p>See the documentation for <code>--color-moved</code>/<code>colormoved</code> in git-diff(1):</p> <blockquote> <p><code>--color-moved[=<mode>]</code></p> <p>Moved lines of code are colored differently. It can be changed by the <code>diff.colorMoved</code> configuration setting. The <code><mode></c... | 119, 9033 | git, git-diff | <h1>why moved code is not colored in git diff?</h1>
<p>I install latest git and configure it to highlight moved code:</p>
<pre><code>$ git config diff.colormoved default
</code></pre>
<p>Here is how it looks when code is moved (see 1->2)
<a href="https://i.sstatic.net/y3wJJ.jpg" rel="noreferrer"><img src="https://i.s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,561 | git | # why moved code is not colored in git diff?
I install latest git and configure it to highlight moved code:
```
$ git config diff.colormoved default
```
Here is how it looks when code is moved (see 1->2)
[](https://i.sstatic.net/y3wJJ.jpg)
But 3-4 is n... | See the documentation for `--color-moved`/`colormoved` in git-diff(1):
> `--color-moved[=<mode>]`
>
> Moved lines of code are colored differently. It can be changed by the `diff.colorMoved` configuration setting. The `<mode>` defaults to `no` if the option is not given and to `zebra` if the option with no mode is give... |
42295050 | Difference between -C and --git-dir when manipulating repo in git hook | 15 | 2017-02-17 10:07:19 | <p>I am writing a git post-receive hook that will clone a separate repo as part of a deployment. It clones the repo to a certain folder and uses the <code>-C</code> option in subsequent git commands to set the directory to that of the checked out repo (as documented in the <a href="https://www.kernel.org/pub/software/s... | 19,636 | 692,410 | 2024-03-14 11:33:15 | 42,299,983 | 16 | 2017-02-17 14:10:16 | 1,256,452 | 2017-02-17 14:10:16 | https://stackoverflow.com/q/42295050 | https://stackoverflow.com/a/42299983 | <p>The literal difference between:</p>
<p><code>git -C <em>directory git-sub-command ...</em></code></p>
<p>and:</p>
<p><code>git --git-dir <em>directory git-sub-command ...</em></code></p>
<p>is that the front end setup program <code>git</code> uses an OS-level "change directory to" operation (<code>os.chdir</code... | <p>The literal difference between:</p> <p><code>git -C <em>directory git-sub-command ...</em></code></p> <p>and:</p> <p><code>git --git-dir <em>directory git-sub-command ...</em></code></p> <p>is that the front end setup program <code>git</code> uses an OS-level "change directory to" operation (<code>os.chdir</code... | 119, 43087 | git, githooks | <h1>Difference between -C and --git-dir when manipulating repo in git hook</h1>
<p>I am writing a git post-receive hook that will clone a separate repo as part of a deployment. It clones the repo to a certain folder and uses the <code>-C</code> option in subsequent git commands to set the directory to that of the check... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,563 | git | # Difference between -C and --git-dir when manipulating repo in git hook
I am writing a git post-receive hook that will clone a separate repo as part of a deployment. It clones the repo to a certain folder and uses the `-C` option in subsequent git commands to set the directory to that of the checked out repo (as docu... | The literal difference between:
`git -C directory git-sub-command ...`
and:
`git --git-dir directory git-sub-command ...`
is that the front end setup program `git` uses an OS-level "change directory to" operation (`os.chdir` from Python, `chdir()` from C, etc) for the first, and sets an environment variable `$GIT_D... |
13339027 | git am should ignore something in commit message startswith "[]"? | 15 | 2012-11-12 06:00:10 | <p>I have a commit with message like <code>[Hello World]Something.</code><br>
Then I use git format-patch HEAD~1 to crate a patch.<br>
Content of patch like this:<br></p>
<pre><code>Subject: [PATCH 1/7] [Hello World] Something.
</code></pre>
<p>But after I use git am to apply patch,the commit message became "Somethin... | 2,592 | 1,526,686 | 2024-09-21 11:35:37 | 13,339,190 | 16 | 2012-11-12 06:22:38 | 1,507,392 | 2012-11-12 06:22:38 | https://stackoverflow.com/q/13339027 | https://stackoverflow.com/a/13339190 | <p><code>git am -k</code> would prevent it from removing content in <code>[]</code> brackets at the beginning of the subject, but that would also keep the <code>[PATCH 1/7]</code> portion. <code>git format-patch</code> also has a <code>-k</code> option which would prevent it from adding that type of content allowing t... | <p><code>git am -k</code> would prevent it from removing content in <code>[]</code> brackets at the beginning of the subject, but that would also keep the <code>[PATCH 1/7]</code> portion. <code>git format-patch</code> also has a <code>-k</code> option which would prevent it from adding that type of content allowing t... | 119, 84451 | git, git-am | <h1>git am should ignore something in commit message startswith "[]"?</h1>
<p>I have a commit with message like <code>[Hello World]Something.</code><br>
Then I use git format-patch HEAD~1 to crate a patch.<br>
Content of patch like this:<br></p>
<pre><code>Subject: [PATCH 1/7] [Hello World] Something.
</code></pre>
<... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,568 | git | # git am should ignore something in commit message startswith "[]"?
I have a commit with message like `[Hello World]Something.`
Then I use git format-patch HEAD~1 to crate a patch.
Content of patch like this:
```
Subject: [PATCH 1/7] [Hello World] Something.
```
But after I use git am to apply patch,the commit m... | `git am -k` would prevent it from removing content in `[]` brackets at the beginning of the subject, but that would also keep the `[PATCH 1/7]` portion. `git format-patch` also has a `-k` option which would prevent it from adding that type of content allowing the subject to be preserved through a `git format-patch | gi... |
10944972 | Split git branch into separate repo | 15 | 2012-06-08 07:49:47 | <p>I have the following git tree :</p>
<pre><code>branch v2 => / --- [lots of work] --- [new version] --- ref_d
/
root --- ref_a --- ... --- ref_b (project reset)
\
branch v1 => \ --- [some works] --- ref_c
</code></pre>
<p>As v1 and v2 are reall... | 5,647 | 1,443,936 | 2019-10-08 16:01:01 | 10,945,013 | 16 | 2012-06-08 07:52:56 | 148,870 | 2012-06-08 07:52:56 | https://stackoverflow.com/q/10944972 | https://stackoverflow.com/a/10945013 | <p>The following assumes you have your two separate new repos set up as remotes named <code>repo_v1</code> and <code>repo_v2</code>.</p>
<p>The v1 branch is easy:</p>
<pre><code>git push repo_v1 ref_c:v1
</code></pre>
<p>The v2 branch isn't that hard:</p>
<pre><code>git checkout --orphan v2 ref_b
git cherry-pick re... | <p>The following assumes you have your two separate new repos set up as remotes named <code>repo_v1</code> and <code>repo_v2</code>.</p> <p>The v1 branch is easy:</p> <pre><code>git push repo_v1 ref_c:v1 </code></pre> <p>The v2 branch isn't that hard:</p> <pre><code>git checkout --orphan v2 ref_b git cherry-pick re... | 119 | git | <h1>Split git branch into separate repo</h1>
<p>I have the following git tree :</p>
<pre><code>branch v2 => / --- [lots of work] --- [new version] --- ref_d
/
root --- ref_a --- ... --- ref_b (project reset)
\
branch v1 => \ --- [some works] --- r... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,569 | git | # Split git branch into separate repo
I have the following git tree :
```
branch v2 => / --- [lots of work] --- [new version] --- ref_d
/
root --- ref_a --- ... --- ref_b (project reset)
\
branch v1 => \ --- [some works] --- ref_c
```
As v1 and v2 are... | The following assumes you have your two separate new repos set up as remotes named `repo_v1` and `repo_v2`.
The v1 branch is easy:
```
git push repo_v1 ref_c:v1
```
The v2 branch isn't that hard:
```
git checkout --orphan v2 ref_b
git cherry-pick ref_b..ref_d
git push repo_v2 v2
```
(`git checkout --orphan <branch... |
23870374 | Nodegit: How to modify a file and push the changes? | 14 | 2014-05-26 12:39:22 | <p>Looked around for an example, but couldn't find one. The documentation is not explained and I could not figure it out.</p>
<p>How to modify a file (README.md for example), create a commit for the modified file and then push the commit to the server ?</p>
<p>Nodegit: <a href="http://www.nodegit.org/">http://www.nod... | 10,475 | null | 2018-03-01 21:54:14 | 28,890,806 | 16 | 2015-03-06 01:14:03 | 1,539,658 | 2018-03-01 21:54:14 | https://stackoverflow.com/q/23870374 | https://stackoverflow.com/a/28890806 | <p>There is an example of how to create/add and commit on their repo, which can help you with the modifying the file.</p>
<p><a href="https://github.com/nodegit/nodegit/blob/master/examples/add-and-commit.js" rel="nofollow noreferrer">https://github.com/nodegit/nodegit/blob/master/examples/add-and-commit.js</a></p>
<... | <p>There is an example of how to create/add and commit on their repo, which can help you with the modifying the file.</p> <p><a href="https://github.com/nodegit/nodegit/blob/master/examples/add-and-commit.js" rel="nofollow noreferrer">https://github.com/nodegit/nodegit/blob/master/examples/add-and-commit.js</a></p> <... | 3, 119, 46426, 106682 | git, javascript, node.js, nodegit | <h1>Nodegit: How to modify a file and push the changes?</h1>
<p>Looked around for an example, but couldn't find one. The documentation is not explained and I could not figure it out.</p>
<p>How to modify a file (README.md for example), create a commit for the modified file and then push the commit to the server ?</p>
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,574 | git | # Nodegit: How to modify a file and push the changes?
Looked around for an example, but couldn't find one. The documentation is not explained and I could not figure it out.
How to modify a file (README.md for example), create a commit for the modified file and then push the commit to the server ?
Nodegit: <http://ww... | There is an example of how to create/add and commit on their repo, which can help you with the modifying the file.
<https://github.com/nodegit/nodegit/blob/master/examples/add-and-commit.js>
Regarding the commit and push, here is the snippet of how my code looks like and i hope it helps you a bit. It took me quite a ... |
18464333 | Git checkout delete files in gitignore | 14 | 2013-08-27 11:38:26 | <p>I accidentally tracked workspace configuration files in a git repo. Trying to fix the problem, I <code>git rm --cached</code> those files and added them to <code>.gitignore</code> file.</p>
<p>Now every time I checkout a branch from the repo, those get deleted. Is there any way to avoid this?</p>
| 5,954 | 2,389,942 | 2013-09-19 15:10:52 | 18,465,526 | 16 | 2013-08-27 12:31:44 | 321,973 | 2013-08-28 06:17:35 | https://stackoverflow.com/q/18464333 | https://stackoverflow.com/a/18465526 | <p>The problem is the <code>git rm</code> commit being present in some branches but not all, which means that when you switch from one branch still containing the files to one where you <code>git rm</code>'ed git will <em>correctly</em> remove the files. What you actually want to do is remove the files from git's histo... | <p>The problem is the <code>git rm</code> commit being present in some branches but not all, which means that when you switch from one branch still containing the files to one where you <code>git rm</code>'ed git will <em>correctly</em> remove the files. What you actually want to do is remove the files from git's histo... | 119 | git | <h1>Git checkout delete files in gitignore</h1>
<p>I accidentally tracked workspace configuration files in a git repo. Trying to fix the problem, I <code>git rm --cached</code> those files and added them to <code>.gitignore</code> file.</p>
<p>Now every time I checkout a branch from the repo, those get deleted. Is the... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,575 | git | # Git checkout delete files in gitignore
I accidentally tracked workspace configuration files in a git repo. Trying to fix the problem, I `git rm --cached` those files and added them to `.gitignore` file.
Now every time I checkout a branch from the repo, those get deleted. Is there any way to avoid this? | The problem is the `git rm` commit being present in some branches but not all, which means that when you switch from one branch still containing the files to one where you `git rm`'ed git will *correctly* remove the files. What you actually want to do is remove the files from git's history as if they have never been th... |
15822544 | JGit: How to get all commits of a branch? (Without changes to the working directory ...) | 14 | 2013-04-04 22:03:02 | <p>how do I get all commits of a branch with JGit, without changing the working directory?</p>
<p>Unfortunately the JGit docs are not very good ...</p>
<p>In ruby with grit it is very easy:</p>
<pre><code>repo = Grit::Repo.new(pathToRepo)
repo.commits(branchName, false).each do |commit|
doSomethingWithTheCommit... | 23,267 | 2,246,865 | 2018-02-21 19:31:39 | 15,844,693 | 16 | 2013-04-05 22:32:20 | 2,246,865 | 2018-02-21 19:31:39 | https://stackoverflow.com/q/15822544 | https://stackoverflow.com/a/15844693 | <p>Tried this here first: <a href="https://stackoverflow.com/a/13925765/2246865">https://stackoverflow.com/a/13925765/2246865</a></p>
<p>But it wasn't was working always, so I found this here: <a href="http://www.eclipse.org/forums/index.php/t/280339/" rel="noreferrer">http://www.eclipse.org/forums/index.php/t/280339/... | <p>Tried this here first: <a href="https://stackoverflow.com/a/13925765/2246865">https://stackoverflow.com/a/13925765/2246865</a></p> <p>But it wasn't was working always, so I found this here: <a href="http://www.eclipse.org/forums/index.php/t/280339/" rel="noreferrer">http://www.eclipse.org/forums/index.php/t/280339/... | 17, 61058 | java, jgit | <h1>JGit: How to get all commits of a branch? (Without changes to the working directory ...)</h1>
<p>how do I get all commits of a branch with JGit, without changing the working directory?</p>
<p>Unfortunately the JGit docs are not very good ...</p>
<p>In ruby with grit it is very easy:</p>
<pre><code>repo = Grit::R... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,576 | git | # JGit: How to get all commits of a branch? (Without changes to the working directory ...)
how do I get all commits of a branch with JGit, without changing the working directory?
Unfortunately the JGit docs are not very good ...
In ruby with grit it is very easy:
```
repo = Grit::Repo.new(pathToRepo)
repo.commits(... | Tried this here first: <https://stackoverflow.com/a/13925765/2246865>
But it wasn't was working always, so I found this here: <http://www.eclipse.org/forums/index.php/t/280339/>
Here my solution, it isn't really nice, but it's working ...
```
public static void main(String[] args) throws IOException, GitAPIException... |
4623952 | GIT: Adding Local Changes to Non-Current Branch | 14 | 2011-01-07 09:05:24 | <p>It usually happens to me that I make some local changes, only to discover that I made it on the wrong branch, so I need to switch branch before committing. The problem is that I cannot switch branch when there are local changes. Is there anyway to do that?</p>
<p>Obviously, I can copy the updated files, switch bran... | 2,249 | 196,697 | 2011-01-07 11:33:13 | 4,623,984 | 16 | 2011-01-07 09:12:07 | 19,563 | 2011-01-07 09:12:07 | https://stackoverflow.com/q/4623952 | https://stackoverflow.com/a/4623984 | <p>You can switch branches while you have local modifications unless your local changes conflict with the difference between the two branches. In this case you can use the <code>-m</code> or <code>--merge</code> option to <code>checkout</code> to perform the checkout anyway and perform a merge betwee changes and the ch... | <p>You can switch branches while you have local modifications unless your local changes conflict with the difference between the two branches. In this case you can use the <code>-m</code> or <code>--merge</code> option to <code>checkout</code> to perform the checkout anyway and perform a merge betwee changes and the ch... | 119, 76220 | git, git-branch | <h1>GIT: Adding Local Changes to Non-Current Branch</h1>
<p>It usually happens to me that I make some local changes, only to discover that I made it on the wrong branch, so I need to switch branch before committing. The problem is that I cannot switch branch when there are local changes. Is there anyway to do that?</p>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,578 | git | # GIT: Adding Local Changes to Non-Current Branch
It usually happens to me that I make some local changes, only to discover that I made it on the wrong branch, so I need to switch branch before committing. The problem is that I cannot switch branch when there are local changes. Is there anyway to do that?
Obviously, ... | You can switch branches while you have local modifications unless your local changes conflict with the difference between the two branches. In this case you can use the `-m` or `--merge` option to `checkout` to perform the checkout anyway and perform a merge betwee changes and the changes caused by switching branches.
... |
3363679 | Compare and Edit Branches in Git with a Mergetool | 14 | 2010-07-29 14:41:52 | <p>I have 2 branches that I can compare/diff using my difftool (Beyond Compare).
However, the files used for the diff are temporary copies and not the actual files from the current branch.
This means that if I want to make a change to an existing file, I cannot do it via the difftool. I would need to make a copy of the... | 5,856 | 135,862 | 2015-01-30 11:30:36 | 3,366,149 | 16 | 2010-07-29 19:17:15 | 135,862 | 2015-01-30 11:30:26 | https://stackoverflow.com/q/3363679 | https://stackoverflow.com/a/3366149 | <p>The command <code>git difftool branch</code> works as desired, with one "side" as the currently checked-out branch.</p>
| <p>The command <code>git difftool branch</code> works as desired, with one "side" as the currently checked-out branch.</p> | 119, 606, 1879, 15129, 33608 | beyondcompare, branch, diff, difftool, git | <h1>Compare and Edit Branches in Git with a Mergetool</h1>
<p>I have 2 branches that I can compare/diff using my difftool (Beyond Compare).
However, the files used for the diff are temporary copies and not the actual files from the current branch.
This means that if I want to make a change to an existing file, I cannot... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,579 | git | # Compare and Edit Branches in Git with a Mergetool
I have 2 branches that I can compare/diff using my difftool (Beyond Compare).
However, the files used for the diff are temporary copies and not the actual files from the current branch.
This means that if I want to make a change to an existing file, I cannot do it vi... | The command `git difftool branch` works as desired, with one "side" as the currently checked-out branch. |
632724 | svn to git conversion | 14 | 2009-03-10 23:44:28 | <p>I am trying to convert a SourceForge project from Subversion to Git. According to some Googling, it should be possible to use this command:</p>
<pre><code>git svn clone http://PROJECT.svn.sourceforge.net/ PROJECT.git
</code></pre>
<p>Where <code>PROJECT</code> is the project name at SourceForge, to get a SVN proje... | 6,141 | 11,722 | 2016-03-06 21:39:04 | 632,807 | 16 | 2009-03-11 00:17:05 | 1,612 | 2009-03-11 00:17:05 | https://stackoverflow.com/q/632724 | https://stackoverflow.com/a/632807 | <p>From a <a href="http://sourceforge.net/scm/?type=svn&group_id=234930" rel="noreferrer">svn project page</a> it looks like you are using the wrong URL - try:</p>
<pre><code>git svn clone http://PROJECT.svn.sourceforge.net/svnroot/PROJECT PROJECT.git
</code></pre>
<p>I just successfully checked one out (with git... | <p>From a <a href="http://sourceforge.net/scm/?type=svn&group_id=234930" rel="noreferrer">svn project page</a> it looks like you are using the wrong URL - try:</p> <pre><code>git svn clone http://PROJECT.svn.sourceforge.net/svnroot/PROJECT PROJECT.git </code></pre> <p>I just successfully checked one out (with git... | 63, 119, 549, 6452 | git, git-svn, svn, ubuntu | <h1>svn to git conversion</h1>
<p>I am trying to convert a SourceForge project from Subversion to Git. According to some Googling, it should be possible to use this command:</p>
<pre><code>git svn clone http://PROJECT.svn.sourceforge.net/ PROJECT.git
</code></pre>
<p>Where <code>PROJECT</code> is the project name at ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,580 | git | # svn to git conversion
I am trying to convert a SourceForge project from Subversion to Git. According to some Googling, it should be possible to use this command:
```
git svn clone http://PROJECT.svn.sourceforge.net/ PROJECT.git
```
Where `PROJECT` is the project name at SourceForge, to get a SVN project checked ou... | From a [svn project page](http://sourceforge.net/scm/?type=svn&group_id=234930) it looks like you are using the wrong URL - try:
```
git svn clone http://PROJECT.svn.sourceforge.net/svnroot/PROJECT PROJECT.git
```
I just successfully checked one out (with git 1.6.2 on OS X 10.5) with:
```
git svn clone http://javaau... |
70988396 | How to update git submodule to a specific commit? | 13 | 2022-02-04 14:54:02 | <pre><code>git submodule update --remote
</code></pre>
<p>Above command updates the submodule to latest commit however I want to update to a specific commit (e.g. to some commit hash). How to achieve that ?</p>
| 32,073 | 8,677,806 | 2022-02-06 10:12:21 | 71,006,089 | 16 | 2022-02-06 10:12:21 | 17,478,317 | 2022-02-06 10:12:21 | https://stackoverflow.com/q/70988396 | https://stackoverflow.com/a/71006089 | <p><code>git</code> submodules are repositories inside a repository, hence it has the same behavior as any other <code>git</code> repository. Hence enter the dependency root by using <code>cd submodule</code> and use any git command.</p>
<pre><code>cd submodule
git checkout -b NEW_BRANCH_NAME COMMIT_ID
</code></pre>
| <p><code>git</code> submodules are repositories inside a repository, hence it has the same behavior as any other <code>git</code> repository. Hence enter the dependency root by using <code>cd submodule</code> and use any git command.</p> <pre><code>cd submodule git checkout -b NEW_BRANCH_NAME COMMIT_ID </code></pre> | 119, 41612 | git, git-submodules | <h1>How to update git submodule to a specific commit?</h1>
<pre><code>git submodule update --remote
</code></pre>
<p>Above command updates the submodule to latest commit however I want to update to a specific commit (e.g. to some commit hash). How to achieve that ?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,581 | git | # How to update git submodule to a specific commit?
```
git submodule update --remote
```
Above command updates the submodule to latest commit however I want to update to a specific commit (e.g. to some commit hash). How to achieve that ? | `git` submodules are repositories inside a repository, hence it has the same behavior as any other `git` repository. Hence enter the dependency root by using `cd submodule` and use any git command.
```
cd submodule
git checkout -b NEW_BRANCH_NAME COMMIT_ID
``` |
56799689 | Add a hash/pound symbol as the first character in a git commit message in vim | 13 | 2019-06-28 00:20:31 | <p>GitHub (probably, wrongly) uses <code>#</code>'s when referring to GitHub issues. So I would like to add a commit message that refers to the issue on the first line.</p>
<p>e.g.</p>
<pre class="lang-sh prettyprint-override"><code>#12: New commit
- Did a thing
- Did another thing
</code></pre>
<p>Vim/git ignores ... | 2,924 | 3,912,417 | 2025-01-21 11:42:39 | 56,799,730 | 16 | 2019-06-28 00:29:43 | 3,912,417 | 2019-06-28 00:29:43 | https://stackoverflow.com/q/56799689 | https://stackoverflow.com/a/56799730 | <p>Git allows you to update the comment char from the <code>#</code> symbol to any other. Then you can use the <code>#</code> symbol.</p>
<p>e.g.</p>
<pre class="lang-sh prettyprint-override"><code>git config core.commentChar '>'
</code></pre>
<p>or optionally set it globally</p>
<pre class="lang-sh prettyprint-... | <p>Git allows you to update the comment char from the <code>#</code> symbol to any other. Then you can use the <code>#</code> symbol.</p> <p>e.g.</p> <pre class="lang-sh prettyprint-override"><code>git config core.commentChar '>' </code></pre> <p>or optionally set it globally</p> <pre class="lang-sh prettyprint-... | 119, 370 | git, vim | <h1>Add a hash/pound symbol as the first character in a git commit message in vim</h1>
<p>GitHub (probably, wrongly) uses <code>#</code>'s when referring to GitHub issues. So I would like to add a commit message that refers to the issue on the first line.</p>
<p>e.g.</p>
<pre class="lang-sh prettyprint-override"><cod... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,583 | git | # Add a hash/pound symbol as the first character in a git commit message in vim
GitHub (probably, wrongly) uses `#`'s when referring to GitHub issues. So I would like to add a commit message that refers to the issue on the first line.
e.g.
```
#12: New commit
- Did a thing
- Did another thing
```
Vim/git ignores l... | Git allows you to update the comment char from the `#` symbol to any other. Then you can use the `#` symbol.
e.g.
```
git config core.commentChar '>'
```
or optionally set it globally
```
git config --global core.commentchar '>'
``` |
51713876 | Git help to understand merge-base conflicts | 13 | 2018-08-06 18:46:36 | <p>I am getting conflicts on files I have not modified. Conflicts on files with one line changes when merging. I am starting to get a handle on what might be happening but still unable to resolve the problem. </p>
<p>Here is the branch structure. </p>
<ul>
<li>master
<ul>
<li>current_iteration
<ul>
<li>mapr_autoin... | 3,527 | 1,342,154 | 2018-08-09 18:23:27 | 51,716,590 | 16 | 2018-08-06 22:47:01 | 1,256,452 | 2018-08-06 22:47:01 | https://stackoverflow.com/q/51713876 | https://stackoverflow.com/a/51716590 | <p>I've never found <code>git show-branch</code> output very useful myself and I am not sure how it is intended to be used, nor how others might use it successfully.</p>
<blockquote>
<p>Also is it possible that I could stop tracking master ...</p>
</blockquote>
<p>This irrelevant. What matters is the actual commit... | <p>I've never found <code>git show-branch</code> output very useful myself and I am not sure how it is intended to be used, nor how others might use it successfully.</p> <blockquote> <p>Also is it possible that I could stop tracking master ...</p> </blockquote> <p>This irrelevant. What matters is the actual commit... | 119, 717, 28897 | git, git-merge, merge | <h1>Git help to understand merge-base conflicts</h1>
<p>I am getting conflicts on files I have not modified. Conflicts on files with one line changes when merging. I am starting to get a handle on what might be happening but still unable to resolve the problem. </p>
<p>Here is the branch structure. </p>
<ul>
<li>mast... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,584 | git | # Git help to understand merge-base conflicts
I am getting conflicts on files I have not modified. Conflicts on files with one line changes when merging. I am starting to get a handle on what might be happening but still unable to resolve the problem.
Here is the branch structure.
- master
- current_iteration
... | I've never found `git show-branch` output very useful myself and I am not sure how it is intended to be used, nor how others might use it successfully.
> Also is it possible that I could stop tracking master ...
This irrelevant. What matters is the actual commit graph. The upstream of any branch is independent of the... |
49571664 | VSTS build from multiple repositories | 13 | 2018-03-30 09:16:27 | <p>I have two repositories - one in TFVC and another in Git. There are specific technical reasons for keeping them separate.</p>
<p>The code in TFVC is built on a private build agent and the code in Git is built on a hosted agent. So currently I have two independent builds and the outcomes of them are deployed togethe... | 8,576 | 118,500 | 2019-10-31 11:35:26 | 49,571,939 | 16 | 2018-03-30 09:35:11 | 6,936,103 | 2019-09-20 06:09:23 | https://stackoverflow.com/q/49571664 | https://stackoverflow.com/a/49571939 | <p>For now, there is no way to specify multiple repositories in Get sources step.
And there has an user voice <a href="https://developercommunity.visualstudio.com/idea/365522/allow-tfs-build-to-depend-on-multiple-repositories.html" rel="nofollow noreferrer">Allow TFS build to depend on multiple repositories</a> which s... | <p>For now, there is no way to specify multiple repositories in Get sources step. And there has an user voice <a href="https://developercommunity.visualstudio.com/idea/365522/allow-tfs-build-to-depend-on-multiple-repositories.html" rel="nofollow noreferrer">Allow TFS build to depend on multiple repositories</a> which s... | 119, 104161, 116537, 119596 | azure-devops, azure-pipelines, git, tfvc | <h1>VSTS build from multiple repositories</h1>
<p>I have two repositories - one in TFVC and another in Git. There are specific technical reasons for keeping them separate.</p>
<p>The code in TFVC is built on a private build agent and the code in Git is built on a hosted agent. So currently I have two independent build... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,585 | git | # VSTS build from multiple repositories
I have two repositories - one in TFVC and another in Git. There are specific technical reasons for keeping them separate.
The code in TFVC is built on a private build agent and the code in Git is built on a hosted agent. So currently I have two independent builds and the outcom... | For now, there is no way to specify multiple repositories in Get sources step.
And there has an user voice [Allow TFS build to depend on multiple repositories](https://developercommunity.visualstudio.com/idea/365522/allow-tfs-build-to-depend-on-multiple-repositories.html) which suggests similar feature, you can vote an... |
39096500 | git `merge --squash` does not add "Merge" header to commit | 13 | 2016-08-23 08:48:43 | <p>I was wondering how all the tools know what branches/commits are merged until I found a "Merge" header in the commit.</p>
<p>My question is: why a <code>git merge --squash</code> does not add that header, while <code>git merge</code> does?</p>
<p>In other words: why do I see a merge edge when merging with <code>gi... | 4,375 | 4,469,738 | 2016-08-24 20:45:39 | 39,111,939 | 16 | 2016-08-23 22:55:29 | 1,256,452 | 2016-08-24 20:45:39 | https://stackoverflow.com/q/39096500 | https://stackoverflow.com/a/39111939 | <h3>TL;DR: <code>git merge --squash</code> merges (verb), but does not make a merge (noun).</h3>
<p>The "merge header" you mention is not in the commits in that form. Instead, it's just something that <code>git log</code> prints when it comes across a <em>merge commit</em>. To really cement this idea, let's look at ... | <h3>TL;DR: <code>git merge --squash</code> merges (verb), but does not make a merge (noun).</h3> <p>The "merge header" you mention is not in the commits in that form. Instead, it's just something that <code>git log</code> prints when it comes across a <em>merge commit</em>. To really cement this idea, let's look at ... | 119, 717 | git, merge | <h1>git `merge --squash` does not add "Merge" header to commit</h1>
<p>I was wondering how all the tools know what branches/commits are merged until I found a "Merge" header in the commit.</p>
<p>My question is: why a <code>git merge --squash</code> does not add that header, while <code>git merge</code> does?</p>
<p>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,586 | git | # git `merge --squash` does not add "Merge" header to commit
I was wondering how all the tools know what branches/commits are merged until I found a "Merge" header in the commit.
My question is: why a `git merge --squash` does not add that header, while `git merge` does?
In other words: why do I see a merge edge whe... | ### TL;DR: `git merge --squash` merges (verb), but does not make a merge (noun).
The "merge header" you mention is not in the commits in that form. Instead, it's just something that `git log` prints when it comes across a *merge commit*. To really cement this idea, let's look at what merging *does*—what "to merge" mea... |
34874343 | How can I uniquely identify a git repository | 13 | 2016-01-19 10:27:54 | <p>I would like to create a tool that checks if I already have a local clone of a remote repository before cloning said repository. To do this, I need a way of testing if B is the same as repository A -- by which I guess i mean they have mergeable histories. B might be named differently than A, and might have addi... | 10,523 | 2,050,788 | 2019-10-07 20:15:39 | 34,874,932 | 16 | 2016-01-19 10:55:02 | 2,082,964 | 2016-08-09 12:51:33 | https://stackoverflow.com/q/34874343 | https://stackoverflow.com/a/34874932 | <p>As you can see in the related question; there is NO unique identification for a git repository. However; you could just compare the <strong>SHA-1 of the first commit on the master branch</strong>; that should suffice in 99.999% of all cases (supposing that the first commit will never be changed).</p>
<p>And if you ... | <p>As you can see in the related question; there is NO unique identification for a git repository. However; you could just compare the <strong>SHA-1 of the first commit on the master branch</strong>; that should suffice in 99.999% of all cases (supposing that the first commit will never be changed).</p> <p>And if you ... | 119, 946, 11342 | git, uniqueidentifier, uuid | <h1>How can I uniquely identify a git repository</h1>
<p>I would like to create a tool that checks if I already have a local clone of a remote repository before cloning said repository. To do this, I need a way of testing if B is the same as repository A -- by which I guess i mean they have mergeable histories. B ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,587 | git | # How can I uniquely identify a git repository
I would like to create a tool that checks if I already have a local clone of a remote repository before cloning said repository. To do this, I need a way of testing if B is the same as repository A -- by which I guess i mean they have mergeable histories. B might be named... | As you can see in the related question; there is NO unique identification for a git repository. However; you could just compare the **SHA-1 of the first commit on the master branch**; that should suffice in 99.999% of all cases (supposing that the first commit will never be changed).
And if you want to be even more su... |
31932580 | Is there a place to get the laravel `vendor` folder in one spot? | 13 | 2015-08-11 03:10:16 | <p>I realize that this is what composer is used for, but I don't particularly like it. It makes sense, but it annoys me that laravel5's github doesn't work out of the box because it's <code>vendor</code> directory is somewhat large and isn't necessarily laravel5, although laravel does require it. </p>
<p>It also puzzl... | 27,274 | 3,049,865 | 2015-08-11 06:54:27 | 31,935,081 | 16 | 2015-08-11 06:54:27 | 5,210,497 | 2015-08-11 06:54:27 | https://stackoverflow.com/q/31932580 | https://stackoverflow.com/a/31935081 | <ol>
<li>Install Composer on your OS using this command
<code>curl -sS https://getcomposer.org/installer | php</code>.</li>
<li>Move the <strong>composer.phar</strong> file to /usr/local/bin/ with this command
<code>mv composer.phar /usr/local/bin/composer</code>. This will enable you to access composer globally.</li>... | <ol> <li>Install Composer on your OS using this command <code>curl -sS https://getcomposer.org/installer | php</code>.</li> <li>Move the <strong>composer.phar</strong> file to /usr/local/bin/ with this command <code>mv composer.phar /usr/local/bin/composer</code>. This will enable you to access composer globally.</li>... | 5, 119, 17562, 75151 | git, laravel, php, vendors | <h1>Is there a place to get the laravel `vendor` folder in one spot?</h1>
<p>I realize that this is what composer is used for, but I don't particularly like it. It makes sense, but it annoys me that laravel5's github doesn't work out of the box because it's <code>vendor</code> directory is somewhat large and isn't nece... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,588 | git | # Is there a place to get the laravel `vendor` folder in one spot?
I realize that this is what composer is used for, but I don't particularly like it. It makes sense, but it annoys me that laravel5's github doesn't work out of the box because it's `vendor` directory is somewhat large and isn't necessarily laravel5, al... | 1. Install Composer on your OS using this command
`curl -sS https://getcomposer.org/installer | php`.
2. Move the **composer.phar** file to /usr/local/bin/ with this command
`mv composer.phar /usr/local/bin/composer`. This will enable you to access composer globally.
3. `git clone` your project.
4. Make a **vendo... |
25986927 | Update git branch with master without merge | 13 | 2014-09-23 04:29:27 | <p>I am the sole developer working on a fairly big project. I made several important changes in <code>master</code> and I'm about to resume working on a <code>feature</code> branch that has fallen behind a good deal. The <code>feature</code> branch really does need the changes from <code>master</code> but I do not want... | 20,729 | 279,608 | 2014-09-23 05:22:15 | 25,987,261 | 16 | 2014-09-23 05:05:10 | 1,672,128 | 2014-09-23 05:05:10 | https://stackoverflow.com/q/25986927 | https://stackoverflow.com/a/25987261 | <p>Since your remote <code>feature</code> branch exists simply for safe-keeping purpose and has not been shared with anyone else, it is certainly safe to delete the branch or force-push to it. You can rebase your current work at branch <code>feature</code> on <code>master</code>, and continue working on it:</p>
<pre><... | <p>Since your remote <code>feature</code> branch exists simply for safe-keeping purpose and has not been shared with anyone else, it is certainly safe to delete the branch or force-push to it. You can rebase your current work at branch <code>feature</code> on <code>master</code>, and continue working on it:</p> <pre><... | 119, 29934 | git, git-rebase | <h1>Update git branch with master without merge</h1>
<p>I am the sole developer working on a fairly big project. I made several important changes in <code>master</code> and I'm about to resume working on a <code>feature</code> branch that has fallen behind a good deal. The <code>feature</code> branch really does need t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,590 | git | # Update git branch with master without merge
I am the sole developer working on a fairly big project. I made several important changes in `master` and I'm about to resume working on a `feature` branch that has fallen behind a good deal. The `feature` branch really does need the changes from `master` but I do not want... | Since your remote `feature` branch exists simply for safe-keeping purpose and has not been shared with anyone else, it is certainly safe to delete the branch or force-push to it. You can rebase your current work at branch `feature` on `master`, and continue working on it:
```
# while staying at feature branch
git reba... |
24383813 | Remove an unwanted merge commit and rebase instead with Git | 13 | 2014-06-24 10:06:06 | <p>I have a feature branch off develop. I started using the practice of rebasing my feature branch with develop instead of merging as the benefits of a linear commit history was appropriate for my project which had a few upstream and downstream repositories.</p>
<p>I'm in the situation where someone merged develop int... | 5,591 | 3,406,268 | 2014-06-24 18:06:24 | 24,393,326 | 16 | 2014-06-24 18:00:43 | null | 2014-06-24 18:00:43 | https://stackoverflow.com/q/24383813 | https://stackoverflow.com/a/24393326 | <p>As torek points out <a href="https://stackoverflow.com/questions/24383813/git-remove-an-unwanted-merge-commit-and-rebase-instead#comment37713303_24383813">in the comments</a>, there is more than one way to do this in Git. Say, for example, that you have a commit graph like this:</p>
<pre><code>develop *-------*
... | <p>As torek points out <a href="https://stackoverflow.com/questions/24383813/git-remove-an-unwanted-merge-commit-and-rebase-instead#comment37713303_24383813">in the comments</a>, there is more than one way to do this in Git. Say, for example, that you have a commit graph like this:</p> <pre><code>develop *-------* ... | 119, 8974, 28897 | git, git-merge, rebase | <h1>Remove an unwanted merge commit and rebase instead with Git</h1>
<p>I have a feature branch off develop. I started using the practice of rebasing my feature branch with develop instead of merging as the benefits of a linear commit history was appropriate for my project which had a few upstream and downstream reposi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,591 | git | # Remove an unwanted merge commit and rebase instead with Git
I have a feature branch off develop. I started using the practice of rebasing my feature branch with develop instead of merging as the benefits of a linear commit history was appropriate for my project which had a few upstream and downstream repositories.
... | As torek points out [in the comments](https://stackoverflow.com/questions/24383813/git-remove-an-unwanted-merge-commit-and-rebase-instead#comment37713303_24383813), there is more than one way to do this in Git. Say, for example, that you have a commit graph like this:
```
develop *-------*
\ \
feature... |
20231258 | Minimum distance between a point and a line in latitude, longitude | 13 | 2013-11-27 01:22:06 | <p>I have a line with two points in latitude and longitude<br>
A: 3.222895, 101.719751<br>
B: 3.227511, 101.724318 </p>
<p>and 1 point<br>
C: 3.224972, 101.722932</p>
<p>How can I calculate minimum distance between point C and a line consists of point A and B?
It will be convenient if you can provide the calculati... | 10,173 | 180,630 | 2018-01-11 19:22:00 | 20,369,652 | 16 | 2013-12-04 07:36:56 | 180,630 | 2018-01-11 19:22:00 | https://stackoverflow.com/q/20231258 | https://stackoverflow.com/a/20369652 | <p>Thanks to mimi and this great article <a href="http://www.movable-type.co.uk/scripts/latlong.html" rel="noreferrer">http://www.movable-type.co.uk/scripts/latlong.html</a> but they don't give the whole picture. Here is a detail one. All this points are collected using Google Earth using Placemark to mark the location... | <p>Thanks to mimi and this great article <a href="http://www.movable-type.co.uk/scripts/latlong.html" rel="noreferrer">http://www.movable-type.co.uk/scripts/latlong.html</a> but they don't give the whole picture. Here is a detail one. All this points are collected using Google Earth using Placemark to mark the location... | 908, 1834, 6238, 7003, 20301 | dictionary, distance, latitude-longitude, objective-c, xcode | <h1>Minimum distance between a point and a line in latitude, longitude</h1>
<p>I have a line with two points in latitude and longitude<br>
A: 3.222895, 101.719751<br>
B: 3.227511, 101.724318 </p>
<p>and 1 point<br>
C: 3.224972, 101.722932</p>
<p>How can I calculate minimum distance between point C and a line consis... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,592 | git | # Minimum distance between a point and a line in latitude, longitude
I have a line with two points in latitude and longitude
A: 3.222895, 101.719751
B: 3.227511, 101.724318
and 1 point
C: 3.224972, 101.722932
How can I calculate minimum distance between point C and a line consists of point A and B?
It will be ... | Thanks to mimi and this great article <http://www.movable-type.co.uk/scripts/latlong.html> but they don't give the whole picture. Here is a detail one. All this points are collected using Google Earth using Placemark to mark the locations. Make sure lat/long are set to decimal degrees in Preferences.
```
lat A = 3.222... |
18856047 | Emacs Magit commit opens new Emacs client | 13 | 2013-09-17 17:20:53 | <p>I've been using Magit for awhile, and when committing, it used to simply split the window and allow me to commit from within the same emacs session, but I seem to have changed this behavior to the following:</p>
<p>Now, when I commit my staged changes, a new emacs client starts up, taking awhile to load, finally let... | 1,764 | 1,070,325 | 2013-10-09 07:05:33 | 19,265,280 | 16 | 2013-10-09 07:05:33 | 149,416 | 2013-10-09 07:05:33 | https://stackoverflow.com/q/18856047 | https://stackoverflow.com/a/19265280 | <p>This bug is noted (but not solved) as a github issue here: <a href="https://github.com/magit/magit/issues/862">https://github.com/magit/magit/issues/862</a></p>
<p>I think the issue here is that magit is calling 'emacsclient', which by default is /usr/bin/emacsclient. It needs to call the emacsclient that is packag... | <p>This bug is noted (but not solved) as a github issue here: <a href="https://github.com/magit/magit/issues/862">https://github.com/magit/magit/issues/862</a></p> <p>I think the issue here is that magit is calling 'emacsclient', which by default is /usr/bin/emacsclient. It needs to call the emacsclient that is packag... | 119, 371, 15445, 41829 | emacs, emacsclient, git, magit | <h1>Emacs Magit commit opens new Emacs client</h1>
<p>I've been using Magit for awhile, and when committing, it used to simply split the window and allow me to commit from within the same emacs session, but I seem to have changed this behavior to the following:</p>
<p>Now, when I commit my staged changes, a new emacs c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,594 | git | # Emacs Magit commit opens new Emacs client
I've been using Magit for awhile, and when committing, it used to simply split the window and allow me to commit from within the same emacs session, but I seem to have changed this behavior to the following:
Now, when I commit my staged changes, a new emacs client starts up... | This bug is noted (but not solved) as a github issue here: <https://github.com/magit/magit/issues/862>
I think the issue here is that magit is calling 'emacsclient', which by default is /usr/bin/emacsclient. It needs to call the emacsclient that is packaged with emacs in order to work properly - other emacsclients (fr... |
17935750 | Revert all commits by a specific author since specific time | 13 | 2013-07-29 23:09:25 | <p>I want to revert all commits by a specific author since 4 days ago. How do I do it?</p>
<p>To get all sha1s (with a bit of noise) I can use this:</p>
<pre><code>git log --author=Mohsen --pretty=one --since=4.days
</code></pre>
| 5,559 | 650,722 | 2013-07-29 23:44:34 | 17,935,901 | 16 | 2013-07-29 23:25:02 | 11,343 | 2013-07-29 23:44:34 | https://stackoverflow.com/q/17935750 | https://stackoverflow.com/a/17935901 | <p>You have to give <code>format:%H</code> to <code>git log</code> and use a loop:</p>
<pre><code>for sha in `git log --pretty=format:%H --author=Mohsen --since=4.days`; do
git revert --no-edit $sha
done
</code></pre>
<p>This will create one commit per revert. Suppress the <code>--no-edit</code> option to modify in... | <p>You have to give <code>format:%H</code> to <code>git log</code> and use a loop:</p> <pre><code>for sha in `git log --pretty=format:%H --author=Mohsen --since=4.days`; do git revert --no-edit $sha done </code></pre> <p>This will create one commit per revert. Suppress the <code>--no-edit</code> option to modify in... | 119, 34403 | git, git-revert | <h1>Revert all commits by a specific author since specific time</h1>
<p>I want to revert all commits by a specific author since 4 days ago. How do I do it?</p>
<p>To get all sha1s (with a bit of noise) I can use this:</p>
<pre><code>git log --author=Mohsen --pretty=one --since=4.days
</code></pre>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,595 | git | # Revert all commits by a specific author since specific time
I want to revert all commits by a specific author since 4 days ago. How do I do it?
To get all sha1s (with a bit of noise) I can use this:
```
git log --author=Mohsen --pretty=one --since=4.days
``` | You have to give `format:%H` to `git log` and use a loop:
```
for sha in `git log --pretty=format:%H --author=Mohsen --since=4.days`; do
git revert --no-edit $sha
done
```
This will create one commit per revert. Suppress the `--no-edit` option to modify interactively the commit message on each revert.
Or, if you w... |
16404066 | Which files of an autoconf project to put into .gitignore? | 13 | 2013-05-06 17:36:09 | <p>We have the <a href="http://code.google.com/p/ctemplate/">ctemplate</a> library included in our git-managed project which is based on <a href="http://www.gnu.org/software/autoconf/">GNU Autoconf</a>.</p>
<p>I would like to put everything which is generated by Autoconf into the .gitignore file to avoid conflicts if ... | 5,084 | 2,555,491 | 2014-02-21 10:15:21 | 16,404,209 | 16 | 2013-05-06 17:44:21 | 2,070,725 | 2013-05-06 17:44:21 | https://stackoverflow.com/q/16404066 | https://stackoverflow.com/a/16404209 | <p>Here is what I have in my various <code>.gitignore</code> (on Debian testing):</p>
<p><strong>Shared library:</strong> (libtool)</p>
<pre><code>/Makefile
/Makefile.in
/aclocal.m4
/autom4te.cache/
/config.*
/configure
/depcomp
/install-sh
/libtool
/ltmain.sh
/m4/
/missing
/stamp-h?
.deps/
.dirstamp
.libs/
*.l[ao]
*... | <p>Here is what I have in my various <code>.gitignore</code> (on Debian testing):</p> <p><strong>Shared library:</strong> (libtool)</p> <pre><code>/Makefile /Makefile.in /aclocal.m4 /autom4te.cache/ /config.* /configure /depcomp /install-sh /libtool /ltmain.sh /m4/ /missing /stamp-h? .deps/ .dirstamp .libs/ *.l[ao] *... | 10, 119, 1102, 4301 | autoconf, c++, git, makefile | <h1>Which files of an autoconf project to put into .gitignore?</h1>
<p>We have the <a href="http://code.google.com/p/ctemplate/">ctemplate</a> library included in our git-managed project which is based on <a href="http://www.gnu.org/software/autoconf/">GNU Autoconf</a>.</p>
<p>I would like to put everything which is g... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,596 | git | # Which files of an autoconf project to put into .gitignore?
We have the [ctemplate](http://code.google.com/p/ctemplate/) library included in our git-managed project which is based on [GNU Autoconf](http://www.gnu.org/software/autoconf/).
I would like to put everything which is generated by Autoconf into the .gitigno... | Here is what I have in my various `.gitignore` (on Debian testing):
**Shared library:** (libtool)
```
/Makefile
/Makefile.in
/aclocal.m4
/autom4te.cache/
/config.*
/configure
/depcomp
/install-sh
/libtool
/ltmain.sh
/m4/
/missing
/stamp-h?
.deps/
.dirstamp
.libs/
*.l[ao]
*~
```
**Executable:**
```
/Makefile
/Makefi... |
15729661 | How to add files to be committed in a faster way? | 13 | 2013-03-31 13:07:32 | <p>For example, this is the status of a branch in my local repository:</p>
<pre><code>14:56:15 /srv/www/gamersmafia/current[max-decisiones]$ git status
# On branch max-decisiones
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>... | 6,848 | 2,105,438 | 2013-03-31 13:28:05 | 15,729,733 | 16 | 2013-03-31 13:15:24 | 1,471,829 | 2013-03-31 13:28:05 | https://stackoverflow.com/q/15729661 | https://stackoverflow.com/a/15729733 | <p>You could just add them (also the newly created files) with:</p>
<pre><code>git add -A .
</code></pre>
<p>And then commit.
If you want to just add some of them you can use add interactively:</p>
<pre><code>git add -i
</code></pre>
<p><code>git</code> will ask for what files you want to add. If you're using linux... | <p>You could just add them (also the newly created files) with:</p> <pre><code>git add -A . </code></pre> <p>And then commit. If you want to just add some of them you can use add interactively:</p> <pre><code>git add -i </code></pre> <p><code>git</code> will ask for what files you want to add. If you're using linux... | 119 | git | <h1>How to add files to be committed in a faster way?</h1>
<p>For example, this is the status of a branch in my local repository:</p>
<pre><code>14:56:15 /srv/www/gamersmafia/current[max-decisiones]$ git status
# On branch max-decisiones
# Changes not staged for commit:
# (use "git add <file>..." to update wha... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,597 | git | # How to add files to be committed in a faster way?
For example, this is the status of a branch in my local repository:
```
14:56:15 /srv/www/gamersmafia/current[max-decisiones]$ git status
# On branch max-decisiones
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (... | You could just add them (also the newly created files) with:
```
git add -A .
```
And then commit.
If you want to just add some of them you can use add interactively:
```
git add -i
```
`git` will ask for what files you want to add. If you're using linux or a mac you can create an alias in your shell to make the co... |
15619219 | How do I tell git to ignore files that start with a tilde? | 13 | 2013-03-25 15:54:55 | <p>My text editor creates swap files that start with a tilde. I accidentally checked on of these into git. How do I tell git to ignore any files like this anywhere in my project tree?</p>
<p>So I had </p>
<pre><code>/folder/another/file.txt
/folder/another/~file.txt
</code></pre>
<p>I want <code>~file.txt</code> t... | 6,265 | 1,145,388 | 2021-04-21 01:24:49 | 15,619,260 | 16 | 2013-03-25 15:56:29 | 430,766 | 2013-03-25 15:56:29 | https://stackoverflow.com/q/15619219 | https://stackoverflow.com/a/15619260 | <p>Just use a .gitignore file:</p>
<pre><code>echo '~*' >> .gitignore
</code></pre>
<p>Alternatively, you can also write this line to <code>.git/info/exclude</code> which is a project-wide local ignore file (which you obviously cannot check in, as you can do with <code>.gitignore</code>).</p>
| <p>Just use a .gitignore file:</p> <pre><code>echo '~*' >> .gitignore </code></pre> <p>Alternatively, you can also write this line to <code>.git/info/exclude</code> which is a project-wide local ignore file (which you obviously cannot check in, as you can do with <code>.gitignore</code>).</p> | 119, 25056 | git, gitignore | <h1>How do I tell git to ignore files that start with a tilde?</h1>
<p>My text editor creates swap files that start with a tilde. I accidentally checked on of these into git. How do I tell git to ignore any files like this anywhere in my project tree?</p>
<p>So I had </p>
<pre><code>/folder/another/file.txt
/folder... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,598 | git | # How do I tell git to ignore files that start with a tilde?
My text editor creates swap files that start with a tilde. I accidentally checked on of these into git. How do I tell git to ignore any files like this anywhere in my project tree?
So I had
```
/folder/another/file.txt
/folder/another/~file.txt
```
I want... | Just use a .gitignore file:
```
echo '~*' >> .gitignore
```
Alternatively, you can also write this line to `.git/info/exclude` which is a project-wide local ignore file (which you obviously cannot check in, as you can do with `.gitignore`). |
14361453 | How to create a patch with Git Extensions | 13 | 2013-01-16 15:07:11 | <p>Is there a way to create a patch from selected commits in the user interface from Git Extensions?</p>
<p>I know how to export a patch trough command line, but I wonder if there is a similar functionality like in the TortoiseHg user interface (right click → <em>Export</em> -> ...)</p>
<p>So far I have only found th... | 13,354 | 867,294 | 2018-06-26 18:43:34 | 14,361,580 | 16 | 2013-01-16 15:13:20 | 572,644 | 2013-01-16 15:13:20 | https://stackoverflow.com/q/14361453 | https://stackoverflow.com/a/14361580 | <p>You can use Commands -> Format patch. In the window that pops up, you can select multiple commits.</p>
<p>The result will be one patch file per commit. That's in line with the default behavior of <code>git format-patch</code>.</p>
<p>The UI unfortunatelly provides no way to put them all in one file. You could just... | <p>You can use Commands -> Format patch. In the window that pops up, you can select multiple commits.</p> <p>The result will be one patch file per commit. That's in line with the default behavior of <code>git format-patch</code>.</p> <p>The UI unfortunatelly provides no way to put them all in one file. You could just... | 119, 2132, 39597 | git, git-extensions, patch | <h1>How to create a patch with Git Extensions</h1>
<p>Is there a way to create a patch from selected commits in the user interface from Git Extensions?</p>
<p>I know how to export a patch trough command line, but I wonder if there is a similar functionality like in the TortoiseHg user interface (right click → <em>Expo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,599 | git | # How to create a patch with Git Extensions
Is there a way to create a patch from selected commits in the user interface from Git Extensions?
I know how to export a patch trough command line, but I wonder if there is a similar functionality like in the TortoiseHg user interface (right click → *Export* -> ...)
So far... | You can use Commands -> Format patch. In the window that pops up, you can select multiple commits.
The result will be one patch file per commit. That's in line with the default behavior of `git format-patch`.
The UI unfortunatelly provides no way to put them all in one file. You could just use a simple script of some... |
13691721 | What is default git core.askpass configuration value? | 13 | 2012-12-03 21:07:26 | <p>I've set my <code>core.askpass</code> to an application and now I want to revert it back. How do I do it?</p>
| 13,827 | 650,722 | 2012-12-04 17:09:28 | 13,691,763 | 16 | 2012-12-03 21:09:41 | 216,074 | 2012-12-03 21:09:41 | https://stackoverflow.com/q/13691721 | https://stackoverflow.com/a/13691763 | <p>Remove it:</p>
<pre><code>git config --global --unset core.askpass
</code></pre>
| <p>Remove it:</p> <pre><code>git config --global --unset core.askpass </code></pre> | 119 | git | <h1>What is default git core.askpass configuration value?</h1>
<p>I've set my <code>core.askpass</code> to an application and now I want to revert it back. How do I do it?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,600 | git | # What is default git core.askpass configuration value?
I've set my `core.askpass` to an application and now I want to revert it back. How do I do it? | Remove it:
```
git config --global --unset core.askpass
``` |
10851720 | Can I destroy and recreate a Git remote branch in one command? | 13 | 2012-06-01 14:01:08 | <p>In Git, I sometimes work on long-running branches. I like to rebase on master from time to time to make merging easier when I'm ready.</p>
<p>After rebasing, I can't push a previously-pushed branch to a remote, because my branch's history no longer agrees with the remote's history of that branch. So I have to delet... | 9,826 | 4,376 | 2020-04-26 13:48:30 | 10,851,781 | 16 | 2012-06-01 14:06:09 | 159,834 | 2012-06-04 07:31:11 | https://stackoverflow.com/q/10851720 | https://stackoverflow.com/a/10851781 | <p>If you are allowed to rewrite the remote branch, you can use <code>git push --force my_remote my_branch</code>.</p>
| <p>If you are allowed to rewrite the remote branch, you can use <code>git push --force my_remote my_branch</code>.</p> | 119 | git | <h1>Can I destroy and recreate a Git remote branch in one command?</h1>
<p>In Git, I sometimes work on long-running branches. I like to rebase on master from time to time to make merging easier when I'm ready.</p>
<p>After rebasing, I can't push a previously-pushed branch to a remote, because my branch's history no lo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,601 | git | # Can I destroy and recreate a Git remote branch in one command?
In Git, I sometimes work on long-running branches. I like to rebase on master from time to time to make merging easier when I'm ready.
After rebasing, I can't push a previously-pushed branch to a remote, because my branch's history no longer agrees with... | If you are allowed to rewrite the remote branch, you can use `git push --force my_remote my_branch`. |
8375206 | Git disable pushing from local repository | 13 | 2011-12-04 12:14:17 | <p>I have a repository with some core code in it, and for each client I wish to clone it so I can do git pull everytime a client wants to upgrade to the newest functionality. </p>
<p>In the interest of not screwing things up and making changes that only one company sees, is there a way to only allow fetches on a loca... | 4,917 | 883,374 | 2012-03-22 18:03:36 | 8,376,674 | 16 | 2011-12-04 16:24:58 | 613,109 | 2011-12-04 16:30:23 | https://stackoverflow.com/q/8375206 | https://stackoverflow.com/a/8376674 | <p>Specify a <strong>non-existing pushurl</strong> in the remote section of the clone-source repository (called origin) in the file <code>.git/config</code>. Example:</p>
<pre><code>[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = <url>
pushurl = www.non-existing-url.co... | <p>Specify a <strong>non-existing pushurl</strong> in the remote section of the clone-source repository (called origin) in the file <code>.git/config</code>. Example:</p> <pre><code>[remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = <url> pushurl = www.non-existing-url.co... | 119, 725, 3050 | clone, configuration, git | <h1>Git disable pushing from local repository</h1>
<p>I have a repository with some core code in it, and for each client I wish to clone it so I can do git pull everytime a client wants to upgrade to the newest functionality. </p>
<p>In the interest of not screwing things up and making changes that only one company s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,602 | git | # Git disable pushing from local repository
I have a repository with some core code in it, and for each client I wish to clone it so I can do git pull everytime a client wants to upgrade to the newest functionality.
In the interest of not screwing things up and making changes that only one company sees, is there a wa... | Specify a **non-existing pushurl** in the remote section of the clone-source repository (called origin) in the file `.git/config`. Example:
```
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = <url>
pushurl = www.non-existing-url.com
```
Or if you don't like editing the conf... |
5128076 | cannot rebase: you have unstaged changes git | 13 | 2011-02-26 16:19:39 | <p>I am on a branch named new_nlp and when I do a git status, I get the following:</p>
<pre><code># On branch new_nlp
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: ... | 48,402 | 11,755 | 2012-05-22 14:36:35 | 5,128,087 | 16 | 2011-02-26 16:22:31 | 112,968 | 2011-02-26 16:22:31 | https://stackoverflow.com/q/5128076 | https://stackoverflow.com/a/5128087 | <p>the file is deleted and is already tracked by git. you can:</p>
<ol>
<li>delete the file and commit the change (<code>git rm --cached untitled; git commit</code>) or</li>
<li>run <code>git checkout -- untitled</code> to get back the file</li>
</ol>
| <p>the file is deleted and is already tracked by git. you can:</p> <ol> <li>delete the file and commit the change (<code>git rm --cached untitled; git commit</code>) or</li> <li>run <code>git checkout -- untitled</code> to get back the file</li> </ol> | 119 | git | <h1>cannot rebase: you have unstaged changes git</h1>
<p>I am on a branch named new_nlp and when I do a git status, I get the following:</p>
<pre><code># On branch new_nlp
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to di... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,603 | git | # cannot rebase: you have unstaged changes git
I am on a branch named new_nlp and when I do a git status, I get the following:
```
# On branch new_nlp
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directo... | the file is deleted and is already tracked by git. you can:
1. delete the file and commit the change (`git rm --cached untitled; git commit`) or
2. run `git checkout -- untitled` to get back the file |
3205867 | Can I perform git operations (add/diff/commit) on files in a repository when my current directory isn't in the repository | 13 | 2010-07-08 16:29:47 | <p>With svn, I was able to run commands on files in a checkout, without having <code>cd</code> into that checkout first. For example:</p>
<pre><code># Located in /tmp, running svn operation on /home/d5ve/checkout
d5ve@host:/tmp> svn add /home/d5ve/checkout/myfile.txt
d5ve@host:/tmp> svn diff /home/d5ve/checkout/... | 3,162 | 357,336 | 2016-04-06 04:40:15 | 3,205,966 | 16 | 2010-07-08 16:41:42 | null | 2010-07-08 18:23:44 | https://stackoverflow.com/q/3205867 | https://stackoverflow.com/a/3205966 | <p>You have to use both options together:</p>
<pre><code>git --git-dir=/home/d5ve/checkout2/.git --work-tree=/home/d5ve/checkout2/ add /home/d5ve/checkout2/myfile.txt
</code></pre>
<p>Note, that <code>--git-dir</code> does not refer to the directory containing working copy, but to the <code>.git</code> subdirectory, ... | <p>You have to use both options together:</p> <pre><code>git --git-dir=/home/d5ve/checkout2/.git --work-tree=/home/d5ve/checkout2/ add /home/d5ve/checkout2/myfile.txt </code></pre> <p>Note, that <code>--git-dir</code> does not refer to the directory containing working copy, but to the <code>.git</code> subdirectory, ... | 119 | git | <h1>Can I perform git operations (add/diff/commit) on files in a repository when my current directory isn't in the repository</h1>
<p>With svn, I was able to run commands on files in a checkout, without having <code>cd</code> into that checkout first. For example:</p>
<pre><code># Located in /tmp, running svn operatio... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,604 | git | # Can I perform git operations (add/diff/commit) on files in a repository when my current directory isn't in the repository
With svn, I was able to run commands on files in a checkout, without having `cd` into that checkout first. For example:
```
# Located in /tmp, running svn operation on /home/d5ve/checkout
d5ve@h... | You have to use both options together:
```
git --git-dir=/home/d5ve/checkout2/.git --work-tree=/home/d5ve/checkout2/ add /home/d5ve/checkout2/myfile.txt
```
Note, that `--git-dir` does not refer to the directory containing working copy, but to the `.git` subdirectory, which contains the repository itself. git provide... |
2434837 | Can I change the default directory on my local drive for all Git activity? | 13 | 2010-03-12 18:16:39 | <p>So I just started using Git and GitHub. It's still a steep climb, but I'm starting to enjoy it. One thing I've noticed from when I clone a repository is that it always downloads to my home folder <code>/users/username</code>. Is there a way to change this?</p>
<p>I went searching through the Git manual and thought ... | 21,203 | 275,085 | 2017-01-28 14:04:45 | 2,434,941 | 16 | 2010-03-12 18:37:22 | 28,804 | 2010-03-12 18:37:22 | https://stackoverflow.com/q/2434837 | https://stackoverflow.com/a/2434941 | <p><code>git clone</code> will copy files to whatever your current directory is, unless you specify otherwise. So if your current working directory is <code>~</code>, then</p>
<pre><code>$ git clone me@host:/path/to/repo.git
</code></pre>
<p>will copy files to <code>~/repo</code>.</p>
<p>You can change this one of t... | <p><code>git clone</code> will copy files to whatever your current directory is, unless you specify otherwise. So if your current working directory is <code>~</code>, then</p> <pre><code>$ git clone me@host:/path/to/repo.git </code></pre> <p>will copy files to <code>~/repo</code>.</p> <p>You can change this one of t... | 119, 218, 369, 6923 | directory, git, local, macos | <h1>Can I change the default directory on my local drive for all Git activity?</h1>
<p>So I just started using Git and GitHub. It's still a steep climb, but I'm starting to enjoy it. One thing I've noticed from when I clone a repository is that it always downloads to my home folder <code>/users/username</code>. Is ther... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,605 | git | # Can I change the default directory on my local drive for all Git activity?
So I just started using Git and GitHub. It's still a steep climb, but I'm starting to enjoy it. One thing I've noticed from when I clone a repository is that it always downloads to my home folder `/users/username`. Is there a way to change th... | `git clone` will copy files to whatever your current directory is, unless you specify otherwise. So if your current working directory is `~`, then
```
$ git clone me@host:/path/to/repo.git
```
will copy files to `~/repo`.
You can change this one of two ways:
`cd` to the desired directory first:
```
$ cd /path/to/m... |
61045349 | How to edit gitignore file | 12 | 2020-04-05 15:57:36 | <p>I started TheOdinProject on Ubuntu 18.4 and in the Git section it tells me to edit the .gitignore file. I already created it using <code>touch .gitignore</code> and it is showing up when i type <code>ls -la</code> but I don't see it in Files. In the video <a href="https://www.youtube.com/watch?v=HVsySz-h9r4" rel="no... | 34,706 | 13,215,289 | 2020-04-05 17:45:05 | 61,045,461 | 16 | 2020-04-05 16:05:26 | 11,820,711 | 2020-04-05 16:05:26 | https://stackoverflow.com/q/61045349 | https://stackoverflow.com/a/61045461 | <p><code>.gitignore</code> files are hidden on *nix operating systems because of their dot prefix (<a href="https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory" rel="noreferrer">link</a>). However you can access them as normal from the shell. e.g. <code>nano .gitignore</code>.</p>
| <p><code>.gitignore</code> files are hidden on *nix operating systems because of their dot prefix (<a href="https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory" rel="noreferrer">link</a>). However you can access them as normal from the shell. e.g. <code>nano .gitignore</code>.</p> | 58, 119, 549, 25056 | git, gitignore, linux, ubuntu | <h1>How to edit gitignore file</h1>
<p>I started TheOdinProject on Ubuntu 18.4 and in the Git section it tells me to edit the .gitignore file. I already created it using <code>touch .gitignore</code> and it is showing up when i type <code>ls -la</code> but I don't see it in Files. In the video <a href="https://www.yout... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,607 | git | # How to edit gitignore file
I started TheOdinProject on Ubuntu 18.4 and in the Git section it tells me to edit the .gitignore file. I already created it using `touch .gitignore` and it is showing up when i type `ls -la` but I don't see it in Files. In the video <https://www.youtube.com/watch?v=HVsySz-h9r4> that is re... | `.gitignore` files are hidden on *nix operating systems because of their dot prefix ([link](https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory)). However you can access them as normal from the shell. e.g. `nano .gitignore`. |
54395666 | Why does git say 'Changes not staged for commit' and indicate the submodule folder? | 12 | 2019-01-28 04:44:19 | <p>I have a git submodule inside another module, added via <code>git submodule add <...></code> (command issued from parent repo), so the <code>.gitmodules</code> file is automatically generated inside the parent repo.</p>
<p>Suppose I make a change to the submodule (edit: and do <em>not</em> commit those change... | 10,246 | 7,598,461 | 2019-01-28 09:27:26 | 54,396,216 | 16 | 2019-01-28 05:52:07 | 1,256,452 | 2019-01-28 05:52:07 | https://stackoverflow.com/q/54395666 | https://stackoverflow.com/a/54396216 | <p>What's going on here is that your submodule repository is on a different commit than the hash ID recorded in the superproject. Your <code>git status</code>, run in the superproject, is telling you this, without changing it, and your <code>git add -A</code> apparently did not change it either.</p>
<p>This last part... | <p>What's going on here is that your submodule repository is on a different commit than the hash ID recorded in the superproject. Your <code>git status</code>, run in the superproject, is telling you this, without changing it, and your <code>git add -A</code> apparently did not change it either.</p> <p>This last part... | 119, 41612 | git, git-submodules | <h1>Why does git say 'Changes not staged for commit' and indicate the submodule folder?</h1>
<p>I have a git submodule inside another module, added via <code>git submodule add <...></code> (command issued from parent repo), so the <code>.gitmodules</code> file is automatically generated inside the parent repo.</p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,609 | git | # Why does git say 'Changes not staged for commit' and indicate the submodule folder?
I have a git submodule inside another module, added via `git submodule add <...>` (command issued from parent repo), so the `.gitmodules` file is automatically generated inside the parent repo.
Suppose I make a change to the submodu... | What's going on here is that your submodule repository is on a different commit than the hash ID recorded in the superproject. Your `git status`, run in the superproject, is telling you this, without changing it, and your `git add -A` apparently did not change it either.
This last part seems wrong. When I do something... |
43171897 | How to set up GoCD to handle private git repositories that use SSH keys for authentication? | 12 | 2017-04-02 18:20:12 | <p>I have a git repository that authenticates users with SSH keys and I want to use that repo as a GoCD material. GoCD gives me this error:</p>
<pre><code>Error performing command: --- Command ---
git ls-remote ssh://git@server/repo.git refs/heads/master
--- Environment ---
{GIT_ALLOW_PROTOCOL=http:https:ssh:git:file:... | 10,857 | 3,601,487 | 2023-07-01 21:45:07 | 43,172,135 | 16 | 2017-04-02 18:42:44 | 3,601,487 | 2023-07-01 21:45:07 | https://stackoverflow.com/q/43171897 | https://stackoverflow.com/a/43172135 | <p>At the time of writing this answer, it's not possible to manage SSH keys in GoCD directly. To make it work you have to generate SSH keys for a GoCD server and all agents and then add them to the server that's hosting the git repository. You can also copy an existing key to the server & nodes but that's obviously... | <p>At the time of writing this answer, it's not possible to manage SSH keys in GoCD directly. To make it work you have to generate SSH keys for a GoCD server and all agents and then add them to the server that's hosting the git repository. You can also copy an existing key to the server & nodes but that's obviously... | 119, 386, 1066, 101520 | continuous-integration, git, go-cd, ssh | <h1>How to set up GoCD to handle private git repositories that use SSH keys for authentication?</h1>
<p>I have a git repository that authenticates users with SSH keys and I want to use that repo as a GoCD material. GoCD gives me this error:</p>
<pre><code>Error performing command: --- Command ---
git ls-remote ssh://g... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,610 | git | # How to set up GoCD to handle private git repositories that use SSH keys for authentication?
I have a git repository that authenticates users with SSH keys and I want to use that repo as a GoCD material. GoCD gives me this error:
```
Error performing command: --- Command ---
git ls-remote ssh://git@server/repo.git r... | At the time of writing this answer, it's not possible to manage SSH keys in GoCD directly. To make it work you have to generate SSH keys for a GoCD server and all agents and then add them to the server that's hosting the git repository. You can also copy an existing key to the server & nodes but that's obviously not re... |
28265396 | GitPython -- How to 'git stash' changes to a GitPython repository? | 12 | 2015-02-01 17:12:40 | <p>I have a repo created via GitPython library that has some uncommitted changes. I want to stash those changes. How do I do it?</p>
<p>Searching for "stash" in the GitPython <a href="http://gitpython.readthedocs.org/en/stable/reference.html" rel="noreferrer">docs</a> returned no results.</p>
| 6,361 | 980,632 | 2015-02-01 17:25:43 | 28,265,539 | 16 | 2015-02-01 17:25:43 | 190,597 | 2015-02-01 17:25:43 | https://stackoverflow.com/q/28265396 | https://stackoverflow.com/a/28265539 | <p>Per the docs, <a href="http://gitpython.readthedocs.org/en/stable/tutorial.html#using-git-directly" rel="noreferrer">"Using git directly"</a>:</p>
<blockquote>
<p>In case you are missing functionality as it has not been wrapped, you may
conveniently use the git command directly. It is owned by each repository... | <p>Per the docs, <a href="http://gitpython.readthedocs.org/en/stable/tutorial.html#using-git-directly" rel="noreferrer">"Using git directly"</a>:</p> <blockquote> <p>In case you are missing functionality as it has not been wrapped, you may conveniently use the git command directly. It is owned by each repository... | 16, 119, 61013 | git, gitpython, python | <h1>GitPython -- How to 'git stash' changes to a GitPython repository?</h1>
<p>I have a repo created via GitPython library that has some uncommitted changes. I want to stash those changes. How do I do it?</p>
<p>Searching for "stash" in the GitPython <a href="http://gitpython.readthedocs.org/en/stable/reference.html" ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,612 | git | # GitPython -- How to 'git stash' changes to a GitPython repository?
I have a repo created via GitPython library that has some uncommitted changes. I want to stash those changes. How do I do it?
Searching for "stash" in the GitPython [docs](http://gitpython.readthedocs.org/en/stable/reference.html) returned no result... | Per the docs, ["Using git directly"](http://gitpython.readthedocs.org/en/stable/tutorial.html#using-git-directly):
> In case you are missing functionality as it has not been wrapped, you may
> conveniently use the git command directly. It is owned by each repository
> instance.
Thus, you could call `git stash save` w... |
22536978 | How to solve the 'package not available in stable-enough version' error of composer? | 12 | 2014-03-20 15:02:01 | <p>Recently, I've been doing a lot of research about Composer minimum-stability. I get into the official documentation and read about the minimum-stability change. But, even so I cant get the composer to install the dependencies.</p>
<p>I have the root package and two others, let's call them packageA and packageB.
Whe... | 25,543 | 3,396,974 | 2014-11-28 10:11:57 | 22,540,759 | 16 | 2014-03-20 17:29:01 | 3,396,974 | 2014-03-20 17:29:01 | https://stackoverflow.com/q/22536978 | https://stackoverflow.com/a/22540759 | <h2>I found the proper solution.</h2>
<p>Here's what I did.</p>
<p>First:</p>
<blockquote>
<p>I removed the minimum-stability field inside the composer.json of my packages A and B; For the minumum-stability is a root-only field. As, described in this [link] <a href="https://getcomposer.org/doc/04-schema.md#minimum... | <h2>I found the proper solution.</h2> <p>Here's what I did.</p> <p>First:</p> <blockquote> <p>I removed the minimum-stability field inside the composer.json of my packages A and B; For the minumum-stability is a root-only field. As, described in this [link] <a href="https://getcomposer.org/doc/04-schema.md#minimum... | 119, 1508, 78546 | composer-php, git, json | <h1>How to solve the 'package not available in stable-enough version' error of composer?</h1>
<p>Recently, I've been doing a lot of research about Composer minimum-stability. I get into the official documentation and read about the minimum-stability change. But, even so I cant get the composer to install the dependenci... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,613 | git | # How to solve the 'package not available in stable-enough version' error of composer?
Recently, I've been doing a lot of research about Composer minimum-stability. I get into the official documentation and read about the minimum-stability change. But, even so I cant get the composer to install the dependencies.
I ha... | ## I found the proper solution.
Here's what I did.
First:
> I removed the minimum-stability field inside the composer.json of my packages A and B; For the minumum-stability is a root-only field. As, described in this [link] <https://getcomposer.org/doc/04-schema.md#minimum-stability>).
But the real solution was, as... |
20524535 | What 'cherry' means in git-cherry? | 12 | 2013-12-11 16:26:17 | <p>What is the meaning of the word <em>cherry</em> in <a href="https://www.kernel.org/pub/software/scm/git/docs/git-cherry.html" rel="noreferrer">git-cherry</a>?</p>
<hr>
<p>Besides the fruit, I've only seem the word in the <em>cherry picking</em> expression (also present in git with <a href="https://www.kernel.org/p... | 1,274 | 1,316,620 | 2013-12-16 13:31:15 | 20,524,670 | 16 | 2013-12-11 16:32:32 | 912,144 | 2013-12-11 16:32:32 | https://stackoverflow.com/q/20524535 | https://stackoverflow.com/a/20524670 | <p>It's called <code>cherry-pick</code> because the task is like cherry picking. You look through a bunch of commits (in a real tree, leaves and branches) and carefully select some of them. It's a delicate job the same way cherry picking in real-world is.</p>
<p><code>git-cherry</code> <em>is</em> related to <code>git... | <p>It's called <code>cherry-pick</code> because the task is like cherry picking. You look through a bunch of commits (in a real tree, leaves and branches) and carefully select some of them. It's a delicate job the same way cherry picking in real-world is.</p> <p><code>git-cherry</code> <em>is</em> related to <code>git... | 119, 78810, 96747 | git, git-cherry, git-cherry-pick | <h1>What 'cherry' means in git-cherry?</h1>
<p>What is the meaning of the word <em>cherry</em> in <a href="https://www.kernel.org/pub/software/scm/git/docs/git-cherry.html" rel="noreferrer">git-cherry</a>?</p>
<hr>
<p>Besides the fruit, I've only seem the word in the <em>cherry picking</em> expression (also present i... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,614 | git | # What 'cherry' means in git-cherry?
What is the meaning of the word *cherry* in [git-cherry](https://www.kernel.org/pub/software/scm/git/docs/git-cherry.html)?
---
Besides the fruit, I've only seem the word in the *cherry picking* expression (also present in git with [git-cherry-pick](https://www.kernel.org/pub/sof... | It's called `cherry-pick` because the task is like cherry picking. You look through a bunch of commits (in a real tree, leaves and branches) and carefully select some of them. It's a delicate job the same way cherry picking in real-world is.
`git-cherry` *is* related to `git-cherry-pick`. `git-cherry` reports which co... |
10421531 | How to stash unmerged code in git? | 12 | 2012-05-02 20:52:04 | <p>I did a git pull and found that one of my files needs to be merged.</p>
<p>I don't really want to merge that file right now - I have another branch that I need to work on, and I will get back to this branch later to resolve the merge.</p>
<p>What is the best course of action for me to "undo" this pull? Or how can ... | 13,000 | 3,788 | 2018-03-19 13:25:29 | 10,421,626 | 16 | 2012-05-02 20:58:50 | 10,387 | 2012-05-02 21:24:00 | https://stackoverflow.com/q/10421531 | https://stackoverflow.com/a/10421626 | <p>This is a good example of why I reckon doing a fetch instead of a pull is a good idea.</p>
<p>What you can do is simply reset your branch to it's previous state..</p>
<pre><code>git reset --hard HEAD~1
</code></pre>
<p>or if you are already in the middle of the merge (resolving conflicts), just abort it..</p>
<p... | <p>This is a good example of why I reckon doing a fetch instead of a pull is a good idea.</p> <p>What you can do is simply reset your branch to it's previous state..</p> <pre><code>git reset --hard HEAD~1 </code></pre> <p>or if you are already in the middle of the merge (resolving conflicts), just abort it..</p> <p... | 119, 28897, 62599 | git, git-merge, merge-conflict-resolution | <h1>How to stash unmerged code in git?</h1>
<p>I did a git pull and found that one of my files needs to be merged.</p>
<p>I don't really want to merge that file right now - I have another branch that I need to work on, and I will get back to this branch later to resolve the merge.</p>
<p>What is the best course of ac... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,616 | git | # How to stash unmerged code in git?
I did a git pull and found that one of my files needs to be merged.
I don't really want to merge that file right now - I have another branch that I need to work on, and I will get back to this branch later to resolve the merge.
What is the best course of action for me to "undo" t... | This is a good example of why I reckon doing a fetch instead of a pull is a good idea.
What you can do is simply reset your branch to it's previous state..
```
git reset --hard HEAD~1
```
or if you are already in the middle of the merge (resolving conflicts), just abort it..
```
git merge --abort
```
finish your c... |
6074009 | Doing git-push without origin master | 12 | 2011-05-20 15:17:51 | <p>Is there a way on GIT to just do a "git push" and it automatically send to "origin master" without specify that?
Just curious...</p>
| 16,415 | 151,174 | 2020-06-15 00:22:03 | 6,074,059 | 16 | 2011-05-20 15:22:15 | 106,205 | 2011-05-20 20:58:30 | https://stackoverflow.com/q/6074009 | https://stackoverflow.com/a/6074059 | <p>Your master branch should be automatically setup so this works. If you are on some other branch, then you can use the git branch command with the --set-upstream option</p>
<pre><code>git branch --set-upstream someBranch origin/master
</code></pre>
<p>It might be also the case that you don't have a remote set, in t... | <p>Your master branch should be automatically setup so this works. If you are on some other branch, then you can use the git branch command with the --set-upstream option</p> <pre><code>git branch --set-upstream someBranch origin/master </code></pre> <p>It might be also the case that you don't have a remote set, in t... | 119, 28898 | git, git-push | <h1>Doing git-push without origin master</h1>
<p>Is there a way on GIT to just do a "git push" and it automatically send to "origin master" without specify that?
Just curious...</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,617 | git | # Doing git-push without origin master
Is there a way on GIT to just do a "git push" and it automatically send to "origin master" without specify that?
Just curious... | Your master branch should be automatically setup so this works. If you are on some other branch, then you can use the git branch command with the --set-upstream option
```
git branch --set-upstream someBranch origin/master
```
It might be also the case that you don't have a remote set, in the case when you have a bar... |
70694973 | How to unstage a file during interactive rebase (remove file from old commit)? | 11 | 2022-01-13 10:23:01 | <p>I've read in <em>Pro Git</em> book about interactive rebases to change several commits. So I'm doing <code>git rebase HEAD~3</code>, changed one which I wanted to amend to <code>edit</code>. Then I was able to change a message via <code>git commit --amend</code>. And added a file via <code>git add file3</code> after... | 10,849 | 14,557,599 | 2023-10-29 00:54:06 | 70,695,803 | 16 | 2022-01-13 11:26:25 | 1,256,452 | 2022-01-13 21:06:25 | https://stackoverflow.com/q/70694973 | https://stackoverflow.com/a/70695803 | <p>When you talk about <em>removing a file</em> during interactive rebase, you might mean one of two things:</p>
<ul>
<li><p>Making the file <em>match the previous commit</em>. Some would call this <em>removing the changes to the file</em>, and since some people think of commits <em>as</em> changes, some people will t... | <p>When you talk about <em>removing a file</em> during interactive rebase, you might mean one of two things:</p> <ul> <li><p>Making the file <em>match the previous commit</em>. Some would call this <em>removing the changes to the file</em>, and since some people think of commits <em>as</em> changes, some people will t... | 119 | git | <h1>How to unstage a file during interactive rebase (remove file from old commit)?</h1>
<p>I've read in <em>Pro Git</em> book about interactive rebases to change several commits. So I'm doing <code>git rebase HEAD~3</code>, changed one which I wanted to amend to <code>edit</code>. Then I was able to change a message vi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,620 | git | # How to unstage a file during interactive rebase (remove file from old commit)?
I've read in *Pro Git* book about interactive rebases to change several commits. So I'm doing `git rebase HEAD~3`, changed one which I wanted to amend to `edit`. Then I was able to change a message via `git commit --amend`. And added a fi... | When you talk about *removing a file* during interactive rebase, you might mean one of two things:
- Making the file *match the previous commit*. Some would call this *removing the changes to the file*, and since some people think of commits *as* changes, some people will then shorten this to *removing the file*.
- Li... |
67660403 | Shouldn't I git ignore cdk.out folder which is made by AWS CDK? | 11 | 2021-05-23 13:39:13 | <p>AWS CDK create <code>cdk.out</code> project root. I don't know if I should add git files.</p>
| 6,755 | 12,500,881 | 2023-05-17 02:55:05 | 67,660,518 | 16 | 2021-05-23 13:54:17 | 3,100,287 | 2021-05-23 13:54:17 | https://stackoverflow.com/q/67660403 | https://stackoverflow.com/a/67660518 | <p>If you use <code>cdk init app</code>, you see that cdk.out folder is in .gitignore.</p>
<pre><code>*.js
!jest.config.js
*.d.ts
node_modules
# CDK asset staging directory
.cdk.staging
cdk.out
</code></pre>
| <p>If you use <code>cdk init app</code>, you see that cdk.out folder is in .gitignore.</p> <pre><code>*.js !jest.config.js *.d.ts node_modules # CDK asset staging directory .cdk.staging cdk.out </code></pre> | 119, 25056, 33388, 133995 | amazon-web-services, aws-cdk, git, gitignore | <h1>Shouldn't I git ignore cdk.out folder which is made by AWS CDK?</h1>
<p>AWS CDK create <code>cdk.out</code> project root. I don't know if I should add git files.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,622 | git | # Shouldn't I git ignore cdk.out folder which is made by AWS CDK?
AWS CDK create `cdk.out` project root. I don't know if I should add git files. | If you use `cdk init app`, you see that cdk.out folder is in .gitignore.
```
*.js
!jest.config.js
*.d.ts
node_modules
# CDK asset staging directory
.cdk.staging
cdk.out
``` |
36727469 | Bitbucket CRLF issue? | 11 | 2016-04-19 19:16:32 | <p><strong>Issue:</strong>
Bitbucket shows that the entire file has changed even though I dont see any differences. And there are no merge conflicts in these files.</p>
<p><strong>Details:</strong>
I created a sprint branch (named "sprintbranch") and the developers created a feature branch(named "featurebranchX") fro... | 20,098 | 3,410,663 | 2020-08-20 10:41:06 | 36,729,958 | 16 | 2016-04-19 21:38:17 | 729,539 | 2020-08-20 10:41:06 | https://stackoverflow.com/q/36727469 | https://stackoverflow.com/a/36729958 | <p>Even though Bitbucket can ignore whitespace in diffs (using the <code>w=1</code> query parameter), those changes will still be included in the merge.</p>
<p>But you can configure git to convert all line endings to either LF or CRLF. Your team should first decide which option it will be, and then set the <code>text</... | <p>Even though Bitbucket can ignore whitespace in diffs (using the <code>w=1</code> query parameter), those changes will still be included in the merge.</p> <p>But you can configure git to convert all line endings to either LF or CRLF. Your team should first decide which option it will be, and then set the <code>text</... | 119, 717, 8337, 64512 | bitbucket, git, merge, pull-request | <h1>Bitbucket CRLF issue?</h1>
<p><strong>Issue:</strong>
Bitbucket shows that the entire file has changed even though I dont see any differences. And there are no merge conflicts in these files.</p>
<p><strong>Details:</strong>
I created a sprint branch (named "sprintbranch") and the developers created a feature bra... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,628 | git | # Bitbucket CRLF issue?
**Issue:**
Bitbucket shows that the entire file has changed even though I dont see any differences. And there are no merge conflicts in these files.
**Details:**
I created a sprint branch (named "sprintbranch") and the developers created a feature branch(named "featurebranchX") from the sprint... | Even though Bitbucket can ignore whitespace in diffs (using the `w=1` query parameter), those changes will still be included in the merge.
But you can configure git to convert all line endings to either LF or CRLF. Your team should first decide which option it will be, and then set the `text` property in the `.gitattr... |
32454353 | set a Git config recursively for all submodules | 11 | 2015-09-08 09:41:40 | <p>I need to run the command:</p>
<pre><code>git config core.filemode false
</code></pre>
<p>The problem is that I have a few projects with at least ten submodules each. For some reason, all the submodules have that value set to true so I would have to remove/update that config manually.</p>
<p>Is there a way to tel... | 3,852 | 3,219,816 | 2017-08-16 08:57:25 | 32,455,407 | 16 | 2015-09-08 10:30:35 | 1,228,454 | 2017-08-16 08:57:25 | https://stackoverflow.com/q/32454353 | https://stackoverflow.com/a/32455407 | <p>You can use the <code>git submodule foreach</code> command for this: <a href="https://www.kernel.org/pub/software/scm/git/docs/v1.6.1.3/git-submodule.html" rel="noreferrer">https://www.kernel.org/pub/software/scm/git/docs/v1.6.1.3/git-submodule.html</a></p>
<p>You can provide an arbitrary shell command as a paramet... | <p>You can use the <code>git submodule foreach</code> command for this: <a href="https://www.kernel.org/pub/software/scm/git/docs/v1.6.1.3/git-submodule.html" rel="noreferrer">https://www.kernel.org/pub/software/scm/git/docs/v1.6.1.3/git-submodule.html</a></p> <p>You can provide an arbitrary shell command as a paramet... | 119, 32868 | git, git-config | <h1>set a Git config recursively for all submodules</h1>
<p>I need to run the command:</p>
<pre><code>git config core.filemode false
</code></pre>
<p>The problem is that I have a few projects with at least ten submodules each. For some reason, all the submodules have that value set to true so I would have to remove/u... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,629 | git | # set a Git config recursively for all submodules
I need to run the command:
```
git config core.filemode false
```
The problem is that I have a few projects with at least ten submodules each. For some reason, all the submodules have that value set to true so I would have to remove/update that config manually.
Is t... | You can use the `git submodule foreach` command for this: <https://www.kernel.org/pub/software/scm/git/docs/v1.6.1.3/git-submodule.html>
You can provide an arbitrary shell command as a parameter, in your case something like this:
```
git submodule foreach --recursive git config core.filemode false
```
This will exec... |
32071351 | Gitignore - Ignore only images & ignore everything except .. in single command | 11 | 2015-08-18 11:37:28 | <p>How can I write to .gitignore:</p>
<ol>
<li><p>to ignore only images ( .jpg, .jpeg, .png, .gif )</p></li>
<li><p>to ignore everything except videos ( .mp4, .flv etc )</p></li>
</ol>
<p>using a single command each time?</p>
| 23,783 | 1,483,422 | 2015-08-18 12:09:19 | 32,072,038 | 16 | 2015-08-18 12:09:19 | 1,993,501 | 2015-08-18 12:09:19 | https://stackoverflow.com/q/32071351 | https://stackoverflow.com/a/32072038 | <h1>1 Ignore images</h1>
<pre><code>printf '*.jpg\n*.jpeg\n*.png\n*.gif\n' >> .gitignore
</code></pre>
<h1>2 Ignore everything but videos:</h1>
<p>See <a href="https://stackoverflow.com/questions/1248570/git-ignore-everything-except-subdirectory">How do I tell Git to ignore everything except a subdirectory?</a... | <h1>1 Ignore images</h1> <pre><code>printf '*.jpg\n*.jpeg\n*.png\n*.gif\n' >> .gitignore </code></pre> <h1>2 Ignore everything but videos:</h1> <p>See <a href="https://stackoverflow.com/questions/1248570/git-ignore-everything-except-subdirectory">How do I tell Git to ignore everything except a subdirectory?</a... | 119, 25056 | git, gitignore | <h1>Gitignore - Ignore only images & ignore everything except .. in single command</h1>
<p>How can I write to .gitignore:</p>
<ol>
<li><p>to ignore only images ( .jpg, .jpeg, .png, .gif )</p></li>
<li><p>to ignore everything except videos ( .mp4, .flv etc )</p></li>
</ol>
<p>using a single command each time?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,630 | git | # Gitignore - Ignore only images & ignore everything except .. in single command
How can I write to .gitignore:
1. to ignore only images ( .jpg, .jpeg, .png, .gif )
2. to ignore everything except videos ( .mp4, .flv etc )
using a single command each time? | # 1 Ignore images
```
printf '*.jpg\n*.jpeg\n*.png\n*.gif\n' >> .gitignore
```
# 2 Ignore everything but videos:
See [How do I tell Git to ignore everything except a subdirectory?](https://stackoverflow.com/questions/1248570/git-ignore-everything-except-subdirectory)
```
printf '*\n!*.mp4\n!*.flv\n' >> .gitignore
`... |
30616681 | xargs (or something else) without space before parameter | 11 | 2015-06-03 09:53:54 | <p>I would like to execute something like this (git squash):</p>
<pre><code>git rebase -i HEAD~3
</code></pre>
<p>extracting the 3 from <code>git log</code>:</p>
<pre><code>git log | blabla | xargs git rebase -i HEAD~
</code></pre>
<p>This does not work because xargs inserts a space after <code>HEAD~</code>.</p>
<... | 4,362 | 1,153,600 | 2015-06-03 10:06:26 | 30,616,989 | 16 | 2015-06-03 10:06:26 | 1,030,675 | 2015-06-03 10:06:26 | https://stackoverflow.com/q/30616681 | https://stackoverflow.com/a/30616989 | <p>You can use the <code>-I</code> option of <code>xargs</code>:</p>
<pre><code>git log | blabla | xargs -I% git rebase -i HEAD~%
</code></pre>
| <p>You can use the <code>-I</code> option of <code>xargs</code>:</p> <pre><code>git log | blabla | xargs -I% git rebase -i HEAD~% </code></pre> | 58, 119, 10326, 98455 | git, git-squash, linux, xargs | <h1>xargs (or something else) without space before parameter</h1>
<p>I would like to execute something like this (git squash):</p>
<pre><code>git rebase -i HEAD~3
</code></pre>
<p>extracting the 3 from <code>git log</code>:</p>
<pre><code>git log | blabla | xargs git rebase -i HEAD~
</code></pre>
<p>This does not w... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,631 | git | # xargs (or something else) without space before parameter
I would like to execute something like this (git squash):
```
git rebase -i HEAD~3
```
extracting the 3 from `git log`:
```
git log | blabla | xargs git rebase -i HEAD~
```
This does not work because xargs inserts a space after `HEAD~`.
The problem is tha... | You can use the `-I` option of `xargs`:
```
git log | blabla | xargs -I% git rebase -i HEAD~%
``` |
30551100 | How to abandon changes? | 11 | 2015-05-30 20:33:43 | <p>I often work from OpenSSL's git repo. One of the things I test my changes against is a clean copy by issuing <code>make clean; make dclean</code>.</p>
<p>When I performs <code>git pull</code>, git always fails because of all the developer cruft that's removed with <code>dclean</code> (see below). When it fails, git... | 13,867 | 608,639 | 2015-05-31 22:50:38 | 30,551,125 | 16 | 2015-05-30 20:35:58 | null | 2015-05-30 20:35:58 | https://stackoverflow.com/q/30551100 | https://stackoverflow.com/a/30551125 | <p>To sync back with the HEAD, it's</p>
<pre><code>git reset --hard HEAD
</code></pre>
| <p>To sync back with the HEAD, it's</p> <pre><code>git reset --hard HEAD </code></pre> | 119 | git | <h1>How to abandon changes?</h1>
<p>I often work from OpenSSL's git repo. One of the things I test my changes against is a clean copy by issuing <code>make clean; make dclean</code>.</p>
<p>When I performs <code>git pull</code>, git always fails because of all the developer cruft that's removed with <code>dclean</code... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,632 | git | # How to abandon changes?
I often work from OpenSSL's git repo. One of the things I test my changes against is a clean copy by issuing `make clean; make dclean`.
When I performs `git pull`, git always fails because of all the developer cruft that's removed with `dclean` (see below). When it fails, git tells me to *"c... | To sync back with the HEAD, it's
```
git reset --hard HEAD
``` |
26531108 | docker add cache when git checkout same file | 11 | 2014-10-23 15:01:31 | <p>I need checkout project in my CI server build image reusing docker cache.</p>
<p>Docker ADD not use cache when checkout same file.</p>
<p>I am in git branch <strong>A</strong> execute <code>docker build -t somename .</code> it use docker cache normally, but if I go to branch <strong>B</strong> via <code>git checko... | 4,759 | 818,094 | 2016-01-17 06:48:33 | 26,612,694 | 16 | 2014-10-28 15:49:49 | 687,783 | 2016-01-17 06:48:33 | https://stackoverflow.com/q/26531108 | https://stackoverflow.com/a/26612694 | <p>Docker invalidates the docker build cache when a file's mtime value has changed, and git does not track file mtime values. This cache invalidation also shows up in other situations too, like in continuous integration or build environments involving docker, git and branches.</p>
<p>I have been using a "touch" target... | <p>Docker invalidates the docker build cache when a file's mtime value has changed, and git does not track file mtime values. This cache invalidation also shows up in other situations too, like in continuous integration or build environments involving docker, git and branches.</p> <p>I have been using a "touch" target... | 119, 90304 | docker, git | <h1>docker add cache when git checkout same file</h1>
<p>I need checkout project in my CI server build image reusing docker cache.</p>
<p>Docker ADD not use cache when checkout same file.</p>
<p>I am in git branch <strong>A</strong> execute <code>docker build -t somename .</code> it use docker cache normally, but if ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,634 | git | # docker add cache when git checkout same file
I need checkout project in my CI server build image reusing docker cache.
Docker ADD not use cache when checkout same file.
I am in git branch **A** execute `docker build -t somename .` it use docker cache normally, but if I go to branch **B** via `git checkout B`, do n... | Docker invalidates the docker build cache when a file's mtime value has changed, and git does not track file mtime values. This cache invalidation also shows up in other situations too, like in continuous integration or build environments involving docker, git and branches.
I have been using a "touch" target in a Make... |
25170098 | Re-open deleted Git branch | 11 | 2014-08-06 21:00:57 | <p>I'm using <a href="http://nvie.com/posts/a-successful-git-branching-model/" rel="noreferrer">git flow</a> for my project and I had to make a <code>hotfix</code> branch. When it was completed, I made a pull request to merge it into <code>master</code> and then deleted the branch.</p>
<p>I've since realized that it a... | 12,053 | 2,045,366 | 2014-08-07 02:32:49 | 25,170,231 | 16 | 2014-08-06 21:08:23 | 893 | 2014-08-07 02:32:49 | https://stackoverflow.com/q/25170098 | https://stackoverflow.com/a/25170231 | <p>Deleting a branch just removes the label that was attached to the commit. The commit that used to be the head of the branch is still present. You just need to put the label back.</p>
<p>If you merged <code>hotfix</code> into <code>master</code> and it created a merge commit at <code>aabbcc</code>, then you can resu... | <p>Deleting a branch just removes the label that was attached to the commit. The commit that used to be the head of the branch is still present. You just need to put the label back.</p> <p>If you merged <code>hotfix</code> into <code>master</code> and it created a merge commit at <code>aabbcc</code>, then you can resu... | 119, 456, 717, 64339, 64512 | git, git-flow, merge, pull-request, version-control | <h1>Re-open deleted Git branch</h1>
<p>I'm using <a href="http://nvie.com/posts/a-successful-git-branching-model/" rel="noreferrer">git flow</a> for my project and I had to make a <code>hotfix</code> branch. When it was completed, I made a pull request to merge it into <code>master</code> and then deleted the branch.</... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,635 | git | # Re-open deleted Git branch
I'm using [git flow](http://nvie.com/posts/a-successful-git-branching-model/) for my project and I had to make a `hotfix` branch. When it was completed, I made a pull request to merge it into `master` and then deleted the branch.
I've since realized that it also needed to be merged into `... | Deleting a branch just removes the label that was attached to the commit. The commit that used to be the head of the branch is still present. You just need to put the label back.
If you merged `hotfix` into `master` and it created a merge commit at `aabbcc`, then you can resurrect `hotfix` using:
```
git branch hotfi... |
8551278 | Issues with Git (HEAD points to an unborn branch (master)) | 11 | 2011-12-18 11:01:50 | <p>I have a Git repository with 'master' branch.
Some time ago (few months), we stopped using master, and created a new branch that all work is being done on.</p>
<p>I am now setting up source indexing with git, and for some reason i am seeing weird stuff with the new branch:</p>
<ol>
<li><p>Running <em>git log</em> ... | 44,868 | 494,143 | 2022-12-12 16:33:16 | 8,551,708 | 16 | 2011-12-18 12:31:38 | 19,563 | 2022-12-12 16:33:16 | https://stackoverflow.com/q/8551278 | https://stackoverflow.com/a/8551708 | <p>You don't have to have a master branch, but you do have to have a "default" branch in any git repository. In a non-bare repository, this is the checked-out branch; in a bare repository, it just means it's the default branch checked out for clones.</p>
<p>This default branch is called <code>HEAD</code>, and... | <p>You don't have to have a master branch, but you do have to have a "default" branch in any git repository. In a non-bare repository, this is the checked-out branch; in a bare repository, it just means it's the default branch checked out for clones.</p> <p>This default branch is called <code>HEAD</code>, and... | 119 | git | <h1>Issues with Git (HEAD points to an unborn branch (master))</h1>
<p>I have a Git repository with 'master' branch.
Some time ago (few months), we stopped using master, and created a new branch that all work is being done on.</p>
<p>I am now setting up source indexing with git, and for some reason i am seeing weird s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,639 | git | # Issues with Git (HEAD points to an unborn branch (master))
I have a Git repository with 'master' branch.
Some time ago (few months), we stopped using master, and created a new branch that all work is being done on.
I am now setting up source indexing with git, and for some reason i am seeing weird stuff with the ne... | You don't have to have a master branch, but you do have to have a "default" branch in any git repository. In a non-bare repository, this is the checked-out branch; in a bare repository, it just means it's the default branch checked out for clones.
This default branch is called `HEAD`, and must always exist in a valid ... |
7804170 | Escaping alias commands in a gitconfig files | 11 | 2011-10-18 08:05:12 | <p>I'm trying to add an alias command to my gitconfig file and it reports "bad config file" on the line I've added. I suspect it's something to do with the <code>sed</code> command and some escaping issues, but I don't know exactly what it's supposed to be. Here's the command, with linebreaks added for legibility:</p>
... | 2,714 | 9,021 | 2011-10-18 08:20:01 | 7,804,313 | 16 | 2011-10-18 08:20:01 | 6,309 | 2011-10-18 08:20:01 | https://stackoverflow.com/q/7804170 | https://stackoverflow.com/a/7804313 | <p>I suspect it is more about the '<code>\</code>', which needs to be doubled.</p>
<p>I tried your alias with '<code>\\</code>' without any error message.</p>
<pre><code>impact = !git ls-files -z
| xargs -0n1 git blame -w -C
| sed -r 's/^[^(]+\\((.*) [0-9]{4}-.*/\\1/'
| sed -r 's/ +$//'
| ... | <p>I suspect it is more about the '<code>\</code>', which needs to be doubled.</p> <p>I tried your alias with '<code>\\</code>' without any error message.</p> <pre><code>impact = !git ls-files -z | xargs -0n1 git blame -w -C | sed -r 's/^[^(]+\\((.*) [0-9]{4}-.*/\\1/' | sed -r 's/ +$//' | ... | 119, 32868 | git, git-config | <h1>Escaping alias commands in a gitconfig files</h1>
<p>I'm trying to add an alias command to my gitconfig file and it reports "bad config file" on the line I've added. I suspect it's something to do with the <code>sed</code> command and some escaping issues, but I don't know exactly what it's supposed to be. Here's t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,640 | git | # Escaping alias commands in a gitconfig files
I'm trying to add an alias command to my gitconfig file and it reports "bad config file" on the line I've added. I suspect it's something to do with the `sed` command and some escaping issues, but I don't know exactly what it's supposed to be. Here's the command, with lin... | I suspect it is more about the '`\`', which needs to be doubled.
I tried your alias with '`\\`' without any error message.
```
impact = !git ls-files -z
| xargs -0n1 git blame -w -C
| sed -r 's/^[^(]+\\((.*) [0-9]{4}-.*/\\1/'
| sed -r 's/ +$//'
| sort -f
| uniq -c
| sort -nr
... |
7328449 | Add symlinks to git repository | 11 | 2011-09-07 03:05:46 | <p>I'm working on a little library and it depends on another github project.</p>
<p>I know that
<a href="http://github.com/ajaxorg/cloud9/tree/1b1401f/support" rel="noreferrer">some projects</a>
add symlinks. How exactly do you do that?</p>
| 12,919 | 143,273 | 2013-12-30 03:54:24 | 7,328,585 | 16 | 2011-09-07 03:30:56 | 101,090 | 2011-09-07 03:30:56 | https://stackoverflow.com/q/7328449 | https://stackoverflow.com/a/7328585 | <p>What you'll want to use are <a href="http://help.github.com/submodules/" rel="noreferrer">git submodules</a>.</p>
<p>Example: <code>git submodule add git://github.com/user/project.git destination-dir/</code></p>
| <p>What you'll want to use are <a href="http://help.github.com/submodules/" rel="noreferrer">git submodules</a>.</p> <p>Example: <code>git submodule add git://github.com/user/project.git destination-dir/</code></p> | 119 | git | <h1>Add symlinks to git repository</h1>
<p>I'm working on a little library and it depends on another github project.</p>
<p>I know that
<a href="http://github.com/ajaxorg/cloud9/tree/1b1401f/support" rel="noreferrer">some projects</a>
add symlinks. How exactly do you do that?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,641 | git | # Add symlinks to git repository
I'm working on a little library and it depends on another github project.
I know that
[some projects](http://github.com/ajaxorg/cloud9/tree/1b1401f/support)
add symlinks. How exactly do you do that? | What you'll want to use are [git submodules](http://help.github.com/submodules/).
Example: `git submodule add git://github.com/user/project.git destination-dir/` |
645363 | Should I use git to deploy websites? | 11 | 2009-03-14 04:22:46 | <p>I have a site running on django, (but the question applies to anything, php, etc)</p>
<p>Currently I'm using <a href="http://www.cis.upenn.edu/~bcpierce/unison/" rel="nofollow noreferrer">unison</a> to deploy my changes, and I (kinda used to) love it because before that I was doing it manually!!</p>
<p>Now, as I'm... | 5,215 | 35,364 | 2009-04-11 19:54:00 | 740,695 | 16 | 2009-04-11 19:54:00 | 18,866 | 2009-04-11 19:54:00 | https://stackoverflow.com/q/645363 | https://stackoverflow.com/a/740695 | <p>I use git to track my website, and I deploy it like this:</p>
<pre><code>git archive --format=tar --prefix="homepage/" master | gzip | ssh webserver "tar xvz -C ~/public_html"
</code></pre>
<p>This deserves a little explanation. The archive command for git will export the files for the master branch, which gets co... | <p>I use git to track my website, and I deploy it like this:</p> <pre><code>git archive --format=tar --prefix="homepage/" master | gzip | ssh webserver "tar xvz -C ~/public_html" </code></pre> <p>This deserves a little explanation. The archive command for git will export the files for the master branch, which gets co... | 119, 190, 243, 1363 | deployment, django, git, project-management | <h1>Should I use git to deploy websites?</h1>
<p>I have a site running on django, (but the question applies to anything, php, etc)</p>
<p>Currently I'm using <a href="http://www.cis.upenn.edu/~bcpierce/unison/" rel="nofollow noreferrer">unison</a> to deploy my changes, and I (kinda used to) love it because before that... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,644 | git | # Should I use git to deploy websites?
I have a site running on django, (but the question applies to anything, php, etc)
Currently I'm using [unison](http://www.cis.upenn.edu/~bcpierce/unison/) to deploy my changes, and I (kinda used to) love it because before that I was doing it manually!!
Now, as I'm getting my fe... | I use git to track my website, and I deploy it like this:
```
git archive --format=tar --prefix="homepage/" master | gzip | ssh webserver "tar xvz -C ~/public_html"
```
This deserves a little explanation. The archive command for git will export the files for the master branch, which gets compressed with gzip to minim... |
62025535 | SourceTree on macOS keeps asking for SSH key password, or hangs if password is stored in keychain | 10 | 2020-05-26 15:19:34 | <p>I've been happily using SourceTree on my Mac for years and rarely had problems. A couple of weeks ago after updating macOS it suddenly stopped working altogether. Whenever I try to clone/fetch/push/pull/whatever to <strong>any</strong> of my Git repositories, SourceTree either</p>
<ol>
<li>keeps asking for my SSH k... | 12,352 | 5,375,652 | 2022-09-05 08:01:33 | 62,032,601 | 16 | 2020-05-26 22:45:17 | 5,375,652 | 2020-05-26 22:45:17 | https://stackoverflow.com/q/62025535 | https://stackoverflow.com/a/62032601 | <p>Thanks for the helpful reply and comments. Turns out SourceTree doesn't add the servers' fingerprints to the ~/.ssh/known_hosts file, and fails silently.</p>
<p>Easy fix - navigate to your repo folder on the command line and run a simple git command, for example:</p>
<pre><code>git fetch origin --dry-run
</code></... | <p>Thanks for the helpful reply and comments. Turns out SourceTree doesn't add the servers' fingerprints to the ~/.ssh/known_hosts file, and fails silently.</p> <p>Easy fix - navigate to your repo folder on the command line and run a simple git command, for example:</p> <pre><code>git fetch origin --dry-run </code></... | 119, 369, 90056 | atlassian-sourcetree, git, macos | <h1>SourceTree on macOS keeps asking for SSH key password, or hangs if password is stored in keychain</h1>
<p>I've been happily using SourceTree on my Mac for years and rarely had problems. A couple of weeks ago after updating macOS it suddenly stopped working altogether. Whenever I try to clone/fetch/push/pull/whateve... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,645 | git | # SourceTree on macOS keeps asking for SSH key password, or hangs if password is stored in keychain
I've been happily using SourceTree on my Mac for years and rarely had problems. A couple of weeks ago after updating macOS it suddenly stopped working altogether. Whenever I try to clone/fetch/push/pull/whatever to **an... | Thanks for the helpful reply and comments. Turns out SourceTree doesn't add the servers' fingerprints to the ~/.ssh/known_hosts file, and fails silently.
Easy fix - navigate to your repo folder on the command line and run a simple git command, for example:
```
git fetch origin --dry-run
```
Nothing will happen since... |
60643652 | How to format the number of digits for categorical variables in 'gtsummary::tbl_summary'? | 10 | 2020-03-11 19:59:55 | <p>I am unable to figure out how to tell the tbl_summary function to display decimal places when summarizing categorical variables. It works quite well with continuous variables like 'mpg', but not for 'cyl'.</p>
<pre class="lang-r prettyprint-override"><code>library(tidyverse)
library(gtsummary)
# with decimal place... | 10,093 | 12,660,631 | 2025-05-09 12:29:20 | 60,643,785 | 16 | 2020-03-11 20:11:27 | 8,711,276 | 2021-04-15 19:41:18 | https://stackoverflow.com/q/60643652 | https://stackoverflow.com/a/60643785 | <p>To update the number of digits the percentages are rounded to use the <code>digits=</code> argument. In the example below, pass <code>c(0, 2)</code>. The zero indicates to round the N to the nearest integer, and the 2 indicates to round the percentage to 2 decimal places.</p>
<p>Happy Coding!</p>
<pre class="lang-r ... | <p>To update the number of digits the percentages are rounded to use the <code>digits=</code> argument. In the example below, pass <code>c(0, 2)</code>. The zero indicates to round the N to the nearest integer, and the 2 indicates to round the percentage to 2 decimal places.</p> <p>Happy Coding!</p> <pre class="lang-r ... | 4452, 9914, 143082 | digits, gtsummary, r | <h1>How to format the number of digits for categorical variables in 'gtsummary::tbl_summary'?</h1>
<p>I am unable to figure out how to tell the tbl_summary function to display decimal places when summarizing categorical variables. It works quite well with continuous variables like 'mpg', but not for 'cyl'.</p>
<pre cl... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,646 | git | # How to format the number of digits for categorical variables in 'gtsummary::tbl_summary'?
I am unable to figure out how to tell the tbl_summary function to display decimal places when summarizing categorical variables. It works quite well with continuous variables like 'mpg', but not for 'cyl'.
```
library(tidyvers... | To update the number of digits the percentages are rounded to use the `digits=` argument. In the example below, pass `c(0, 2)`. The zero indicates to round the N to the nearest integer, and the 2 indicates to round the percentage to 2 decimal places.
Happy Coding!
```
library(gtsummary)
packageVersion("gtsummary")
#>... |
52828392 | How to git merge, but not using the latest commit | 10 | 2018-10-16 05:19:59 | <p>I have a <code>master</code> branch and a <code>develop</code> branch. The <code>develop</code> branch has moved ahead of the <code>master</code> by about 10 commits, but the version approved by the client included only the first 8 commits.</p>
<p>How do I merge only the first 8 commits from <code>develop</code> i... | 4,063 | 356,282 | 2018-10-16 18:58:04 | 52,828,447 | 16 | 2018-10-16 05:25:29 | 1,863,229 | 2018-10-16 05:25:29 | https://stackoverflow.com/q/52828392 | https://stackoverflow.com/a/52828447 | <p>You may merge via SHA-1 commit hash, e.g.</p>
<pre><code>git checkout master
git merge 3JH9sdx8
</code></pre>
<p>Where <code>3JH9sdx8</code> is the commit hash of <code>develop</code> from two commits prior to the HEAD of the branch. To find that <code>3JH9sdx8</code> hash, you could use <code>git log develop</co... | <p>You may merge via SHA-1 commit hash, e.g.</p> <pre><code>git checkout master git merge 3JH9sdx8 </code></pre> <p>Where <code>3JH9sdx8</code> is the commit hash of <code>develop</code> from two commits prior to the HEAD of the branch. To find that <code>3JH9sdx8</code> hash, you could use <code>git log develop</co... | 119, 28897 | git, git-merge | <h1>How to git merge, but not using the latest commit</h1>
<p>I have a <code>master</code> branch and a <code>develop</code> branch. The <code>develop</code> branch has moved ahead of the <code>master</code> by about 10 commits, but the version approved by the client included only the first 8 commits.</p>
<p>How do I... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,648 | git | # How to git merge, but not using the latest commit
I have a `master` branch and a `develop` branch. The `develop` branch has moved ahead of the `master` by about 10 commits, but the version approved by the client included only the first 8 commits.
How do I merge only the first 8 commits from `develop` into `master`?... | You may merge via SHA-1 commit hash, e.g.
```
git checkout master
git merge 3JH9sdx8
```
Where `3JH9sdx8` is the commit hash of `develop` from two commits prior to the HEAD of the branch. To find that `3JH9sdx8` hash, you could use `git log develop` and check. |
43497663 | Setting up SSH keys for github private repo access on Elastic Beanstalk | 10 | 2017-04-19 13:48:31 | <p>My Node.JS project contains references to private NPM repos hosted on github. This works fine locally, but I'm struggling to get this working on Elastic Beanstalk. </p>
<pre><code>dependencies: {
...
"express": "^4.12.4",
"jsonwebtoken": "^5.0.5",
"my-private-module": "git@github.com:<my-user>/<my-... | 3,707 | 1,226,020 | 2017-04-19 21:37:47 | 43,506,532 | 16 | 2017-04-19 21:37:47 | 1,226,020 | 2017-04-19 21:37:47 | https://stackoverflow.com/q/43497663 | https://stackoverflow.com/a/43506532 | <p>After a full day's struggle and finally stumbling over <a href="https://stackoverflow.com/a/31946019/1226020">this answer</a> to a very similar question I had previously missed, it turns out the correct place to put ssh keys in order to be picked up by git on EB is in <code>/root/.ssh</code>, <em>not</em> <code>/tmp... | <p>After a full day's struggle and finally stumbling over <a href="https://stackoverflow.com/a/31946019/1226020">this answer</a> to a very similar question I had previously missed, it turns out the correct place to put ssh keys in order to be picked up by git on EB is in <code>/root/.ssh</code>, <em>not</em> <code>/tmp... | 119, 386, 46426, 105747, 119118 | amazon-elastic-beanstalk, ebextensions, git, node.js, ssh | <h1>Setting up SSH keys for github private repo access on Elastic Beanstalk</h1>
<p>My Node.JS project contains references to private NPM repos hosted on github. This works fine locally, but I'm struggling to get this working on Elastic Beanstalk. </p>
<pre><code>dependencies: {
...
"express": "^4.12.4",
"jsonwe... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,649 | git | # Setting up SSH keys for github private repo access on Elastic Beanstalk
My Node.JS project contains references to private NPM repos hosted on github. This works fine locally, but I'm struggling to get this working on Elastic Beanstalk.
```
dependencies: {
...
"express": "^4.12.4",
"jsonwebtoken": "^5.0.5",
... | After a full day's struggle and finally stumbling over [this answer](https://stackoverflow.com/a/31946019/1226020) to a very similar question I had previously missed, it turns out the correct place to put ssh keys in order to be picked up by git on EB is in `/root/.ssh`, *not* `/tmp/.ssh`, *not* `/home/ec2-user/.ssh`.
... |
24993772 | How to find all refs that contain a commit in their history in git | 10 | 2014-07-28 10:58:06 | <p>Lets assume you have the following structure in git</p>
<pre><code> A <-- refs/heads/somebranch
|
B
| \
C D <-- refs/tags/TAG1
| |
E F
| | \
G H I <-- refs/heads/branch1
|
J <-- refs/heads/master
</code></pre>
<p>Now I want to find all r... | 5,231 | 974,186 | 2022-10-06 10:24:46 | 32,987,802 | 16 | 2015-10-07 08:51:21 | 6,309 | 2017-06-22 06:26:07 | https://stackoverflow.com/q/24993772 | https://stackoverflow.com/a/32987802 | <p>To add to torek's answer, git 2.7 (Q4 2015) will offer a more complete version of <a href="http://git-scm.com/docs/git-for-each-ref" rel="noreferrer"><code>git for-each-ref</code></a>, which now support the <code>--contains</code></p>
<pre><code>git for-each-ref --contains <SHA1>
</code></pre>
<hr>
<p>See <... | <p>To add to torek's answer, git 2.7 (Q4 2015) will offer a more complete version of <a href="http://git-scm.com/docs/git-for-each-ref" rel="noreferrer"><code>git for-each-ref</code></a>, which now support the <code>--contains</code></p> <pre><code>git for-each-ref --contains <SHA1> </code></pre> <hr> <p>See <... | 119, 60718, 76220 | git, git-branch, git-tag | <h1>How to find all refs that contain a commit in their history in git</h1>
<p>Lets assume you have the following structure in git</p>
<pre><code> A <-- refs/heads/somebranch
|
B
| \
C D <-- refs/tags/TAG1
| |
E F
| | \
G H I <-- refs/heads/branch1
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,651 | git | # How to find all refs that contain a commit in their history in git
Lets assume you have the following structure in git
```
A <-- refs/heads/somebranch
|
B
| \
C D <-- refs/tags/TAG1
| |
E F
| | \
G H I <-- refs/heads/branch1
|
J <-- refs/heads/maste... | To add to torek's answer, git 2.7 (Q4 2015) will offer a more complete version of [`git for-each-ref`](http://git-scm.com/docs/git-for-each-ref), which now support the `--contains`
```
git for-each-ref --contains <SHA1>
```
---
See [commit 4a71109](https://github.com/git/git/commit/4a71109aa442ba1a7045d36f6b148113c9... |
32147190 | Git GUI for AWS CodeCommit | 10 | 2015-08-21 18:33:12 | <p>Is there any good GUI that I can use with <a href="https://aws.amazon.com/codecommit/" rel="noreferrer">AWS CodeCommit</a> (Amazon's new Git Service)?</p>
<p>I've tried SmathGit and GitHub for windows.</p>
| 23,402 | 5,054,278 | 2015-08-23 13:50:24 | 32,167,343 | 16 | 2015-08-23 13:50:24 | 45,773 | 2015-08-23 13:50:24 | https://stackoverflow.com/q/32147190 | https://stackoverflow.com/a/32167343 | <p>While <a href="https://aws.amazon.com/codecommit/">AWS CodeCommit</a> supports the common Git connection protocols HTTPS and SSH, the details can be slightly peculiar and <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up.html">Setting Up for AWS CodeCommit</a> <em>will vary depending on wha... | <p>While <a href="https://aws.amazon.com/codecommit/">AWS CodeCommit</a> supports the common Git connection protocols HTTPS and SSH, the details can be slightly peculiar and <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up.html">Setting Up for AWS CodeCommit</a> <em>will vary depending on wha... | 119, 33388, 114185 | amazon-web-services, aws-codecommit, git | <h1>Git GUI for AWS CodeCommit</h1>
<p>Is there any good GUI that I can use with <a href="https://aws.amazon.com/codecommit/" rel="noreferrer">AWS CodeCommit</a> (Amazon's new Git Service)?</p>
<p>I've tried SmathGit and GitHub for windows.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,652 | git | # Git GUI for AWS CodeCommit
Is there any good GUI that I can use with [AWS CodeCommit](https://aws.amazon.com/codecommit/) (Amazon's new Git Service)?
I've tried SmathGit and GitHub for windows. | While [AWS CodeCommit](https://aws.amazon.com/codecommit/) supports the common Git connection protocols HTTPS and SSH, the details can be slightly peculiar and [Setting Up for AWS CodeCommit](https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up.html) *will vary depending on what connection protocol you wa... |
30390337 | Working on the same branch, how to pull without losing changes? | 10 | 2015-05-22 07:03:50 | <p>I am working on the same branch as my colleagues. Now I have committed some files and sent for code review and so has some other co-worker. Now he pushes his code before I do. I now need to pull his changes back and then add my changes. But it's already committed.</p>
<p>How do I get his changes and then add my cha... | 24,987 | 2,759,617 | 2015-05-22 08:31:23 | 30,390,416 | 16 | 2015-05-22 07:08:24 | 1,264,116 | 2015-05-22 08:16:29 | https://stackoverflow.com/q/30390337 | https://stackoverflow.com/a/30390416 | <p>You can use <code>git pull --rebase</code>. This will fetch your collegues commits and then put your commits (that you haven't pushed) on top of them, keeping the history looking good as well.</p>
<p>Edit: Cyril CHAPON made some good points in his comment. Take a look at some of his links to fully understand the h... | <p>You can use <code>git pull --rebase</code>. This will fetch your collegues commits and then put your commits (that you haven't pushed) on top of them, keeping the history looking good as well.</p> <p>Edit: Cyril CHAPON made some good points in his comment. Take a look at some of his links to fully understand the h... | 119, 28896, 53850 | git, git-commit, git-pull | <h1>Working on the same branch, how to pull without losing changes?</h1>
<p>I am working on the same branch as my colleagues. Now I have committed some files and sent for code review and so has some other co-worker. Now he pushes his code before I do. I now need to pull his changes back and then add my changes. But it'... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,653 | git | # Working on the same branch, how to pull without losing changes?
I am working on the same branch as my colleagues. Now I have committed some files and sent for code review and so has some other co-worker. Now he pushes his code before I do. I now need to pull his changes back and then add my changes. But it's already... | You can use `git pull --rebase`. This will fetch your collegues commits and then put your commits (that you haven't pushed) on top of them, keeping the history looking good as well.
Edit: Cyril CHAPON made some good points in his comment. Take a look at some of his links to fully understand the how rebase works and to... |
28569923 | git-clean with GitPython | 10 | 2015-02-17 19:50:11 | <p>Is there any way to do something like <code>git clean -d -x -f</code> using GitPython?</p>
<p>I need to reset working directories and want to get rid of all unversioned files without deleting the whole folder (except for <code>.git</code>) and checking out again.</p>
| 4,088 | 3,722,347 | 2025-02-27 07:56:07 | 28,570,053 | 16 | 2015-02-17 19:58:29 | 4,433,386 | 2024-11-06 20:26:50 | https://stackoverflow.com/q/28569923 | https://stackoverflow.com/a/28570053 | <p>You can work around by using the <code>git</code> command directly, from gitpython</p>
<p>More complete example:</p>
<pre class="lang-py prettyprint-override"><code>import git
repo = git.Repo("/path/to/repo")
repo.git.clean("-xdf")
</code></pre>
| <p>You can work around by using the <code>git</code> command directly, from gitpython</p> <p>More complete example:</p> <pre class="lang-py prettyprint-override"><code>import git repo = git.Repo("/path/to/repo") repo.git.clean("-xdf") </code></pre> | 16, 119, 61013, 68596 | git, git-clean, gitpython, python | <h1>git-clean with GitPython</h1>
<p>Is there any way to do something like <code>git clean -d -x -f</code> using GitPython?</p>
<p>I need to reset working directories and want to get rid of all unversioned files without deleting the whole folder (except for <code>.git</code>) and checking out again.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,654 | git | # git-clean with GitPython
Is there any way to do something like `git clean -d -x -f` using GitPython?
I need to reset working directories and want to get rid of all unversioned files without deleting the whole folder (except for `.git`) and checking out again. | You can work around by using the `git` command directly, from gitpython
More complete example:
```
import git
repo = git.Repo("/path/to/repo")
repo.git.clean("-xdf")
``` |
24684410 | Fast-forward, merge commit or merge to working tree, which is the right option to pick here? | 10 | 2014-07-10 19:06:11 | <p>I have a GIT repository with two branch <code>master</code> and <code>entidades</code>. I need to merge to <code>master</code> branch a few things from <code>entidades</code> branch. Take a look at image, the folder marked <code>EntityBundle</code> is the only thing I need to merge from <code>entidades</code> to <co... | 12,905 | 719,427 | 2014-07-11 12:41:15 | 24,691,976 | 16 | 2014-07-11 07:10:04 | 101,999 | 2014-07-11 07:10:04 | https://stackoverflow.com/q/24684410 | https://stackoverflow.com/a/24691976 | <p>I'm going to assume your history looks something like this:</p>
<pre><code>* A (master, origin/master)
|
| * B (entidades, origin/entidades)
| |
< some number of commits on either branch>
| |
|/
* D
</code></pre>
<p>(newer commits are on the top of that diagram, older on the bottom) In other words, <code>ent... | <p>I'm going to assume your history looks something like this:</p> <pre><code>* A (master, origin/master) | | * B (entidades, origin/entidades) | | < some number of commits on either branch> | | |/ * D </code></pre> <p>(newer commits are on the top of that diagram, older on the bottom) In other words, <code>ent... | 119, 717, 65939 | git, merge, smartgit | <h1>Fast-forward, merge commit or merge to working tree, which is the right option to pick here?</h1>
<p>I have a GIT repository with two branch <code>master</code> and <code>entidades</code>. I need to merge to <code>master</code> branch a few things from <code>entidades</code> branch. Take a look at image, the folder... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,655 | git | # Fast-forward, merge commit or merge to working tree, which is the right option to pick here?
I have a GIT repository with two branch `master` and `entidades`. I need to merge to `master` branch a few things from `entidades` branch. Take a look at image, the folder marked `EntityBundle` is the only thing I need to me... | I'm going to assume your history looks something like this:
```
* A (master, origin/master)
|
| * B (entidades, origin/entidades)
| |
< some number of commits on either branch>
| |
|/
* D
```
(newer commits are on the top of that diagram, older on the bottom) In other words, `entidades` diverged from master some time... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.