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
6399768
how to escape % at cmd setx?
7
2011-06-19 00:26:12
<p>I'm trying to set var by cmd script, but got some problem,</p> <pre><code>setx /M JAVA_HOME "D:\Tool\JDK" setx /M PATH "%PATH%;%JAVA_HOME%\bin;D:\TZProfile\!!!QuickLink\" </code></pre> <p>I want to add %JAVA_HOME%\bin to PATH, no "D:\Tool\JDK"</p>
2,272
537,353
2011-06-26 07:27:40
6,482,690
11
2011-06-26 07:27:40
526,535
2011-06-26 07:27:40
https://stackoverflow.com/q/6399768
https://stackoverflow.com/a/6482690
<p>On commandline use <code>^</code> to escape, like so</p> <pre><code>^%JAVA_HOME^% </code></pre> <p>In batch file, use <code>%</code> to escape, like so</p> <pre><code>%%JAVA_HOME%% </code></pre>
<p>On commandline use <code>^</code> to escape, like so</p> <pre><code>^%JAVA_HOME^% </code></pre> <p>In batch file, use <code>%</code> to escape, like so</p> <pre><code>%%JAVA_HOME%% </code></pre>
2631, 4963
cmd, window
<h1>how to escape % at cmd setx?</h1> <p>I'm trying to set var by cmd script, but got some problem,</p> <pre><code>setx /M JAVA_HOME "D:\Tool\JDK" setx /M PATH "%PATH%;%JAVA_HOME%\bin;D:\TZProfile\!!!QuickLink\" </code></pre> <p>I want to add %JAVA_HOME%\bin to PATH, no "D:\Tool\JDK"</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,639
cmd
# how to escape % at cmd setx? I'm trying to set var by cmd script, but got some problem, ``` setx /M JAVA_HOME "D:\Tool\JDK" setx /M PATH "%PATH%;%JAVA_HOME%\bin;D:\TZProfile\!!!QuickLink\" ``` I want to add %JAVA_HOME%\bin to PATH, no "D:\Tool\JDK"
On commandline use `^` to escape, like so ``` ^%JAVA_HOME^% ``` In batch file, use `%` to escape, like so ``` %%JAVA_HOME%% ```
3987582
Cmd : not evaluating variables inside a loop
7
2010-10-21 12:45:58
<p>trying to make a .bat script, and need to get some strings working properly.</p> <p>This is what I've got so far</p> <pre><code>@echo off for /r %%i in (*.csv) do ( set str=%%i set str=%str:csv=rar% echo %%i echo.%str% ) </code></pre> <p>Say I've got this running in C:\, and got 5 csv, 1.csv, 2.csv... 5.csv</p> ...
8,849
175,407
2010-10-21 12:58:31
3,987,648
11
2010-10-21 12:53:04
457,352
2010-10-21 12:53:04
https://stackoverflow.com/q/3987582
https://stackoverflow.com/a/3987648
<p>You should use <a href="http://batcheero.blogspot.com/2007/06/how-to-enabledelayedexpansion.html" rel="noreferrer"><code>setlocal enabledelayedexpansion</code></a>. Actually, the content of <code>%str:csv=rar%</code> is evaluated only once before the loop runs. So:</p> <pre><code>@echo off setlocal enabledelayedexp...
<p>You should use <a href="http://batcheero.blogspot.com/2007/06/how-to-enabledelayedexpansion.html" rel="noreferrer"><code>setlocal enabledelayedexpansion</code></a>. Actually, the content of <code>%str:csv=rar%</code> is evaluated only once before the loop runs. So:</p> <pre><code>@echo off setlocal enabledelayedexp...
2631, 7002
batch-file, cmd
<h1>Cmd : not evaluating variables inside a loop</h1> <p>trying to make a .bat script, and need to get some strings working properly.</p> <p>This is what I've got so far</p> <pre><code>@echo off for /r %%i in (*.csv) do ( set str=%%i set str=%str:csv=rar% echo %%i echo.%str% ) </code></pre> <p>Say I've got this runn...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,640
cmd
# Cmd : not evaluating variables inside a loop trying to make a .bat script, and need to get some strings working properly. This is what I've got so far ``` @echo off for /r %%i in (*.csv) do ( set str=%%i set str=%str:csv=rar% echo %%i echo.%str% ) ``` Say I've got this running in C:\, and got 5 csv, 1.csv, 2.csv....
You should use [`setlocal enabledelayedexpansion`](http://batcheero.blogspot.com/2007/06/how-to-enabledelayedexpansion.html). Actually, the content of `%str:csv=rar%` is evaluated only once before the loop runs. So: ``` @echo off setlocal enabledelayedexpansion for /r %%I in (*.csv) do ( set str=%%i set str=!str:csv=r...
41364220
How to run Spring Batch Jobs in certain order (Spring Boot)?
6
2016-12-28 14:38:06
<p>I'm developing with Spring Batch using Spring Boot.</p> <p>I'm with the minimal configuration provided by Spring Boot and defined some Jobs (no XML configuration at all). But when I run the application,</p> <pre><code>SpringApplication.run(App.class, args); </code></pre> <p>the jobs are sequentially executed in s...
25,658
6,108,874
2018-09-19 13:46:58
41,437,552
11
2017-01-03 06:19:49
3,850,730
2017-01-03 07:35:03
https://stackoverflow.com/q/41364220
https://stackoverflow.com/a/41437552
<p>1.You first disable automatic job start by specifying <code>spring.batch.job.enabled=false</code> in <strong>application.properties</strong></p> <p>2.In your main class, do - <code>ApplicationContext ctx = SpringApplication.run(SpringBatchMain.class, args);</code> assuming your main class is named - SpringBatchMai...
<p>1.You first disable automatic job start by specifying <code>spring.batch.job.enabled=false</code> in <strong>application.properties</strong></p> <p>2.In your main class, do - <code>ApplicationContext ctx = SpringApplication.run(SpringBatchMain.class, args);</code> assuming your main class is named - SpringBatchMai...
17, 1211, 41895, 95875
java, spring, spring-batch, spring-boot
<h1>How to run Spring Batch Jobs in certain order (Spring Boot)?</h1> <p>I'm developing with Spring Batch using Spring Boot.</p> <p>I'm with the minimal configuration provided by Spring Boot and defined some Jobs (no XML configuration at all). But when I run the application,</p> <pre><code>SpringApplication.run(App.c...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,644
cmd
# How to run Spring Batch Jobs in certain order (Spring Boot)? I'm developing with Spring Batch using Spring Boot. I'm with the minimal configuration provided by Spring Boot and defined some Jobs (no XML configuration at all). But when I run the application, ``` SpringApplication.run(App.class, args); ``` the jobs ...
1.You first disable automatic job start by specifying `spring.batch.job.enabled=false` in **application.properties** 2.In your main class, do - `ApplicationContext ctx = SpringApplication.run(SpringBatchMain.class, args);` assuming your main class is named - SpringBatchMain.java. This will initialize context without ...
37232408
change file extension in batch
6
2016-05-14 22:08:42
<p>Simple question. IMDU command do</p> <pre><code>imdu /b file.imd file.raw </code></pre> <p>and convert the file.imd on file.raw</p> <p>I have a lot of .imd so I need a batch. I have tried:</p> <pre><code>for %%x in (*.imd) do imdu /b %%x %%~nx.raw </code></pre> <p>But it doesn't work and creates a file called %%.raw...
17,829
3,970,561
2021-08-18 08:04:26
37,236,316
11
2016-05-15 08:58:31
3,074,564
2019-05-22 05:36:46
https://stackoverflow.com/q/37232408
https://stackoverflow.com/a/37236316
<p>Open a command prompt window, run <code>for /?</code> and read the output help carefully and completely.</p> <p>There is explained <code>%~xI</code> – only <em>file extension</em> of <code>%I</code> – and <code>%~nI</code> – only <em>file name</em> of <code>%I</code> – and <code>%~nxI</code> – <em>file name with ex...
<p>Open a command prompt window, run <code>for /?</code> and read the output help carefully and completely.</p> <p>There is explained <code>%~xI</code> – only <em>file extension</em> of <code>%I</code> – and <code>%~nI</code> – only <em>file name</em> of <code>%I</code> – and <code>%~nxI</code> – <em>file name with ex...
64, 2631, 7002
batch-file, cmd, windows
<h1>change file extension in batch</h1> <p>Simple question. IMDU command do</p> <pre><code>imdu /b file.imd file.raw </code></pre> <p>and convert the file.imd on file.raw</p> <p>I have a lot of .imd so I need a batch. I have tried:</p> <pre><code>for %%x in (*.imd) do imdu /b %%x %%~nx.raw </code></pre> <p>But it doesn...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,645
cmd
# change file extension in batch Simple question. IMDU command do ``` imdu /b file.imd file.raw ``` and convert the file.imd on file.raw I have a lot of .imd so I need a batch. I have tried: ``` for %%x in (*.imd) do imdu /b %%x %%~nx.raw ``` But it doesn't work and creates a file called %%.raw I need a batch wh...
Open a command prompt window, run `for /?` and read the output help carefully and completely. There is explained `%~xI` – only *file extension* of `%I` – and `%~nI` – only *file name* of `%I` – and `%~nxI` – *file name with extension* of `%I`. Please note that it does not matter if the string assigned to case-sensitiv...
35650111
Windows batch curl to variable
6
2016-02-26 11:06:38
<p>My knowledge of Batch scripting in Windows is poor and I need some help.</p> <p>I'm trying to create a dynamic script for starting a selenium server from different EC2 instances.</p> <p>What I want to do is automatically run the following script when starting the server:</p> <pre><code>cd C:\curl-7.47.1-win64-min...
18,686
5,729,951
2020-08-16 13:14:43
35,650,267
11
2016-02-26 11:14:44
5,739,035
2020-08-16 13:14:43
https://stackoverflow.com/q/35650111
https://stackoverflow.com/a/35650267
<p>Try this if directly using in console:</p> <pre><code>for /F %I in ('curl http://ipecho.net/plain') do set ip=%I echo %ip% </code></pre> <p>or you can Try this if writing a batch script (.bat):</p> <pre><code>for /F %%I in ('curl http://ipecho.net/plain') do set ip=%%I echo %ip% </code></pre>
<p>Try this if directly using in console:</p> <pre><code>for /F %I in ('curl http://ipecho.net/plain') do set ip=%I echo %ip% </code></pre> <p>or you can Try this if writing a batch script (.bat):</p> <pre><code>for /F %%I in ('curl http://ipecho.net/plain') do set ip=%%I echo %ip% </code></pre>
64, 1104, 1554, 5163, 7002
batch-file, curl, selenium, system, windows
<h1>Windows batch curl to variable</h1> <p>My knowledge of Batch scripting in Windows is poor and I need some help.</p> <p>I'm trying to create a dynamic script for starting a selenium server from different EC2 instances.</p> <p>What I want to do is automatically run the following script when starting the server:</p>...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,646
cmd
# Windows batch curl to variable My knowledge of Batch scripting in Windows is poor and I need some help. I'm trying to create a dynamic script for starting a selenium server from different EC2 instances. What I want to do is automatically run the following script when starting the server: ``` cd C:\curl-7.47.1-win...
Try this if directly using in console: ``` for /F %I in ('curl http://ipecho.net/plain') do set ip=%I echo %ip% ``` or you can Try this if writing a batch script (.bat): ``` for /F %%I in ('curl http://ipecho.net/plain') do set ip=%%I echo %ip% ```
35226237
How to reduce quality of multiple JPEG image files using ffmpeg?
6
2016-02-05 14:10:48
<p>I want to reduce the quality of a bunch of images at the time. With <code>-q:v x</code> where x is a number between 1 and 30 (the bigger the number, the worse the quality). I'm able to save a lot of space even with <code>x=1</code>. Now, when it comes to process multiple files, I'm stuck.</p> <p>I've tried these tw...
27,282
4,777,323
2021-06-10 11:34:48
35,227,356
11
2016-02-05 15:08:42
4,777,323
2021-06-10 11:34:48
https://stackoverflow.com/q/35226237
https://stackoverflow.com/a/35227356
<p>Thanks to @Squashman for pointing out my stupid mistake. This is my solution to the problem for Windows batch script.</p> <pre><code>mkdir processed for %%F in (*.jpg) do ( ffmpeg -i &quot;%%F&quot; -q:v 10 &quot;processed\%%F&quot; ) </code></pre> <p>I got like a 80% of weight reduction.</p>
<p>Thanks to @Squashman for pointing out my stupid mistake. This is my solution to the problem for Windows batch script.</p> <pre><code>mkdir processed for %%F in (*.jpg) do ( ffmpeg -i &quot;%%F&quot; -q:v 10 &quot;processed\%%F&quot; ) </code></pre> <p>I got like a 80% of weight reduction.</p>
3847, 7002
batch-file, ffmpeg
<h1>How to reduce quality of multiple JPEG image files using ffmpeg?</h1> <p>I want to reduce the quality of a bunch of images at the time. With <code>-q:v x</code> where x is a number between 1 and 30 (the bigger the number, the worse the quality). I'm able to save a lot of space even with <code>x=1</code>. Now, when ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,647
cmd
# How to reduce quality of multiple JPEG image files using ffmpeg? I want to reduce the quality of a bunch of images at the time. With `-q:v x` where x is a number between 1 and 30 (the bigger the number, the worse the quality). I'm able to save a lot of space even with `x=1`. Now, when it comes to process multiple fi...
Thanks to @Squashman for pointing out my stupid mistake. This is my solution to the problem for Windows batch script. ``` mkdir processed for %%F in (*.jpg) do ( ffmpeg -i "%%F" -q:v 10 "processed\%%F" ) ``` I got like a 80% of weight reduction.
34087834
How can I run a Windows command and return true everytime?
6
2015-12-04 11:54:26
<p>My question is simple. I want to run a Windows command that always exits with a non-zero value on each run. I don't have access to command itself and want to manipulate the exit code when I call it. Sth like this:</p> <pre><code>C:\&gt;run.cmd || echo "OK" </code></pre> <p>How can I achieve this?</p> <p>Thanks in...
3,984
6,999,882
2015-12-04 12:14:49
34,088,194
11
2015-12-04 12:14:49
5,471,255
2015-12-04 12:14:49
https://stackoverflow.com/q/34087834
https://stackoverflow.com/a/34088194
<p>In Windows command line, "echo" is not interpreted as a command and return code is not calculated. Thus, you have to use some other command. For your case, below code would be allright:</p> <pre><code>C:\&gt;run.cmd || exit 0; </code></pre>
<p>In Windows command line, "echo" is not interpreted as a command and return code is not calculated. Thus, you have to use some other command. For your case, below code would be allright:</p> <pre><code>C:\&gt;run.cmd || exit 0; </code></pre>
64, 1231, 1796, 7002, 64999
batch-file, command, command-line, jenkins, windows
<h1>How can I run a Windows command and return true everytime?</h1> <p>My question is simple. I want to run a Windows command that always exits with a non-zero value on each run. I don't have access to command itself and want to manipulate the exit code when I call it. Sth like this:</p> <pre><code>C:\&gt;run.cmd || e...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,648
cmd
# How can I run a Windows command and return true everytime? My question is simple. I want to run a Windows command that always exits with a non-zero value on each run. I don't have access to command itself and want to manipulate the exit code when I call it. Sth like this: ``` C:\>run.cmd || echo "OK" ``` How can I...
In Windows command line, "echo" is not interpreted as a command and return code is not calculated. Thus, you have to use some other command. For your case, below code would be allright: ``` C:\>run.cmd || exit 0; ```
32532114
Getting past a protocol mismatch after a Telnet connection
6
2015-09-11 21:06:06
<p>This is what shows up: ssh-2.0-OpenSSH_6.2</p> <p>I am not entirely sure what this means. It occurs when I am trying to remotely connect to my mac from a different windows computer using telnet. What does it mean and what do I do to get past it? Do I type the password of the computer? I only get to type one...
29,635
3,242,747
2017-06-28 21:57:44
32,532,161
11
2015-09-11 21:09:57
5,283,426
2015-09-11 22:02:11
https://stackoverflow.com/q/32532114
https://stackoverflow.com/a/32532161
<p>You seem to be connecting to a ssh port by telnet. They are different protocols. try </p> <pre><code>ssh [HOST] </code></pre> <p>instead of </p> <pre><code>telnet [HOST] 22 </code></pre> <p>.</p>
<p>You seem to be connecting to a ssh port by telnet. They are different protocols. try </p> <pre><code>ssh [HOST] </code></pre> <p>instead of </p> <pre><code>telnet [HOST] 22 </code></pre> <p>.</p>
386, 2631, 3305, 6056, 15713
cmd, openssh, remote-connection, ssh, telnet
<h1>Getting past a protocol mismatch after a Telnet connection</h1> <p>This is what shows up: ssh-2.0-OpenSSH_6.2</p> <p>I am not entirely sure what this means. It occurs when I am trying to remotely connect to my mac from a different windows computer using telnet. What does it mean and what do I do to get pas...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,649
cmd
# Getting past a protocol mismatch after a Telnet connection This is what shows up: ssh-2.0-OpenSSH_6.2 I am not entirely sure what this means. It occurs when I am trying to remotely connect to my mac from a different windows computer using telnet. What does it mean and what do I do to get past it? Do I type the pass...
You seem to be connecting to a ssh port by telnet. They are different protocols. try ``` ssh [HOST] ``` instead of ``` telnet [HOST] 22 ``` .
29747539
Windows cmd echo / pipe is adding extra space at the end - how to trim it?
6
2015-04-20 12:10:58
<p>I'm working on a script that executes a command line application which requires user input at runtime (sadly command line arguments are not provided).</p> <p>So my first attempt looked like this:</p> <pre><code>@echo off (echo N echo %~dp0%SomeOther\Directory\ echo Y)|call "%~dp0%SomeDirectory\SadSoftware.exe" </c...
10,276
1,788,633
2015-04-20 15:30:18
29,747,723
11
2015-04-20 12:20:38
463,115
2015-04-20 15:30:18
https://stackoverflow.com/q/29747539
https://stackoverflow.com/a/29747723
<p><strong>Solution1: Linefeeds</strong></p> <p>You can use a linefeed to avoid the spaces.<br> The <code>rem.</code> is required to avoid problems with the injected <code>&amp;</code> by cmd.exe</p> <pre><code>SET LF=^ REM ** The two empts lines are required for the new line ** ( echo line1%%LF%%rem. echo line2%%...
<p><strong>Solution1: Linefeeds</strong></p> <p>You can use a linefeed to avoid the spaces.<br> The <code>rem.</code> is required to avoid problems with the injected <code>&amp;</code> by cmd.exe</p> <pre><code>SET LF=^ REM ** The two empts lines are required for the new line ** ( echo line1%%LF%%rem. echo line2%%...
64, 5813, 7002, 13824
batch-file, echo, pipe, windows
<h1>Windows cmd echo / pipe is adding extra space at the end - how to trim it?</h1> <p>I'm working on a script that executes a command line application which requires user input at runtime (sadly command line arguments are not provided).</p> <p>So my first attempt looked like this:</p> <pre><code>@echo off (echo N ec...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,650
cmd
# Windows cmd echo / pipe is adding extra space at the end - how to trim it? I'm working on a script that executes a command line application which requires user input at runtime (sadly command line arguments are not provided). So my first attempt looked like this: ``` @echo off (echo N echo %~dp0%SomeOther\Director...
**Solution1: Linefeeds** You can use a linefeed to avoid the spaces. The `rem.` is required to avoid problems with the injected `&` by cmd.exe ``` SET LF=^ REM ** The two empts lines are required for the new line ** ( echo line1%%LF%%rem. echo line2%%LF%%rem. echo line3%%LF%%rem. ) | sort ``` When a block is pi...
25194197
How can I detect whether Emacs is running in batch mode?
6
2014-08-08 00:10:04
<p>Sometimes I want to run emacs in batch mode, and in such cases I want to avoid doing certain things in my init, such as starting the emacs server. Is there any way to test from within Emacs Lisp whether Emacs is running in batch mode?</p>
539
125,921
2014-08-08 01:48:18
25,194,923
11
2014-08-08 01:48:18
1,191,643
2014-08-08 01:48:18
https://stackoverflow.com/q/25194197
https://stackoverflow.com/a/25194923
<p>From <a href="http://www.gnu.org/software/emacs/manual/html_node/elisp/Batch-Mode.html">http://www.gnu.org/software/emacs/manual/html_node/elisp/Batch-Mode.html</a></p> <p>-- Variable: <strong>noninteractive</strong></p> <pre><code>This variable is non-nil when Emacs is running in batch mode. </code></pre>
<p>From <a href="http://www.gnu.org/software/emacs/manual/html_node/elisp/Batch-Mode.html">http://www.gnu.org/software/emacs/manual/html_node/elisp/Batch-Mode.html</a></p> <p>-- Variable: <strong>noninteractive</strong></p> <pre><code>This variable is non-nil when Emacs is running in batch mode. </code></pre>
371, 30645
batch-processing, emacs
<h1>How can I detect whether Emacs is running in batch mode?</h1> <p>Sometimes I want to run emacs in batch mode, and in such cases I want to avoid doing certain things in my init, such as starting the emacs server. Is there any way to test from within Emacs Lisp whether Emacs is running in batch mode?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,651
cmd
# How can I detect whether Emacs is running in batch mode? Sometimes I want to run emacs in batch mode, and in such cases I want to avoid doing certain things in my init, such as starting the emacs server. Is there any way to test from within Emacs Lisp whether Emacs is running in batch mode?
From <http://www.gnu.org/software/emacs/manual/html_node/elisp/Batch-Mode.html> -- Variable: **noninteractive** ``` This variable is non-nil when Emacs is running in batch mode. ```
23169696
Batch - Compare variable with regular expression
6
2014-04-19 11:51:13
<p>I'm doing a batch script that has to check if there are some programs installed on the computer. For that, I execute <code>programName --version</code> and I store the output in a variable. The problem is when I try to compare with a regular expression (only to know if this program exists in the machine). I'm trying...
11,038
2,976,632
2014-04-19 12:51:38
23,170,295
11
2014-04-19 12:51:38
1,123,692
2014-04-19 12:51:38
https://stackoverflow.com/q/23169696
https://stackoverflow.com/a/23170295
<p>Batch/cmd does not support regexes directly. You have to use <code>findstr</code>for that, for example: </p> <p><code>echo %node% | findstr /r "[vV][0-9.]*" &gt;nul 2&gt;&amp;1 &amp;&amp; (echo contains) || (echo does not contain)</code> or</p> <p><code>echo %node% | findstr /r "[vV][0-9.]*" &gt;nul 2&gt;&amp;1 if...
<p>Batch/cmd does not support regexes directly. You have to use <code>findstr</code>for that, for example: </p> <p><code>echo %node% | findstr /r "[vV][0-9.]*" &gt;nul 2&gt;&amp;1 &amp;&amp; (echo contains) || (echo does not contain)</code> or</p> <p><code>echo %node% | findstr /r "[vV][0-9.]*" &gt;nul 2&gt;&amp;1 if...
18, 588, 2773, 7002
batch-file, comparison, if-statement, regex
<h1>Batch - Compare variable with regular expression</h1> <p>I'm doing a batch script that has to check if there are some programs installed on the computer. For that, I execute <code>programName --version</code> and I store the output in a variable. The problem is when I try to compare with a regular expression (only ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,652
cmd
# Batch - Compare variable with regular expression I'm doing a batch script that has to check if there are some programs installed on the computer. For that, I execute `programName --version` and I store the output in a variable. The problem is when I try to compare with a regular expression (only to know if this prog...
Batch/cmd does not support regexes directly. You have to use `findstr`for that, for example: `echo %node% | findstr /r "[vV][0-9.]*" >nul 2>&1 && (echo contains) || (echo does not contain)` or `echo %node% | findstr /r "[vV][0-9.]*" >nul 2>&1 if errorlevel 1 (echo does not contain) else (echo contains)` This trick d...
18434254
How to iterate over array in batch for key=value item
6
2013-08-25 22:11:23
<p>I have an array defined as <code>LIST=(a b c d e)</code>. The <code>a, b, c, d, e</code> are set as system variables, eg. <code>a=AAA, b=BBB</code>, etc.</p> <p>In a batch script, I would like to do a for loop looking like:</p> <pre><code>for %%i in %LIST% do echo %%i=%%%i% (unfortunately, this doesn't work) </cod...
17,347
2,716,326
2013-08-26 02:22:23
18,435,749
11
2013-08-26 02:22:23
2,128,947
2013-08-26 02:22:23
https://stackoverflow.com/q/18434254
https://stackoverflow.com/a/18435749
<pre><code>for %%i in %LIST% do CALL echo %%i=%%%%i%% </code></pre> <p>should solve your problem.</p>
<pre><code>for %%i in %LIST% do CALL echo %%i=%%%%i%% </code></pre> <p>should solve your problem.</p>
114, 2314, 2531, 7002
arrays, batch-file, for-loop, loops
<h1>How to iterate over array in batch for key=value item</h1> <p>I have an array defined as <code>LIST=(a b c d e)</code>. The <code>a, b, c, d, e</code> are set as system variables, eg. <code>a=AAA, b=BBB</code>, etc.</p> <p>In a batch script, I would like to do a for loop looking like:</p> <pre><code>for %%i in %L...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,654
cmd
# How to iterate over array in batch for key=value item I have an array defined as `LIST=(a b c d e)`. The `a, b, c, d, e` are set as system variables, eg. `a=AAA, b=BBB`, etc. In a batch script, I would like to do a for loop looking like: ``` for %%i in %LIST% do echo %%i=%%%i% (unfortunately, this doesn't work) ``...
``` for %%i in %LIST% do CALL echo %%i=%%%%i%% ``` should solve your problem.
17412150
batch regex the output of reg query command to a variable
6
2013-07-01 19:26:49
<p><strong>summary</strong></p> <p>I need to be able to find the DWORD value of a registry key and set a variable to it to run an if statement against it.</p> <p>how can i grab just the dword of a reg query so that i can work with it in the rest of my script?</p> <p><strong>reg query</strong></p> <pre><code>reg que...
18,954
561,621
2019-06-29 21:37:23
17,412,407
11
2013-07-01 19:43:01
2,468,910
2013-07-01 19:43:01
https://stackoverflow.com/q/17412150
https://stackoverflow.com/a/17412407
<p>try this: </p> <pre class="lang-none prettyprint-override"><code>@echo off &amp;setlocal for /f "tokens=2*" %%a in ('reg query HKLM\System\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile /v EnableFirewall') do set "var=%%b" if "%var%"=="0x1" (do this) else do that </code></pre>
<p>try this: </p> <pre class="lang-none prettyprint-override"><code>@echo off &amp;setlocal for /f "tokens=2*" %%a in ('reg query HKLM\System\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile /v EnableFirewall') do set "var=%%b" if "%var%"=="0x1" (do this) else do that </code></pre>
18, 64, 263, 3537, 7002
batch-file, dword, regex, registry, windows
<h1>batch regex the output of reg query command to a variable</h1> <p><strong>summary</strong></p> <p>I need to be able to find the DWORD value of a registry key and set a variable to it to run an if statement against it.</p> <p>how can i grab just the dword of a reg query so that i can work with it in the rest of my...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,655
cmd
# batch regex the output of reg query command to a variable **summary** I need to be able to find the DWORD value of a registry key and set a variable to it to run an if statement against it. how can i grab just the dword of a reg query so that i can work with it in the rest of my script? **reg query** ``` reg que...
try this: ``` @echo off &setlocal for /f "tokens=2*" %%a in ('reg query HKLM\System\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile /v EnableFirewall') do set "var=%%b" if "%var%"=="0x1" (do this) else do that ```
9483174
Comparing two folders for non identical files in CMD
6
2012-02-28 13:54:06
<p>What I need to do is to compare two folders for non identical files in CMD with <code>DOS</code> commands.</p> <p>When I find non identical files, I need to write them into a .txt file with full path so I can find out where these files are actually contained.</p> <p>So how can I achieve this?</p>
45,077
861,019
2021-09-27 18:44:24
9,483,222
11
2012-02-28 13:57:22
403,335
2021-09-27 18:44:24
https://stackoverflow.com/q/9483174
https://stackoverflow.com/a/9483222
<p>You could use the <code>comp</code> command: <a href="https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/comp" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/comp</a></p> <pre><code>comp C:\PathA\A C:\PathB\B &gt; C:\Comparison...
<p>You could use the <code>comp</code> command: <a href="https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/comp" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/comp</a></p> <pre><code>comp C:\PathA\A C:\PathB\B &gt; C:\Comparison...
218, 588, 2631, 5310
cmd, comparison, directory, file
<h1>Comparing two folders for non identical files in CMD</h1> <p>What I need to do is to compare two folders for non identical files in CMD with <code>DOS</code> commands.</p> <p>When I find non identical files, I need to write them into a .txt file with full path so I can find out where these files are actually conta...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,656
cmd
# Comparing two folders for non identical files in CMD What I need to do is to compare two folders for non identical files in CMD with `DOS` commands. When I find non identical files, I need to write them into a .txt file with full path so I can find out where these files are actually contained. So how can I achieve...
You could use the `comp` command: <https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/comp> ``` comp C:\PathA\A C:\PathB\B > C:\Comparison\comparison-between-A-B.txt ```
9480727
Dos Batches: write to files without a line ending
6
2012-02-28 11:04:41
<p>I have a situation while writing a dos batchs script. A tool I am using to calculate CRC (checksum) of a text string requires the text to be in a file. The data I am trying to get the CRC for is a filename, but when using a batch to put this filename into a text file to calculate CRC, the batch script naturally pu...
9,490
581,580
2012-02-28 12:33:14
9,481,968
11
2012-02-28 12:33:14
463,115
2012-02-28 12:33:14
https://stackoverflow.com/q/9480727
https://stackoverflow.com/a/9481968
<p><code>&lt;nul set /p ".=text" &gt; file</code> </p> <p>It's faster and safer than <code>echo.|set /P ="text" &gt; file</code></p> <p>The nul redirection is faster than a pipe with <code>echo.</code> (btw <code>echo.</code>can fail).<br> The style of the quotes allowes to output also quotes. </p> <p>But there ar...
<p><code>&lt;nul set /p ".=text" &gt; file</code> </p> <p>It's faster and safer than <code>echo.|set /P ="text" &gt; file</code></p> <p>The nul redirection is faster than a pipe with <code>echo.</code> (btw <code>echo.</code>can fail).<br> The style of the quotes allowes to output also quotes. </p> <p>But there ar...
3705, 5370, 7002, 17938
batch-file, dos, newline, text-files
<h1>Dos Batches: write to files without a line ending</h1> <p>I have a situation while writing a dos batchs script. A tool I am using to calculate CRC (checksum) of a text string requires the text to be in a file. The data I am trying to get the CRC for is a filename, but when using a batch to put this filename into ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,657
cmd
# Dos Batches: write to files without a line ending I have a situation while writing a dos batchs script. A tool I am using to calculate CRC (checksum) of a text string requires the text to be in a file. The data I am trying to get the CRC for is a filename, but when using a batch to put this filename into a text file...
`<nul set /p ".=text" > file` It's faster and safer than `echo.|set /P ="text" > file` The nul redirection is faster than a pipe with `echo.` (btw `echo.`can fail). The style of the quotes allowes to output also quotes. But there are always restrictions! Vista and Win7 have a "feature" to supress leading spaces,...
6697878
Get the file version of a dll or exe
6
2011-07-14 18:05:43
<blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="https://stackoverflow.com/questions/602802/command-line-tool-to-dump-windows-dll-version">Command line tool to dump Windows DLL version?</a><br> <a href="https://stackoverflow.com/questions/1706892/how-do-i-retrieve-the-version-of-a-file-from-a-ba...
20,415
845,162
2012-08-29 14:17:58
6,700,087
11
2011-07-14 21:22:03
798,277
2011-07-14 21:22:03
https://stackoverflow.com/q/6697878
https://stackoverflow.com/a/6700087
<p>Here's an example using sigcheck:</p> <pre><code>@ECHO OFF FOR /F "tokens=1-3" %%i IN ('p:\supporttools\sigcheck.exe p:\supporttools\procmon.exe') DO ( IF "%%i %%j"=="File version:" SET filever=%%k ) ECHO The version of the file is %filever% PAUSE </code></pre>
<p>Here's an example using sigcheck:</p> <pre><code>@ECHO OFF FOR /F "tokens=1-3" %%i IN ('p:\supporttools\sigcheck.exe p:\supporttools\procmon.exe') DO ( IF "%%i %%j"=="File version:" SET filever=%%k ) ECHO The version of the file is %filever% PAUSE </code></pre>
64, 7002
batch-file, windows
<h1>Get the file version of a dll or exe</h1> <blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="https://stackoverflow.com/questions/602802/command-line-tool-to-dump-windows-dll-version">Command line tool to dump Windows DLL version?</a><br> <a href="https://stackoverflow.com/questions/1706892/how...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,658
cmd
# Get the file version of a dll or exe > **Possible Duplicates:** > [Command line tool to dump Windows DLL version?](https://stackoverflow.com/questions/602802/command-line-tool-to-dump-windows-dll-version) > [How do I retrieve the version of a file from a batch file on Windows Vista?](https://stackoverflow.com/qu...
Here's an example using sigcheck: ``` @ECHO OFF FOR /F "tokens=1-3" %%i IN ('p:\supporttools\sigcheck.exe p:\supporttools\procmon.exe') DO ( IF "%%i %%j"=="File version:" SET filever=%%k ) ECHO The version of the file is %filever% PAUSE ```
6359587
Rename Multiple files with in Dos batch file
6
2011-06-15 14:44:43
<p>I wish to rename all files inside the folder *.txt, so the result will be "1.txt", "2.txt" and "3.txt", ....</p> <p>How can I do so?</p>
34,279
795,658
2021-10-10 11:22:05
6,360,436
11
2011-06-15 15:41:52
23,478
2011-06-15 20:00:31
https://stackoverflow.com/q/6359587
https://stackoverflow.com/a/6360436
<p>The following may accomplish what you are looking for. It uses a <code>for</code> loop to iterate through the text files and makes a "call" to another bit of the batch file to do the rename and increment of a variable.</p> <p><strong>Edit</strong> Change math operation to cleaner solution suggested by Andriy.</p> ...
<p>The following may accomplish what you are looking for. It uses a <code>for</code> loop to iterate through the text files and makes a "call" to another bit of the batch file to do the rename and increment of a variable.</p> <p><strong>Edit</strong> Change math operation to cleaner solution suggested by Andriy.</p> ...
64, 5370, 7002
batch-file, dos, windows
<h1>Rename Multiple files with in Dos batch file</h1> <p>I wish to rename all files inside the folder *.txt, so the result will be "1.txt", "2.txt" and "3.txt", ....</p> <p>How can I do so?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,659
cmd
# Rename Multiple files with in Dos batch file I wish to rename all files inside the folder *.txt, so the result will be "1.txt", "2.txt" and "3.txt", .... How can I do so?
The following may accomplish what you are looking for. It uses a `for` loop to iterate through the text files and makes a "call" to another bit of the batch file to do the rename and increment of a variable. **Edit** Change math operation to cleaner solution suggested by Andriy. ``` @echo off set i=1 for %%f in (*.tx...
6267526
Batch Script - Change Icon of a Folder on Desktop (Windows XP)
6
2011-06-07 15:21:19
<p>How would I go about changing a desktop folder's icon/image via the command line/batch script in windows xp?</p> <p>I will be creating an event in one of my scripts to change the icon to an image of an exclamation point when a new file is inserted into a folder to alert users.</p>
25,890
781,339
2017-01-16 03:40:39
6,279,348
11
2011-06-08 13:20:16
781,339
2017-01-16 03:40:39
https://stackoverflow.com/q/6267526
https://stackoverflow.com/a/6279348
<p>Save your image.ico to desktop.<br> The following will make a test folder on the desktop as well as the desktop.ini file linking the image file you wish to use.</p> <pre><code>CD "%userprofile%\desktop" MKDIR "TEST FOLDER" ATTRIB +s "TEST FOLDER" CD "TEST FOLDER" COPY /Y "%userprofile%\desktop\image.ico" "./image.i...
<p>Save your image.ico to desktop.<br> The following will make a test folder on the desktop as well as the desktop.ini file linking the image file you wish to use.</p> <pre><code>CD "%userprofile%\desktop" MKDIR "TEST FOLDER" ATTRIB +s "TEST FOLDER" CD "TEST FOLDER" COPY /Y "%userprofile%\desktop\image.ico" "./image.i...
218, 1004, 1231, 2216, 7002
batch-file, command-line, directory, icons, windows-xp
<h1>Batch Script - Change Icon of a Folder on Desktop (Windows XP)</h1> <p>How would I go about changing a desktop folder's icon/image via the command line/batch script in windows xp?</p> <p>I will be creating an event in one of my scripts to change the icon to an image of an exclamation point when a new file is inser...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,660
cmd
# Batch Script - Change Icon of a Folder on Desktop (Windows XP) How would I go about changing a desktop folder's icon/image via the command line/batch script in windows xp? I will be creating an event in one of my scripts to change the icon to an image of an exclamation point when a new file is inserted into a folde...
Save your image.ico to desktop. The following will make a test folder on the desktop as well as the desktop.ini file linking the image file you wish to use. ``` CD "%userprofile%\desktop" MKDIR "TEST FOLDER" ATTRIB +s "TEST FOLDER" CD "TEST FOLDER" COPY /Y "%userprofile%\desktop\image.ico" "./image.ico" ECHO [.Shell...
2112694
How do I get a for loop to work with a comma delimited string?
6
2010-01-21 20:38:10
<p>This is my code so far: </p> <pre><code>for /f "tokens=1 eol=," %%f IN ("1,2,3,4") do ( echo . echo %%f ) </code></pre> <p>I'm expecting that to produce: </p> <pre><code>. 1 . 2 . </code></pre> <p>etc... </p> <p>But instead I get: </p> <pre><code>. 1 </code></pre> <p>And that's it. What am I miss...
13,079
30,946
2016-04-05 19:31:29
2,112,883
11
2010-01-21 21:03:22
74,815
2010-01-21 21:03:22
https://stackoverflow.com/q/2112694
https://stackoverflow.com/a/2112883
<p>You've misunderstood the options.</p> <ul> <li><code>tokens=1</code> means you only want the first token on each line. You want all of the tokens on the line.</li> <li><code>eol=,</code> means you want to interpret a comma as the beginning of an <em>end of line comment</em>. You want to use <code>delims=,</code> ...
<p>You've misunderstood the options.</p> <ul> <li><code>tokens=1</code> means you only want the first token on each line. You want all of the tokens on the line.</li> <li><code>eol=,</code> means you want to interpret a comma as the beginning of an <em>end of line comment</em>. You want to use <code>delims=,</code> ...
64, 2631, 7002
batch-file, cmd, windows
<h1>How do I get a for loop to work with a comma delimited string?</h1> <p>This is my code so far: </p> <pre><code>for /f "tokens=1 eol=," %%f IN ("1,2,3,4") do ( echo . echo %%f ) </code></pre> <p>I'm expecting that to produce: </p> <pre><code>. 1 . 2 . </code></pre> <p>etc... </p> <p>But instead I g...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cmd%' OR '%batch%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,661
cmd
# How do I get a for loop to work with a comma delimited string? This is my code so far: ``` for /f "tokens=1 eol=," %%f IN ("1,2,3,4") do ( echo . echo %%f ) ``` I'm expecting that to produce: ``` . 1 . 2 . ``` etc... But instead I get: ``` . 1 ``` And that's it. What am I missing?
You've misunderstood the options. - `tokens=1` means you only want the first token on each line. You want all of the tokens on the line. - `eol=,` means you want to interpret a comma as the beginning of an *end of line comment*. You want to use `delims=,` instead to indicate the comma is the delimiter (instead of the ...
802573
Difference between GIT and CVS
149
2009-04-29 14:19:56
<p>What is the difference between Git and CVS version control systems? </p> <p>I have been happily using CVS for over 10 years, and now I have been told that Git is much better. Could someone please explain what the difference between the two is, and why one is better than the other?</p>
116,473
77,509
2023-02-25 17:25:03
824,241
380
2009-05-05 10:20:16
46,058
2023-02-25 17:25:03
https://stackoverflow.com/q/802573
https://stackoverflow.com/a/824241
<p>The main difference is that (as it was already said in other responses) CVS is (old) centralized version control system, while Git is distributed.</p> <p>But even if you use version control for single developer, on single machine (single account), there are a few differences between Git and CVS:</p> <ul> <li><p><str...
<p>The main difference is that (as it was already said in other responses) CVS is (old) centralized version control system, while Git is distributed.</p> <p>But even if you use version control for single developer, on single machine (single account), there are a few differences between Git and CVS:</p> <ul> <li><p><str...
119, 335, 456
cvs, git, version-control
<h1>Difference between GIT and CVS</h1> <p>What is the difference between Git and CVS version control systems? </p> <p>I have been happily using CVS for over 10 years, and now I have been told that Git is much better. Could someone please explain what the difference between the two is, and why one is better than the ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,662
cvs
# Difference between GIT and CVS What is the difference between Git and CVS version control systems? I have been happily using CVS for over 10 years, and now I have been told that Git is much better. Could someone please explain what the difference between the two is, and why one is better than the other?
The main difference is that (as it was already said in other responses) CVS is (old) centralized version control system, while Git is distributed. But even if you use version control for single developer, on single machine (single account), there are a few differences between Git and CVS: - **Setting up repository**....
4795600
Reverting part of a commit with git
189
2011-01-25 15:49:49
<p>I want to revert a particular commit in git. Unfortunately, our organization still uses CVS as a standard, so when I commit back to CVS multiple git commits are rolled into one. In this case I would love to single out the original git commit, but that is impossible.</p> <p>Is there an approach similar to <code>gi...
65,138
18,103
2022-06-27 04:40:45
4,796,144
287
2011-01-25 16:30:38
28,804
2014-05-28 13:04:43
https://stackoverflow.com/q/4795600
https://stackoverflow.com/a/4796144
<p>Use the <code>--no-commit</code> (<code>-n</code>) option to <code>git revert</code>, then unstage the changes, then use <code>git add --patch</code>:</p> <pre><code>$ git revert -n $bad_commit # Revert the commit, but don't commit the changes $ git reset HEAD . # Unstage the changes $ git add --patc...
<p>Use the <code>--no-commit</code> (<code>-n</code>) option to <code>git revert</code>, then unstage the changes, then use <code>git add --patch</code>:</p> <pre><code>$ git revert -n $bad_commit # Revert the commit, but don't commit the changes $ git reset HEAD . # Unstage the changes $ git add --patc...
119, 27069
git, git-cvs
<h1>Reverting part of a commit with git</h1> <p>I want to revert a particular commit in git. Unfortunately, our organization still uses CVS as a standard, so when I commit back to CVS multiple git commits are rolled into one. In this case I would love to single out the original git commit, but that is impossible.</p>...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,663
cvs
# Reverting part of a commit with git I want to revert a particular commit in git. Unfortunately, our organization still uses CVS as a standard, so when I commit back to CVS multiple git commits are rolled into one. In this case I would love to single out the original git commit, but that is impossible. Is there an a...
Use the `--no-commit` (`-n`) option to `git revert`, then unstage the changes, then use `git add --patch`: ``` $ git revert -n $bad_commit # Revert the commit, but don't commit the changes $ git reset HEAD . # Unstage the changes $ git add --patch . # Add whatever changes you want $ git commi...
584522
How to export revision history from mercurial or git to cvs?
99
2009-02-25 02:37:01
<p>I'm going to be working with other people on code from a project that uses cvs. We want to use a distributed vcs to make our work and when we finish or maybe every once in a while we want to commit our code and all of our revision history to cvs. We don't have write access to the project's cvs repo so we can't commi...
45,855
64,250
2013-09-25 20:28:53
586,225
236
2009-02-25 14:42:02
7,230
2011-06-29 23:25:27
https://stackoverflow.com/q/584522
https://stackoverflow.com/a/586225
<p>Fortunately for those of us who are still forced to use CVS, git provides pretty good tools to do exactly what you're wanting to do. My suggestions (and what we do here at $work):</p> <h2>Creating the Initial Clone</h2> <p>Use <code>git cvsimport</code> to clone the CVS revision history into a git repository. I us...
<p>Fortunately for those of us who are still forced to use CVS, git provides pretty good tools to do exactly what you're wanting to do. My suggestions (and what we do here at $work):</p> <h2>Creating the Initial Clone</h2> <p>Use <code>git cvsimport</code> to clone the CVS revision history into a git repository. I us...
119, 335, 802, 4167, 27069
cvs, export, git, git-cvs, mercurial
<h1>How to export revision history from mercurial or git to cvs?</h1> <p>I'm going to be working with other people on code from a project that uses cvs. We want to use a distributed vcs to make our work and when we finish or maybe every once in a while we want to commit our code and all of our revision history to cvs. ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,664
cvs
# How to export revision history from mercurial or git to cvs? I'm going to be working with other people on code from a project that uses cvs. We want to use a distributed vcs to make our work and when we finish or maybe every once in a while we want to commit our code and all of our revision history to cvs. We don't ...
Fortunately for those of us who are still forced to use CVS, git provides pretty good tools to do exactly what you're wanting to do. My suggestions (and what we do here at $work): ## Creating the Initial Clone Use `git cvsimport` to clone the CVS revision history into a git repository. I use the following invocation:...
2075568
CVS: show files that are locally changed
48
2010-01-16 00:07:43
<p>Is there any simple way to show only the files in my repository that have been locally added, removed, or modified? I know that I can type "cvs stat" and look through the list of files, but that is tedious and error-prone. I am wondering if there is an easier way. I am using CVS 1.11.17, in case that matters.</p>
46,036
28,324
2017-10-10 04:59:06
2,075,665
87
2010-01-16 00:32:16
19,563
2012-07-27 11:18:45
https://stackoverflow.com/q/2075568
https://stackoverflow.com/a/2075665
<p>A 'dummy' update will give you this information.</p> <pre><code>cvs -qn update </code></pre> <p>A short description of the used options:</p> <pre><code>-q Cause CVS to be somewhat quiet. -n Do not execute anything that will change the disk. </code></pre>
<p>A 'dummy' update will give you this information.</p> <pre><code>cvs -qn update </code></pre> <p>A short description of the used options:</p> <pre><code>-q Cause CVS to be somewhat quiet. -n Do not execute anything that will change the disk. </code></pre>
335
cvs
<h1>CVS: show files that are locally changed</h1> <p>Is there any simple way to show only the files in my repository that have been locally added, removed, or modified? I know that I can type "cvs stat" and look through the list of files, but that is tedious and error-prone. I am wondering if there is an easier way. I ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,665
cvs
# CVS: show files that are locally changed Is there any simple way to show only the files in my repository that have been locally added, removed, or modified? I know that I can type "cvs stat" and look through the list of files, but that is tedious and error-prone. I am wondering if there is an easier way. I am using ...
A 'dummy' update will give you this information. ``` cvs -qn update ``` A short description of the used options: ``` -q Cause CVS to be somewhat quiet. -n Do not execute anything that will change the disk. ```
15704945
How do I revert a modified file using CVS?
54
2013-03-29 14:09:58
<p>I have checked out a file from CVS repository and changed it.</p> <p><code>cvs up</code> command says that the file is modified <code>M</code>.</p> <p>I need to delete my changes. What cvs command can do it for me?</p>
46,006
1,356,110
2019-09-30 17:13:31
16,077,358
83
2013-04-18 07:51:15
2,281,201
2013-04-18 07:51:15
https://stackoverflow.com/q/15704945
https://stackoverflow.com/a/16077358
<p>You use </p> <pre><code>cvs update -C filename </code></pre>
<p>You use </p> <pre><code>cvs update -C filename </code></pre>
335, 12309
cvs, revert
<h1>How do I revert a modified file using CVS?</h1> <p>I have checked out a file from CVS repository and changed it.</p> <p><code>cvs up</code> command says that the file is modified <code>M</code>.</p> <p>I need to delete my changes. What cvs command can do it for me?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,666
cvs
# How do I revert a modified file using CVS? I have checked out a file from CVS repository and changed it. `cvs up` command says that the file is modified `M`. I need to delete my changes. What cvs command can do it for me?
You use ``` cvs update -C filename ```
8271606
PostgreSQL syntax check without running the query
75
2011-11-25 16:06:31
<p>I want to verify the syntax of files containing sql queries before they can be committed in my CVS project.</p> <p>In order to do that, I have a commitinfo script, but I have trouble finding out if the sql commands are valid. <code>psql</code> does not seem to have a dryrun mode, and constructing my own postgresql-d...
90,948
461,499
2023-11-16 22:44:13
13,209,943
69
2012-11-03 14:12:49
129,064
2012-11-03 14:12:49
https://stackoverflow.com/q/8271606
https://stackoverflow.com/a/13209943
<p>I recently wrote up a utility to statically check the syntax of SQL for PostgreSQL. It leverages ecpg, the embedded SQL C preproccessor for postgres, to check the SQL syntax, so it uses the exact same parser that is built in to Postgres itself.</p> <p>You can check it out on github: <a href="http://github.com/mark...
<p>I recently wrote up a utility to statically check the syntax of SQL for PostgreSQL. It leverages ecpg, the embedded SQL C preproccessor for postgres, to check the SQL syntax, so it uses the exact same parser that is built in to Postgres itself.</p> <p>You can check it out on github: <a href="http://github.com/mark...
22, 256, 335, 367, 1357
cvs, parsing, postgresql, sql, syntax
<h1>PostgreSQL syntax check without running the query</h1> <p>I want to verify the syntax of files containing sql queries before they can be committed in my CVS project.</p> <p>In order to do that, I have a commitinfo script, but I have trouble finding out if the sql commands are valid. <code>psql</code> does not seem ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,667
cvs
# PostgreSQL syntax check without running the query I want to verify the syntax of files containing sql queries before they can be committed in my CVS project. In order to do that, I have a commitinfo script, but I have trouble finding out if the sql commands are valid. `psql` does not seem to have a dryrun mode, and...
I recently wrote up a utility to statically check the syntax of SQL for PostgreSQL. It leverages ecpg, the embedded SQL C preproccessor for postgres, to check the SQL syntax, so it uses the exact same parser that is built in to Postgres itself. You can check it out on github: <http://github.com/markdrago/pgsanity>. Yo...
384108
Moving from CVS to Git: $Id$ equivalent?
137
2008-12-21 04:45:46
<p>I read through a bunch of questions asking about simple source code control tools and Git seemed like a reasonable choice. I have it up and running, and it works well so far. One aspect that I like about CVS is the automatic incrementation of a version number.</p> <p>I understand that this makes less sense in a dis...
87,112
45,978
2022-04-08 05:00:45
385,520
68
2008-12-22 04:03:29
39,975
2018-07-28 19:10:37
https://stackoverflow.com/q/384108
https://stackoverflow.com/a/385520
<p>The SHA is just one representation of a version (albeit canonical). The <code>git describe</code> command offers others and does so quite well.</p> <p>For example, when I run <code>git describe</code> in my master branch of my <a href="http://github.com/dustin/java-memcached-client" rel="noreferrer">Java memcached ...
<p>The SHA is just one representation of a version (albeit canonical). The <code>git describe</code> command offers others and does so quite well.</p> <p>For example, when I run <code>git describe</code> in my master branch of my <a href="http://github.com/dustin/java-memcached-client" rel="noreferrer">Java memcached ...
119, 335, 456, 16456
cvs, git, keyword-substitution, version-control
<h1>Moving from CVS to Git: $Id$ equivalent?</h1> <p>I read through a bunch of questions asking about simple source code control tools and Git seemed like a reasonable choice. I have it up and running, and it works well so far. One aspect that I like about CVS is the automatic incrementation of a version number.</p> <...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,668
cvs
# Moving from CVS to Git: $Id$ equivalent? I read through a bunch of questions asking about simple source code control tools and Git seemed like a reasonable choice. I have it up and running, and it works well so far. One aspect that I like about CVS is the automatic incrementation of a version number. I understand t...
The SHA is just one representation of a version (albeit canonical). The `git describe` command offers others and does so quite well. For example, when I run `git describe` in my master branch of my [Java memcached client](http://github.com/dustin/java-memcached-client) source, I get this: ``` 2.2-16-gc0cd61a ``` Tha...
11362676
How to import and keep updated a CVS repository in Git?
41
2012-07-06 12:57:53
<p>There is a central repository in CVS, and I would like to use it with Git locally, and then send my changes back to CVS.</p> <p>What can I accomplish that on a daily basis?</p> <p>The tasks I would like to accomplish are:</p> <ul> <li>importing branches,</li> <li>getting history in GIT-like format, and </li> <li>...
40,511
355,722
2023-01-27 12:06:24
11,490,134
60
2012-07-15 07:05:11
278,878
2016-09-27 16:06:30
https://stackoverflow.com/q/11362676
https://stackoverflow.com/a/11490134
<p>What I have done in the past is:</p> <h2>Import the CVS repository</h2> <p>Using:</p> <pre><code>$ git cvsimport -C target-cvs -r cvs -k -vA authors-file.txt -d $CVSROOT module </code></pre> <p>Where:</p> <ul> <li><code>target-cvs</code> is the directory to keep my local copy of the repository.</li> <li><code>c...
<p>What I have done in the past is:</p> <h2>Import the CVS repository</h2> <p>Using:</p> <pre><code>$ git cvsimport -C target-cvs -r cvs -k -vA authors-file.txt -d $CVSROOT module </code></pre> <p>Where:</p> <ul> <li><code>target-cvs</code> is the directory to keep my local copy of the repository.</li> <li><code>c...
119, 335, 6452, 27069
cvs, git, git-cvs, git-svn
<h1>How to import and keep updated a CVS repository in Git?</h1> <p>There is a central repository in CVS, and I would like to use it with Git locally, and then send my changes back to CVS.</p> <p>What can I accomplish that on a daily basis?</p> <p>The tasks I would like to accomplish are:</p> <ul> <li>importing bran...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,669
cvs
# How to import and keep updated a CVS repository in Git? There is a central repository in CVS, and I would like to use it with Git locally, and then send my changes back to CVS. What can I accomplish that on a daily basis? The tasks I would like to accomplish are: - importing branches, - getting history in GIT-lik...
What I have done in the past is: ## Import the CVS repository Using: ``` $ git cvsimport -C target-cvs -r cvs -k -vA authors-file.txt -d $CVSROOT module ``` Where: - `target-cvs` is the directory to keep my local copy of the repository. - `cvs` is the name to use for referencing the remote repository. So, I will h...
144669
How do I restore a deleted file in CVS?
44
2008-09-27 22:55:19
<p>I've removed a checked in file from the CVS branch, i.e.:</p> <pre><code>cvs remove -f file.txt cvs commit </code></pre> <p>How do I restore the file?</p>
44,176
4,704
2014-02-14 02:43:02
144,672
44
2008-09-27 22:56:30
2,193
2008-09-27 22:56:30
https://stackoverflow.com/q/144669
https://stackoverflow.com/a/144672
<p>I believe that:</p> <pre><code>cvs add file.txt cvs commit file.txt </code></pre> <p>... will resurrect it from the attic.</p>
<p>I believe that:</p> <pre><code>cvs add file.txt cvs commit file.txt </code></pre> <p>... will resurrect it from the attic.</p>
335
cvs
<h1>How do I restore a deleted file in CVS?</h1> <p>I've removed a checked in file from the CVS branch, i.e.:</p> <pre><code>cvs remove -f file.txt cvs commit </code></pre> <p>How do I restore the file?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,670
cvs
# How do I restore a deleted file in CVS? I've removed a checked in file from the CVS branch, i.e.: ``` cvs remove -f file.txt cvs commit ``` How do I restore the file?
I believe that: ``` cvs add file.txt cvs commit file.txt ``` ... will resurrect it from the attic.
211819
Is there a way to get a short CVS status from command line?
28
2008-10-17 11:37:13
<p>When doing a <code>cvs update</code>, you get a nice summary of the state of the repository, for example:</p> <pre><code>M src/file1.txt M src/file2.txt C src/file3.txt A src/file4.txt ? src/file5.txt </code></pre> <p>Is there a way to get this without actually updating? I know there is <code>cvs status</code>, bu...
12,970
3,102
2017-06-15 07:46:28
211,821
41
2008-10-17 11:40:44
10,238
2008-10-17 11:47:02
https://stackoverflow.com/q/211819
https://stackoverflow.com/a/211821
<p>You can use the -n flag to get the update output without actually updating the files. You can also add -q (quiet) to suppress any server messages.</p> <pre><code>cvs -q -n update </code></pre>
<p>You can use the -n flag to get the update output without actually updating the files. You can also add -q (quiet) to suppress any server messages.</p> <pre><code>cvs -q -n update </code></pre>
335
cvs
<h1>Is there a way to get a short CVS status from command line?</h1> <p>When doing a <code>cvs update</code>, you get a nice summary of the state of the repository, for example:</p> <pre><code>M src/file1.txt M src/file2.txt C src/file3.txt A src/file4.txt ? src/file5.txt </code></pre> <p>Is there a way to get this w...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,671
cvs
# Is there a way to get a short CVS status from command line? When doing a `cvs update`, you get a nice summary of the state of the repository, for example: ``` M src/file1.txt M src/file2.txt C src/file3.txt A src/file4.txt ? src/file5.txt ``` Is there a way to get this without actually updating? I know there is `c...
You can use the -n flag to get the update output without actually updating the files. You can also add -q (quiet) to suppress any server messages. ``` cvs -q -n update ```
1820986
What does a status of "P" mean during a Tortoise CVS Update operation?
24
2009-11-30 16:51:27
<p>I ran an "Update" command on a folder with TortoiseCVS and one of the file statuses is "P". What does that mean? I see "U" which I'm assuming means "Update" and "M" which I'm assuming means "Merge". I tried to open the help file but I'm just getting 404s, so I think the firewall at my office is blocking the help con...
16,384
58
2025-07-10 16:42:41
1,821,060
39
2009-11-30 17:01:19
183,172
2025-07-10 16:42:41
https://stackoverflow.com/q/1820986
https://stackoverflow.com/a/1821060
<p>It's equivalent to a 'U', but CVS figured that sending a patch rather than the whole updated file would be smaller.</p> <p>I couldn't quickly find a fuller explanation, but here's <a href="https://web.archive.org/web/20170228063433/http://www.xinotes.net/notes/note/116" rel="nofollow noreferrer">a table of codes</a>...
<p>It's equivalent to a 'U', but CVS figured that sending a patch rather than the whole updated file would be smaller.</p> <p>I couldn't quickly find a fuller explanation, but here's <a href="https://web.archive.org/web/20170228063433/http://www.xinotes.net/notes/note/116" rel="nofollow noreferrer">a table of codes</a>...
335, 2307
cvs, tortoisecvs
<h1>What does a status of "P" mean during a Tortoise CVS Update operation?</h1> <p>I ran an "Update" command on a folder with TortoiseCVS and one of the file statuses is "P". What does that mean? I see "U" which I'm assuming means "Update" and "M" which I'm assuming means "Merge". I tried to open the help file but I'm ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,672
cvs
# What does a status of "P" mean during a Tortoise CVS Update operation? I ran an "Update" command on a folder with TortoiseCVS and one of the file statuses is "P". What does that mean? I see "U" which I'm assuming means "Update" and "M" which I'm assuming means "Merge". I tried to open the help file but I'm just gett...
It's equivalent to a 'U', but CVS figured that sending a patch rather than the whole updated file would be smaller. I couldn't quickly find a fuller explanation, but here's [a table of codes](https://web.archive.org/web/20170228063433/http://www.xinotes.net/notes/note/116): ``` Code Meaning Description ? wh...
889378
How can I list files in CVS without an initial checkout?
25
2009-05-20 18:05:39
<p>How can I list files CVS without an initial checkout?</p> <p>In subversion I can simply do "svn ls <a href="http://svn.svn.com" rel="noreferrer">http://svn.svn.com</a>" in CVS how can I do this?</p> <p>For example I've got this CVS connection:</p> <pre><code> pserver:anonymous@evocms.cvs.sourceforge.net:/cvsroot/...
41,747
40,322
2017-11-10 20:31:26
896,764
36
2009-05-22 07:51:09
9,784
2009-05-22 13:28:12
https://stackoverflow.com/q/889378
https://stackoverflow.com/a/896764
<p>If it's a one-off operation you don't need to set the <code>CVSROOT</code> environment variable. Just use the <code>-d</code> argument for ad-hoc repository specification.</p> <p>If your version of CVS/CVSNT is not too old (to be exact you'd need either CVS 1.12.8 or higher or CVSNT) then, as others have said, <str...
<p>If it's a one-off operation you don't need to set the <code>CVSROOT</code> environment variable. Just use the <code>-d</code> argument for ad-hoc repository specification.</p> <p>If your version of CVS/CVSNT is not too old (to be exact you'd need either CVS 1.12.8 or higher or CVSNT) then, as others have said, <str...
63, 335, 65722
cvs, svn, svn-checkout
<h1>How can I list files in CVS without an initial checkout?</h1> <p>How can I list files CVS without an initial checkout?</p> <p>In subversion I can simply do "svn ls <a href="http://svn.svn.com" rel="noreferrer">http://svn.svn.com</a>" in CVS how can I do this?</p> <p>For example I've got this CVS connection:</p> ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,673
cvs
# How can I list files in CVS without an initial checkout? How can I list files CVS without an initial checkout? In subversion I can simply do "svn ls <http://svn.svn.com>" in CVS how can I do this? For example I've got this CVS connection: ``` pserver:anonymous@evocms.cvs.sourceforge.net:/cvsroot/evocms ``` How ...
If it's a one-off operation you don't need to set the `CVSROOT` environment variable. Just use the `-d` argument for ad-hoc repository specification. If your version of CVS/CVSNT is not too old (to be exact you'd need either CVS 1.12.8 or higher or CVSNT) then, as others have said, **after having logged in** ``` cvs ...
139759
CVS: List all files changed between tags (or dates)
57
2008-09-26 14:11:44
<p>Is there any way to list all the files that have changed between two tags in CVS?</p> <p>Every time we do a release we apply a tag to all the files in that release. I want to find all the files that changed between releases.</p> <p>It would also work if I could find all files that had changed between two dates.</p...
85,617
3,464
2014-01-22 16:15:01
139,871
35
2008-09-26 14:27:06
12,423
2014-01-22 16:12:38
https://stackoverflow.com/q/139759
https://stackoverflow.com/a/139871
<p>I suppose this command would help:</p> <pre><code>cvs diff -N -c -r RELEASE_1_0 -r RELEASE_1_1 &gt; diffs </code></pre> <p>where <code>RELEASE_1_0</code> and <code>RELEASE_1_1</code> are the names of your tags.</p> <p>You can find a little more information on cvs diff command <a href="http://www.network-theory.co...
<p>I suppose this command would help:</p> <pre><code>cvs diff -N -c -r RELEASE_1_0 -r RELEASE_1_1 &gt; diffs </code></pre> <p>where <code>RELEASE_1_0</code> and <code>RELEASE_1_1</code> are the names of your tags.</p> <p>You can find a little more information on cvs diff command <a href="http://www.network-theory.co...
335
cvs
<h1>CVS: List all files changed between tags (or dates)</h1> <p>Is there any way to list all the files that have changed between two tags in CVS?</p> <p>Every time we do a release we apply a tag to all the files in that release. I want to find all the files that changed between releases.</p> <p>It would also work if ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,674
cvs
# CVS: List all files changed between tags (or dates) Is there any way to list all the files that have changed between two tags in CVS? Every time we do a release we apply a tag to all the files in that release. I want to find all the files that changed between releases. It would also work if I could find all files ...
I suppose this command would help: ``` cvs diff -N -c -r RELEASE_1_0 -r RELEASE_1_1 > diffs ``` where `RELEASE_1_0` and `RELEASE_1_1` are the names of your tags. You can find a little more information on cvs diff command [here](http://www.network-theory.co.uk/docs/cvsmanual/diffexamples.html) plus it should be fair...
6490112
Getting diff between top two revisions of a file in CVS
15
2011-06-27 08:05:49
<p>Is there way to create the diff of a file b/w its top two revisions in the CVS repo? I doesn't care about the revision numbers and my local checked-out file. All I need is, the diff b/w the last commit and the last before commit.</p>
38,711
737,501
2017-08-16 17:55:42
6,495,790
32
2011-06-27 16:15:27
469,210
2015-03-30 10:54:52
https://stackoverflow.com/q/6490112
https://stackoverflow.com/a/6495790
<p>You can use</p> <pre><code>cvs diff -r FIRSTREVISION -r SECONDREVISION filename </code></pre> <p>to compare two revisions. </p> <p>It may be possible to do the comparison you require directly, but we can also automate it by processing the results of <code>cvs log filename</code>. So, for example, you get the la...
<p>You can use</p> <pre><code>cvs diff -r FIRSTREVISION -r SECONDREVISION filename </code></pre> <p>to compare two revisions. </p> <p>It may be possible to do the comparison you require directly, but we can also automate it by processing the results of <code>cvs log filename</code>. So, for example, you get the la...
335, 606
cvs, diff
<h1>Getting diff between top two revisions of a file in CVS</h1> <p>Is there way to create the diff of a file b/w its top two revisions in the CVS repo? I doesn't care about the revision numbers and my local checked-out file. All I need is, the diff b/w the last commit and the last before commit.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,675
cvs
# Getting diff between top two revisions of a file in CVS Is there way to create the diff of a file b/w its top two revisions in the CVS repo? I doesn't care about the revision numbers and my local checked-out file. All I need is, the diff b/w the last commit and the last before commit.
You can use ``` cvs diff -r FIRSTREVISION -r SECONDREVISION filename ``` to compare two revisions. It may be possible to do the comparison you require directly, but we can also automate it by processing the results of `cvs log filename`. So, for example, you get the latest revision number with ``` cvs log filename ...
435368
How do I revert a big change in CVS?
29
2009-01-12 13:13:25
<p>One of my colleagues has totally messed up the contents of a directory in our main CVS repository. I need to just revert the whole module to the state it was in at the end of last year. What's the CVS command to do this please?</p> <p>He has added and removed hundreds of files, so a simple "copy over files from o...
20,072
37,386
2011-12-10 00:18:37
1,042,130
28
2009-06-25 04:05:47
23,154
2009-06-28 02:06:38
https://stackoverflow.com/q/435368
https://stackoverflow.com/a/1042130
<p>Actually your initial approach was very close to the solution. The problem is, that joining date-based does not handle removed files and directories correctly. You need to set a tag to the code base you want to join first:</p> <pre><code>mkdir code_base1 &amp;&amp; cd code_base1 cvs co -D "2008-12-30" modulename cv...
<p>Actually your initial approach was very close to the solution. The problem is, that joining date-based does not handle removed files and directories correctly. You need to set a tag to the code base you want to join first:</p> <pre><code>mkdir code_base1 &amp;&amp; cd code_base1 cvs co -D "2008-12-30" modulename cv...
335, 456, 12309
cvs, revert, version-control
<h1>How do I revert a big change in CVS?</h1> <p>One of my colleagues has totally messed up the contents of a directory in our main CVS repository. I need to just revert the whole module to the state it was in at the end of last year. What's the CVS command to do this please?</p> <p>He has added and removed hundreds...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,676
cvs
# How do I revert a big change in CVS? One of my colleagues has totally messed up the contents of a directory in our main CVS repository. I need to just revert the whole module to the state it was in at the end of last year. What's the CVS command to do this please? He has added and removed hundreds of files, so a si...
Actually your initial approach was very close to the solution. The problem is, that joining date-based does not handle removed files and directories correctly. You need to set a tag to the code base you want to join first: ``` mkdir code_base1 && cd code_base1 cvs co -D "2008-12-30" modulename cvs tag code_base_2008_1...
2006912
What is CVS "pserver" mode?
18
2010-01-05 15:19:29
<p>Could someone tell me exactly what the "pserver" mode is, in regards to CVS? The term "pserver" is used frequently, but I've yet to find an explanation of what it actually is. If "pserver" is a special mode, then I assume there is a default mode as well. If so, what is the difference between the two?</p>
27,569
220,817
2025-02-12 09:26:25
2,006,941
28
2010-01-05 15:23:15
3,171
2010-01-05 15:37:59
https://stackoverflow.com/q/2006912
https://stackoverflow.com/a/2006941
<p><code>pserver</code> is a method for giving remote access to CVS repository. Basically you run <code>cvs</code> as a server listening on port 2401.</p> <p>The "default" mode would be local access, where a developer has an account on the system hosting the CVS repository and accesses its directory and files directl...
<p><code>pserver</code> is a method for giving remote access to CVS repository. Basically you run <code>cvs</code> as a server listening on port 2401.</p> <p>The "default" mode would be local access, where a developer has an account on the system hosting the CVS repository and accesses its directory and files directl...
335
cvs
<h1>What is CVS "pserver" mode?</h1> <p>Could someone tell me exactly what the "pserver" mode is, in regards to CVS? The term "pserver" is used frequently, but I've yet to find an explanation of what it actually is. If "pserver" is a special mode, then I assume there is a default mode as well. If so, what is the differ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,677
cvs
# What is CVS "pserver" mode? Could someone tell me exactly what the "pserver" mode is, in regards to CVS? The term "pserver" is used frequently, but I've yet to find an explanation of what it actually is. If "pserver" is a special mode, then I assume there is a default mode as well. If so, what is the difference betw...
`pserver` is a method for giving remote access to CVS repository. Basically you run `cvs` as a server listening on port 2401. The "default" mode would be local access, where a developer has an account on the system hosting the CVS repository and accesses its directory and files directly. So for a local repository `CVS...
89181
CVS Checkout to a directory
18
2008-09-18 01:25:50
<p>How do i check out a specific directory from CVS and omit the tree leading up to that directory?</p> <p>EX. </p> <p>Id like to checkout to this directory C:/WebHost/MyWebApp/www</p> <p>My CVS Project directory structure is MyWebApp/Trunk/www</p> <p>How do i omit the Trunk and MyWebApp directories?</p>
37,018
16,703
2018-01-30 05:43:01
89,269
28
2008-09-18 01:44:10
9,652
2008-09-18 01:51:21
https://stackoverflow.com/q/89181
https://stackoverflow.com/a/89269
<p>Use cvs <code>-d/cvsroot checkout -d directory project/path/directory</code>. The first <code>-d</code> can be omitted if you set the root with the environment. This is called "shortening the path" and can be avoided with the <code>-N</code> option to <code>checkout</code>.</p>
<p>Use cvs <code>-d/cvsroot checkout -d directory project/path/directory</code>. The first <code>-d</code> can be omitted if you set the root with the environment. This is called "shortening the path" and can be avoided with the <code>-N</code> option to <code>checkout</code>.</p>
335, 2307, 130914
cvs, tortoisecvs, vcs-checkout
<h1>CVS Checkout to a directory</h1> <p>How do i check out a specific directory from CVS and omit the tree leading up to that directory?</p> <p>EX. </p> <p>Id like to checkout to this directory C:/WebHost/MyWebApp/www</p> <p>My CVS Project directory structure is MyWebApp/Trunk/www</p> <p>How do i omit the Trunk and...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,678
cvs
# CVS Checkout to a directory How do i check out a specific directory from CVS and omit the tree leading up to that directory? EX. Id like to checkout to this directory C:/WebHost/MyWebApp/www My CVS Project directory structure is MyWebApp/Trunk/www How do i omit the Trunk and MyWebApp directories?
Use cvs `-d/cvsroot checkout -d directory project/path/directory`. The first `-d` can be omitted if you set the root with the environment. This is called "shortening the path" and can be avoided with the `-N` option to `checkout`.
3722689
CVS Ignore Directories
22
2010-09-15 23:44:41
<p>How do you set to ignore folders and all its subdirectories in CVS?</p> <p>It's getting pretty annoying when it commits every file in my <code>\bin</code>, <code>\obj</code> or <code>\TestResult</code> folders.</p> <p>Tried <code>*\TestResult</code> in the ignore list - to no avail.</p>
39,041
245,268
2017-04-28 03:13:38
3,722,758
27
2010-09-15 23:59:58
350,890
2010-09-15 23:59:58
https://stackoverflow.com/q/3722689
https://stackoverflow.com/a/3722758
<p>you can create a <code>.cvsignore</code> file in your directories. <a href="http://www.cvsnt.org/manual/html/cvsignore.html" rel="noreferrer">See here for details</a></p> <p>In your case the <code>.cvsignore</code> of your project root would look like</p> <pre><code>bin obj TestResult </code></pre>
<p>you can create a <code>.cvsignore</code> file in your directories. <a href="http://www.cvsnt.org/manual/html/cvsignore.html" rel="noreferrer">See here for details</a></p> <p>In your case the <code>.cvsignore</code> of your project root would look like</p> <pre><code>bin obj TestResult </code></pre>
335
cvs
<h1>CVS Ignore Directories</h1> <p>How do you set to ignore folders and all its subdirectories in CVS?</p> <p>It's getting pretty annoying when it commits every file in my <code>\bin</code>, <code>\obj</code> or <code>\TestResult</code> folders.</p> <p>Tried <code>*\TestResult</code> in the ignore list - to no avail....
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,679
cvs
# CVS Ignore Directories How do you set to ignore folders and all its subdirectories in CVS? It's getting pretty annoying when it commits every file in my `\bin`, `\obj` or `\TestResult` folders. Tried `*\TestResult` in the ignore list - to no avail.
you can create a `.cvsignore` file in your directories. [See here for details](http://www.cvsnt.org/manual/html/cvsignore.html) In your case the `.cvsignore` of your project root would look like ``` bin obj TestResult ```
11052199
Convert git repository file encoding
31
2012-06-15 14:05:31
<p>I have a large CVS repository containing files in <code>ISO-8859-1</code> and want to convert this to git.</p> <p>Sure I can configure git to use <code>ISO-8859-1</code> for encoding, but I would like to have it in <code>utf8</code>.</p> <p>Now with tools such as <code>iconv</code> or <code>recode</code> I can con...
41,216
1,320,945
2012-06-15 15:32:31
11,053,818
26
2012-06-15 15:32:31
675,129
2012-06-15 15:32:31
https://stackoverflow.com/q/11052199
https://stackoverflow.com/a/11053818
<p>You can do this with <code>git filter-branch</code>. The idea is that you have to change the encoding of the files in every commit, rewriting each commit as you go.</p> <p>First, write a script that changes the encoding of every file in the repository. It could look like this:</p> <pre><code>#!/bin/sh find . -typ...
<p>You can do this with <code>git filter-branch</code>. The idea is that you have to change the encoding of the files in every commit, rewriting each commit as you go.</p> <p>First, write a script that changes the encoding of every file in the repository. It could look like this:</p> <pre><code>#!/bin/sh find . -typ...
119, 335, 8944, 10141, 12658
character-encoding, cvs, cvs2svn, git, utf-8
<h1>Convert git repository file encoding</h1> <p>I have a large CVS repository containing files in <code>ISO-8859-1</code> and want to convert this to git.</p> <p>Sure I can configure git to use <code>ISO-8859-1</code> for encoding, but I would like to have it in <code>utf8</code>.</p> <p>Now with tools such as <code...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,680
cvs
# Convert git repository file encoding I have a large CVS repository containing files in `ISO-8859-1` and want to convert this to git. Sure I can configure git to use `ISO-8859-1` for encoding, but I would like to have it in `utf8`. Now with tools such as `iconv` or `recode` I can convert the encoding for the files ...
You can do this with `git filter-branch`. The idea is that you have to change the encoding of the files in every commit, rewriting each commit as you go. First, write a script that changes the encoding of every file in the repository. It could look like this: ``` #!/bin/sh find . -type f -print | while read f; do ...
2524101
How do we verify commit messages for a push?
27
2010-03-26 14:49:10
<p>Coming from CVS, we have a policy that commit messages should be tagged with a bug number (simple suffix "... [9999]"). A CVS script checks this during commits and rejects the commit if the message does not conform.</p> <p>The git hook commit-msg does this on the developer side but we find it helpful to have automa...
27,715
285,546
2015-12-15 09:22:11
2,524,125
25
2010-03-26 14:52:31
119,963
2013-08-06 11:47:31
https://stackoverflow.com/q/2524101
https://stackoverflow.com/a/2524125
<h1>Using the update hook</h1> <p>You know about hooks - please, read the <a href="http://www.kernel.org/pub/software/scm/git/docs/githooks.html#cruft-to-get-past-stackoverflow-6-character-minimum-edit" rel="noreferrer">documentation</a> about them! The hook you probably want is update, which is run once per ref. (The ...
<h1>Using the update hook</h1> <p>You know about hooks - please, read the <a href="http://www.kernel.org/pub/software/scm/git/docs/githooks.html#cruft-to-get-past-stackoverflow-6-character-minimum-edit" rel="noreferrer">documentation</a> about them! The hook you probably want is update, which is run once per ref. (The ...
119, 335, 4236, 5597
commit, cvs, git, push
<h1>How do we verify commit messages for a push?</h1> <p>Coming from CVS, we have a policy that commit messages should be tagged with a bug number (simple suffix "... [9999]"). A CVS script checks this during commits and rejects the commit if the message does not conform.</p> <p>The git hook commit-msg does this on th...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,681
cvs
# How do we verify commit messages for a push? Coming from CVS, we have a policy that commit messages should be tagged with a bug number (simple suffix "... [9999]"). A CVS script checks this during commits and rejects the commit if the message does not conform. The git hook commit-msg does this on the developer side...
# Using the update hook You know about hooks - please, read the [documentation](http://www.kernel.org/pub/software/scm/git/docs/githooks.html#cruft-to-get-past-stackoverflow-6-character-minimum-edit) about them! The hook you probably want is update, which is run once per ref. (The pre-receive hook is run once for the ...
190243
How to acquire specific revision of a newly added file from CVS via command line?
9
2008-10-10 05:35:54
<p>One of our internally written tool is fed a cvs commit trace of the form:</p> <pre><code>Checking in src/com/package/AFile.java; /home/cvs/src/com/package/AFile.java,v &lt;-- Afile.java new revision: 1.1.2.56; previous revision: 1.1.2.55 done </code></pre> <p>The tool then acquires the file from cvs by...
26,606
18,027
2022-03-28 04:32:55
190,317
25
2008-10-10 06:21:19
10,105
2008-10-10 06:21:19
https://stackoverflow.com/q/190243
https://stackoverflow.com/a/190317
<p>It is not clear what is your final goal: to bring whole repository into required state (choosen revision of the choosen branch) or to acquire the single file from the repository for further processing. I assume it is the latter.</p> <p>Then, you need this command:</p> <pre><code>cvs checkout -r &lt;revision&gt; -p...
<p>It is not clear what is your final goal: to bring whole repository into required state (choosen revision of the choosen branch) or to acquire the single file from the repository for further processing. I assume it is the latter.</p> <p>Then, you need this command:</p> <pre><code>cvs checkout -r &lt;revision&gt; -p...
335, 456, 1231
command-line, cvs, version-control
<h1>How to acquire specific revision of a newly added file from CVS via command line?</h1> <p>One of our internally written tool is fed a cvs commit trace of the form:</p> <pre><code>Checking in src/com/package/AFile.java; /home/cvs/src/com/package/AFile.java,v &lt;-- Afile.java new revision: 1.1.2.56; previou...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,682
cvs
# How to acquire specific revision of a newly added file from CVS via command line? One of our internally written tool is fed a cvs commit trace of the form: ``` Checking in src/com/package/AFile.java; /home/cvs/src/com/package/AFile.java,v <-- Afile.java new revision: 1.1.2.56; previous revision: 1.1.2.55 ...
It is not clear what is your final goal: to bring whole repository into required state (choosen revision of the choosen branch) or to acquire the single file from the repository for further processing. I assume it is the latter. Then, you need this command: ``` cvs checkout -r <revision> -p filename.ext > ~/tmp/filen...
20869710
Migrate from CVS to Git without losing history
50
2014-01-01 14:37:17
<p>I need to know if there is a way to migrate my code from CVS source control to Git?</p> <p>If yes, what about my history of commits?</p>
63,111
3,012,502
2023-02-07 16:07:40
20,869,792
24
2014-01-01 14:45:57
683,080
2020-06-23 17:44:07
https://stackoverflow.com/q/20869710
https://stackoverflow.com/a/20869792
<p>I've not personally done a conversion from CVS to Git, but I believe Eric Raymond's <a href="http://www.catb.org/esr/cvs-fast-export/" rel="noreferrer"><code>cvs-fast-export</code></a> is the tool to use. He has the man page posted <a href="http://www.catb.org/%7Eesr/cvs-fast-export/cvs-fast-export.html" rel="noref...
<p>I've not personally done a conversion from CVS to Git, but I believe Eric Raymond's <a href="http://www.catb.org/esr/cvs-fast-export/" rel="noreferrer"><code>cvs-fast-export</code></a> is the tool to use. He has the man page posted <a href="http://www.catb.org/%7Eesr/cvs-fast-export/cvs-fast-export.html" rel="noref...
119, 335, 456
cvs, git, version-control
<h1>Migrate from CVS to Git without losing history</h1> <p>I need to know if there is a way to migrate my code from CVS source control to Git?</p> <p>If yes, what about my history of commits?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,683
cvs
# Migrate from CVS to Git without losing history I need to know if there is a way to migrate my code from CVS source control to Git? If yes, what about my history of commits?
I've not personally done a conversion from CVS to Git, but I believe Eric Raymond's [`cvs-fast-export`](http://www.catb.org/esr/cvs-fast-export/) is the tool to use. He has the man page posted [*here*](http://www.catb.org/%7Eesr/cvs-fast-export/cvs-fast-export.html). [`cvsps`](http://www.catb.org/%7Eesr/cvsps/) is anot...
7344956
How to fix issue when committing a change to CVS
15
2011-09-08 08:05:43
<p>I'm trying to commit my changes to CVS repository, but I get the following error:</p> <pre><code>RCS file: /opt/CZarmen/CVS_REPOSITORY/Z_user/lib/python/StudioCustom.py,v retrieving revision 1.38 retrieving revision 1.39 Merging differences between 1.38 and 1.39 into StudioCustom.py M lib/python/StudioCustom.py RC...
28,734
718,762
2019-04-29 07:04:24
7,344,993
24
2011-09-08 08:09:30
400,056
2011-09-08 08:09:30
https://stackoverflow.com/q/7344956
https://stackoverflow.com/a/7344993
<p>You need to update your working copy first by running <code>cvs up</code> because someone has already updated these files while you were working on them. CVS can't automatically merge these changes during commit.</p>
<p>You need to update your working copy first by running <code>cvs up</code> because someone has already updated these files while you were working on them. CVS can't automatically merge these changes during commit.</p>
335, 3146, 5597
commit, conflict, cvs
<h1>How to fix issue when committing a change to CVS</h1> <p>I'm trying to commit my changes to CVS repository, but I get the following error:</p> <pre><code>RCS file: /opt/CZarmen/CVS_REPOSITORY/Z_user/lib/python/StudioCustom.py,v retrieving revision 1.38 retrieving revision 1.39 Merging differences between 1.38 and ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,684
cvs
# How to fix issue when committing a change to CVS I'm trying to commit my changes to CVS repository, but I get the following error: ``` RCS file: /opt/CZarmen/CVS_REPOSITORY/Z_user/lib/python/StudioCustom.py,v retrieving revision 1.38 retrieving revision 1.39 Merging differences between 1.38 and 1.39 into StudioCust...
You need to update your working copy first by running `cvs up` because someone has already updated these files while you were working on them. CVS can't automatically merge these changes during commit.
3437885
How can I list all modules in a CVS repository?
22
2010-08-09 06:55:09
<p>Is there a command that returns a list of module names contained within a CVS repository?</p> <p>Being a newbie to CVS, I imagine that there should be something along the lines of</p> <pre><code>cvs -d /usr/local/cvs listmodules </code></pre> <p>What should I substitute <code>listmodules</code> with to get a list...
54,857
133,939
2013-09-18 20:50:12
3,448,891
23
2010-08-10 12:28:42
9,784
2013-09-18 20:50:12
https://stackoverflow.com/q/3437885
https://stackoverflow.com/a/3448891
<p>As already described in <a href="https://stackoverflow.com/questions/889378/how-can-i-list-files-in-cvs-without-an-initial-checkout/896764#896764">this answer</a> there are basically three ways to go about this. Which one suits your situation depends firstly on what versions of CVS you are using on both client and s...
<p>As already described in <a href="https://stackoverflow.com/questions/889378/how-can-i-list-files-in-cvs-without-an-initial-checkout/896764#896764">this answer</a> there are basically three ways to go about this. Which one suits your situation depends firstly on what versions of CVS you are using on both client and s...
335
cvs
<h1>How can I list all modules in a CVS repository?</h1> <p>Is there a command that returns a list of module names contained within a CVS repository?</p> <p>Being a newbie to CVS, I imagine that there should be something along the lines of</p> <pre><code>cvs -d /usr/local/cvs listmodules </code></pre> <p>What should...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,685
cvs
# How can I list all modules in a CVS repository? Is there a command that returns a list of module names contained within a CVS repository? Being a newbie to CVS, I imagine that there should be something along the lines of ``` cvs -d /usr/local/cvs listmodules ``` What should I substitute `listmodules` with to get ...
As already described in [this answer](https://stackoverflow.com/questions/889378/how-can-i-list-files-in-cvs-without-an-initial-checkout/896764#896764) there are basically three ways to go about this. Which one suits your situation depends firstly on what versions of CVS you are using on both client and server and seco...
115098
CVS: Replace HEAD with a branch
14
2008-09-22 14:20:13
<p>How do I replace the HEAD of a CVS repository with a branch?</p>
16,081
12,582
2010-05-03 20:47:47
115,101
23
2008-09-22 14:21:22
12,096
2008-09-22 14:33:50
https://stackoverflow.com/q/115098
https://stackoverflow.com/a/115101
<p>Check out this page, which has a pretty easy to follow walk through of branching and merging in CVS</p> <p><a href="http://kb.wisc.edu/middleware/page.php?id=4087" rel="noreferrer">http://kb.wisc.edu/middleware/page.php?id=4087</a></p> <p>It also includes an example of replacing HEAD with a specified branch</p> <...
<p>Check out this page, which has a pretty easy to follow walk through of branching and merging in CVS</p> <p><a href="http://kb.wisc.edu/middleware/page.php?id=4087" rel="noreferrer">http://kb.wisc.edu/middleware/page.php?id=4087</a></p> <p>It also includes an example of replacing HEAD with a specified branch</p> <...
335, 1879
branch, cvs
<h1>CVS: Replace HEAD with a branch</h1> <p>How do I replace the HEAD of a CVS repository with a branch?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,686
cvs
# CVS: Replace HEAD with a branch How do I replace the HEAD of a CVS repository with a branch?
Check out this page, which has a pretty easy to follow walk through of branching and merging in CVS <http://kb.wisc.edu/middleware/page.php?id=4087> It also includes an example of replacing HEAD with a specified branch ## **Replacing One Branch With Another** **Tag the end of your branch** ``` cvs tag merge_NEW_BR...
2117066
Default port number of CVS
14
2010-01-22 12:10:54
<p>Can anybody help me with the default port number used for CVS repository.</p> <p>regards, PK</p>
27,042
229,408
2014-06-20 22:53:55
2,117,077
21
2010-01-22 12:13:02
20,862
2010-01-22 12:13:02
https://stackoverflow.com/q/2117066
https://stackoverflow.com/a/2117077
<p><code>grep cvs /etc/services</code> says 2401, both TCP and UDP. Of course, using it over SSH will use port 22 instead.</p>
<p><code>grep cvs /etc/services</code> says 2401, both TCP and UDP. Of course, using it over SSH will use port 22 instead.</p>
335
cvs
<h1>Default port number of CVS</h1> <p>Can anybody help me with the default port number used for CVS repository.</p> <p>regards, PK</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,687
cvs
# Default port number of CVS Can anybody help me with the default port number used for CVS repository. regards, PK
`grep cvs /etc/services` says 2401, both TCP and UDP. Of course, using it over SSH will use port 22 instead.
7894417
How can I CVS-commit a binary file from command line?
9
2011-10-25 18:59:53
<p>I need to commit a jar file in binary mode from the command line.</p> <p>What command should I use? The following does not work:</p> <pre><code>$ cvs commit -kb -m "Committing v2.5.7" myJar.jar Usage: cvs commit [-Rlf] [-m msg | -F logfile] [-r rev] files... -R Process directories recursively. -l ...
12,247
133,939
2011-10-25 21:36:22
7,894,625
21
2011-10-25 19:18:40
827,263
2011-10-25 19:18:40
https://stackoverflow.com/q/7894417
https://stackoverflow.com/a/7894625
<pre><code>cvs add -kb myJar.jar cvs commit -m "Committing v2.5.7" myJar.jar </code></pre> <p>If you've already committed it without <code>-kb</code>, you can use</p> <pre><code>cvs admin -kb myJar.jar </code></pre> <p>You can also use <code>CVSROOT/cvswrappers</code> to specify that all <code>*.jar</code> files are...
<pre><code>cvs add -kb myJar.jar cvs commit -m "Committing v2.5.7" myJar.jar </code></pre> <p>If you've already committed it without <code>-kb</code>, you can use</p> <pre><code>cvs admin -kb myJar.jar </code></pre> <p>You can also use <code>CVSROOT/cvswrappers</code> to specify that all <code>*.jar</code> files are...
335, 5004
binaryfiles, cvs
<h1>How can I CVS-commit a binary file from command line?</h1> <p>I need to commit a jar file in binary mode from the command line.</p> <p>What command should I use? The following does not work:</p> <pre><code>$ cvs commit -kb -m "Committing v2.5.7" myJar.jar Usage: cvs commit [-Rlf] [-m msg | -F logfile] [-r rev] fi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,688
cvs
# How can I CVS-commit a binary file from command line? I need to commit a jar file in binary mode from the command line. What command should I use? The following does not work: ``` $ cvs commit -kb -m "Committing v2.5.7" myJar.jar Usage: cvs commit [-Rlf] [-m msg | -F logfile] [-r rev] files... -R Process ...
``` cvs add -kb myJar.jar cvs commit -m "Committing v2.5.7" myJar.jar ``` If you've already committed it without `-kb`, you can use ``` cvs admin -kb myJar.jar ``` You can also use `CVSROOT/cvswrappers` to specify that all `*.jar` files are binary.
3306680
Ignore files in Mercurial using Glob syntax
11
2010-07-22 07:36:03
<p>I'm using Mercurial and I have a following structure:</p> <pre><code>files test demo.jpg video.flv video.doc sport demo2.jpg picture.jpg text.txt demo3.jpg demofile3.doc </code></pre> <p>I want to make a glob filter that only ignore all "jpg" files in all directory ...
8,493
377,541
2010-07-22 13:26:11
3,306,774
16
2010-07-22 07:52:02
112,477
2010-07-22 07:52:02
https://stackoverflow.com/q/3306680
https://stackoverflow.com/a/3306774
<h3>Regexp solution</h3> <p><br> This works for me ..</p> <pre><code>syntax: regexp files/.*/.*jpg </code></pre> <p><br> Your own solution looks more like a glob. The trick with that is to use the ** syntax to allow for sub directories. See this ... <br></p> <h3>Glob solution</h3> <p><br> This glob works for me to...
<h3>Regexp solution</h3> <p><br> This works for me ..</p> <pre><code>syntax: regexp files/.*/.*jpg </code></pre> <p><br> Your own solution looks more like a glob. The trick with that is to use the ** syntax to allow for sub directories. See this ... <br></p> <h3>Glob solution</h3> <p><br> This glob works for me to...
18, 335, 802, 3889, 31419
cvs, glob, hgignore, mercurial, regex
<h1>Ignore files in Mercurial using Glob syntax</h1> <p>I'm using Mercurial and I have a following structure:</p> <pre><code>files test demo.jpg video.flv video.doc sport demo2.jpg picture.jpg text.txt demo3.jpg demofile3.doc </code></pre> <p>I want to make a glob filt...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,689
cvs
# Ignore files in Mercurial using Glob syntax I'm using Mercurial and I have a following structure: ``` files test demo.jpg video.flv video.doc sport demo2.jpg picture.jpg text.txt demo3.jpg demofile3.doc ``` I want to make a glob filter that only ignore all "jpg" fil...
### Regexp solution This works for me .. ``` syntax: regexp files/.*/.*jpg ``` Your own solution looks more like a glob. The trick with that is to use the ** syntax to allow for sub directories. See this ... ### Glob solution This glob works for me too ``` **/files/**/*.jpg ``` ### Comments Personally I'd alway...
6174742
How to get a list of tags created in CVS repository?
21
2011-05-30 09:52:32
<p>Are there any CLI commands that can be used to get a list of Tags that have been created on a branch or head of a module within a specified time frame?</p> <p>What I briefly need is a list of Tags and the date when they were created. Given following parameters</p> <ol> <li>Module Name</li> <li>Branch Name (or :: H...
36,153
86,195
2019-07-12 07:09:11
6,184,269
15
2011-05-31 07:25:52
86,195
2011-05-31 09:06:34
https://stackoverflow.com/q/6174742
https://stackoverflow.com/a/6184269
<p>One can list tags or branches present in a module using the following command. This is something picked up from <a href="https://stackoverflow.com/questions/566093/how-do-i-identify-what-branches-exist-in-cvs">another answer at SO</a></p> <p>To list all tags:</p> <pre><code>cvs -Q -d :pserver:*User*:*Pass*@*HostNa...
<p>One can list tags or branches present in a module using the following command. This is something picked up from <a href="https://stackoverflow.com/questions/566093/how-do-i-identify-what-branches-exist-in-cvs">another answer at SO</a></p> <p>To list all tags:</p> <pre><code>cvs -Q -d :pserver:*User*:*Pass*@*HostNa...
335, 456
cvs, version-control
<h1>How to get a list of tags created in CVS repository?</h1> <p>Are there any CLI commands that can be used to get a list of Tags that have been created on a branch or head of a module within a specified time frame?</p> <p>What I briefly need is a list of Tags and the date when they were created. Given following para...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,690
cvs
# How to get a list of tags created in CVS repository? Are there any CLI commands that can be used to get a list of Tags that have been created on a branch or head of a module within a specified time frame? What I briefly need is a list of Tags and the date when they were created. Given following parameters 1. Modul...
One can list tags or branches present in a module using the following command. This is something picked up from [another answer at SO](https://stackoverflow.com/questions/566093/how-do-i-identify-what-branches-exist-in-cvs) To list all tags: ``` cvs -Q -d :pserver:*User*:*Pass*@*HostName*:/cvsroot rlog -h *Module*| a...
14405251
CVS add directory/ error "there is no version here; do `cvs checkout' first"
7
2013-01-18 18:26:15
<p>Using Terminal (on Mac OSX 10.8.x) whenever I try to add a directory within my project</p> <pre><code>project_root jacob$ cvs add foo/ project_root jacob$ cvs add ./shared/foo/ project_root jacob$ cvs add /full/path/foo/ </code></pre> <p>CVS complains:</p> <pre><code>cvs add: in directory `.': cvs [add aborted]: ...
10,781
758,177
2016-09-15 03:04:38
14,405,429
15
2013-01-18 18:37:20
758,177
2013-01-18 18:37:20
https://stackoverflow.com/q/14405251
https://stackoverflow.com/a/14405429
<p>OMG, cvs is a terrible joke: the current working directory must be the immediate parent of the directory being added:</p> <pre><code>project_root jacob$ cd shared/ project_root jacob$ cvs add foo/ Directory /…/foo added to the repository </code></pre> <p><a href="http://drupal.org/node/353813#comment-1185079">sour...
<p>OMG, cvs is a terrible joke: the current working directory must be the immediate parent of the directory being added:</p> <pre><code>project_root jacob$ cd shared/ project_root jacob$ cvs add foo/ Directory /…/foo added to the repository </code></pre> <p><a href="http://drupal.org/node/353813#comment-1185079">sour...
218, 335, 14215
addition, cvs, directory
<h1>CVS add directory/ error "there is no version here; do `cvs checkout' first"</h1> <p>Using Terminal (on Mac OSX 10.8.x) whenever I try to add a directory within my project</p> <pre><code>project_root jacob$ cvs add foo/ project_root jacob$ cvs add ./shared/foo/ project_root jacob$ cvs add /full/path/foo/ </code></...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,691
cvs
# CVS add directory/ error "there is no version here; do `cvs checkout' first" Using Terminal (on Mac OSX 10.8.x) whenever I try to add a directory within my project ``` project_root jacob$ cvs add foo/ project_root jacob$ cvs add ./shared/foo/ project_root jacob$ cvs add /full/path/foo/ ``` CVS complains: ``` cvs ...
OMG, cvs is a terrible joke: the current working directory must be the immediate parent of the directory being added: ``` project_root jacob$ cd shared/ project_root jacob$ cvs add foo/ Directory /…/foo added to the repository ``` [source](http://drupal.org/node/353813#comment-1185079)
1287401
cvs, "file should be removed and is still there (or back again)"
9
2009-08-17 11:17:05
<p>I am trying to commit a project in which a file has been "cvs remove"d, but actually needs to be there. The contents has been completely rewritten, but it needs to retain the same name.</p> <p>I am unable to either commit the project or re-add the file without getting this annoying error message. How do I "unremo...
3,849
24,508
2012-04-11 14:57:51
1,287,734
14
2009-08-17 12:38:12
24,508
2012-04-11 14:57:51
https://stackoverflow.com/q/1287401
https://stackoverflow.com/a/1287734
<p>This worked for me:</p> <ol> <li><p>Rename the file</p> <pre><code>mv mistakenly_removed_file wtf </code></pre></li> <li><p>Ask cvs to add the old version:</p> <pre><code>cvs add mistakenly_removed_file </code></pre></li> <li><p>cvs then reports it has resurrected the removed file.</p> <pre><code>mv wtf mistaken...
<p>This worked for me:</p> <ol> <li><p>Rename the file</p> <pre><code>mv mistakenly_removed_file wtf </code></pre></li> <li><p>Ask cvs to add the old version:</p> <pre><code>cvs add mistakenly_removed_file </code></pre></li> <li><p>cvs then reports it has resurrected the removed file.</p> <pre><code>mv wtf mistaken...
335, 456
cvs, version-control
<h1>cvs, "file should be removed and is still there (or back again)"</h1> <p>I am trying to commit a project in which a file has been "cvs remove"d, but actually needs to be there. The contents has been completely rewritten, but it needs to retain the same name.</p> <p>I am unable to either commit the project or re-a...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,692
cvs
# cvs, "file should be removed and is still there (or back again)" I am trying to commit a project in which a file has been "cvs remove"d, but actually needs to be there. The contents has been completely rewritten, but it needs to retain the same name. I am unable to either commit the project or re-add the file witho...
This worked for me: 1. Rename the file ``` mv mistakenly_removed_file wtf ``` 2. Ask cvs to add the old version: ``` cvs add mistakenly_removed_file ``` 3. cvs then reports it has resurrected the removed file. ``` mv wtf mistakenly_removed_file ``` `cvs status` reveals that the file is n...
2563836
Sell me distributed revision control
22
2010-04-01 21:33:06
<p>I know 1000s of similar topics floating around. I read at lest 5 threads here in SO But why am I still not convinced about DVCS?</p> <p>I have only following questions (note that I am selfishly worried only about Java projects)</p> <ul> <li>What is the advantage or value of committing locally? What? really? All mo...
3,974
212,211
2016-01-02 17:42:17
2,570,804
13
2010-04-03 09:40:33
112,950
2010-04-03 09:58:45
https://stackoverflow.com/q/2563836
https://stackoverflow.com/a/2570804
<h1>Reliability</h1> <p>If your harddisk silently starts corrupting data, you damn well want to know about it. Git takes SHA1 hashes of everything you commit. You have 1 central repo with SVN and if its bits get silently modified by a faulty HDD controller you won't know about it till it's too late.</p> <p>And since ...
<h1>Reliability</h1> <p>If your harddisk silently starts corrupting data, you damn well want to know about it. Git takes SHA1 hashes of everything you commit. You have 1 central repo with SVN and if its bits get silently modified by a faulty HDD controller you won't know about it till it's too late.</p> <p>And since ...
63, 335, 3346, 19087
centralized, cvs, dvcs, svn
<h1>Sell me distributed revision control</h1> <p>I know 1000s of similar topics floating around. I read at lest 5 threads here in SO But why am I still not convinced about DVCS?</p> <p>I have only following questions (note that I am selfishly worried only about Java projects)</p> <ul> <li>What is the advantage or val...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,693
cvs
# Sell me distributed revision control I know 1000s of similar topics floating around. I read at lest 5 threads here in SO But why am I still not convinced about DVCS? I have only following questions (note that I am selfishly worried only about Java projects) - What is the advantage or value of committing locally?...
# Reliability If your harddisk silently starts corrupting data, you damn well want to know about it. Git takes SHA1 hashes of everything you commit. You have 1 central repo with SVN and if its bits get silently modified by a faulty HDD controller you won't know about it till it's too late. And since you have 1 centra...
4699098
Android and version control systems, commit gen folder or put on ignore list?
11
2011-01-15 10:30:42
<p>there has already been some discussion about the problems the gen folder causes together with version control systems (SVN, CVS, Git etc). But what is still unclear for me is, should it be commited or put on the ignore list? What is the recommended way?</p> <p>thanks!</p>
2,000
97,688
2011-01-15 10:41:15
4,699,130
13
2011-01-15 10:38:52
272,824
2011-01-15 10:38:52
https://stackoverflow.com/q/4699098
https://stackoverflow.com/a/4699130
<p>You shouldn't store <code>/gen</code> folder in any version control system (no matter SVN, CVS, Git or anything else). Contents of the folder are generated automatically so it just makes no sense to keep track of the changes.</p>
<p>You shouldn't store <code>/gen</code> folder in any version control system (no matter SVN, CVS, Git or anything else). Contents of the folder are generated automatically so it just makes no sense to keep track of the changes.</p>
63, 119, 335, 802, 1386
android, cvs, git, mercurial, svn
<h1>Android and version control systems, commit gen folder or put on ignore list?</h1> <p>there has already been some discussion about the problems the gen folder causes together with version control systems (SVN, CVS, Git etc). But what is still unclear for me is, should it be commited or put on the ignore list? What ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,694
cvs
# Android and version control systems, commit gen folder or put on ignore list? there has already been some discussion about the problems the gen folder causes together with version control systems (SVN, CVS, Git etc). But what is still unclear for me is, should it be commited or put on the ignore list? What is the re...
You shouldn't store `/gen` folder in any version control system (no matter SVN, CVS, Git or anything else). Contents of the folder are generated automatically so it just makes no sense to keep track of the changes.
1108054
How do you rename a branch in CVS?
11
2009-07-10 06:47:42
<p>If you've named a branch in CVS incorrectly, or the name originally chosen becomes inappropriate, how do you change it to something else?</p> <p>A related question is <a href="https://stackoverflow.com/questions/1299015/how-do-you-rename-a-branch-in-cvs-without-admin-access">How do you rename a branch in CVS withou...
12,273
82,956
2021-10-07 00:32:38
1,108,061
13
2009-07-10 06:51:49
82,956
2021-10-07 00:32:38
https://stackoverflow.com/q/1108054
https://stackoverflow.com/a/1108061
<p>The trick to this is using one of CVSs' more obscure admin commands, -N. It is a two stage process, effectively copy then remove.</p> <p>Firstly, you create a branch with the correct name that references the original branch name. Secondly, you delete the original branch name.</p> <p>Assume you have a file &quot;Fi...
<p>The trick to this is using one of CVSs' more obscure admin commands, -N. It is a two stage process, effectively copy then remove.</p> <p>Firstly, you create a branch with the correct name that references the original branch name. Secondly, you delete the original branch name.</p> <p>Assume you have a file &quot;Fi...
335
cvs
<h1>How do you rename a branch in CVS?</h1> <p>If you've named a branch in CVS incorrectly, or the name originally chosen becomes inappropriate, how do you change it to something else?</p> <p>A related question is <a href="https://stackoverflow.com/questions/1299015/how-do-you-rename-a-branch-in-cvs-without-admin-acce...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,695
cvs
# How do you rename a branch in CVS? If you've named a branch in CVS incorrectly, or the name originally chosen becomes inappropriate, how do you change it to something else? A related question is [How do you rename a branch in CVS without admin access?](https://stackoverflow.com/questions/1299015/how-do-you-rename-a...
The trick to this is using one of CVSs' more obscure admin commands, -N. It is a two stage process, effectively copy then remove. Firstly, you create a branch with the correct name that references the original branch name. Secondly, you delete the original branch name. Assume you have a file "File.txt" that is curren...
354599
How to find all commits(files&comments) by a person in cvs
19
2008-12-09 23:17:56
<p>Looking to get a list of all the files (commit comments would be nice too) of a user in cvs. </p>
32,140
null
2016-10-18 22:59:41
354,611
12
2008-12-09 23:28:48
20,860
2008-12-09 23:28:48
https://stackoverflow.com/q/354599
https://stackoverflow.com/a/354611
<pre><code>cvs log -t -wJellyJoe </code></pre>
<pre><code>cvs log -t -wJellyJoe </code></pre>
335, 10193
cvs, find
<h1>How to find all commits(files&comments) by a person in cvs</h1> <p>Looking to get a list of all the files (commit comments would be nice too) of a user in cvs. </p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,696
cvs
# How to find all commits(files&comments) by a person in cvs Looking to get a list of all the files (commit comments would be nice too) of a user in cvs.
``` cvs log -t -wJellyJoe ```
9077040
How do I checkout a single file?
9
2012-01-31 09:16:50
<p>I would like to checkout <code>file1</code> from CVS repository to the current directory.</p> <p>File1's path is: <code>/opt/application/CVS_REPOSITORY/project/lib/source/file1</code></p> <p>How do I do it?</p> <p>First I set:</p> <pre><code>setenv CVSROOT /opt/application/CVS_REPOSITORY </code></pre> <p>Then w...
20,048
718,762
2018-03-14 21:45:45
9,077,102
12
2012-01-31 09:21:22
1,174,549
2012-01-31 09:21:22
https://stackoverflow.com/q/9077040
https://stackoverflow.com/a/9077102
<p>Try <code>cvs co project/lib/source/file1</code></p>
<p>Try <code>cvs co project/lib/source/file1</code></p>
335, 5310, 130914
cvs, file, vcs-checkout
<h1>How do I checkout a single file?</h1> <p>I would like to checkout <code>file1</code> from CVS repository to the current directory.</p> <p>File1's path is: <code>/opt/application/CVS_REPOSITORY/project/lib/source/file1</code></p> <p>How do I do it?</p> <p>First I set:</p> <pre><code>setenv CVSROOT /opt/applicati...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,697
cvs
# How do I checkout a single file? I would like to checkout `file1` from CVS repository to the current directory. File1's path is: `/opt/application/CVS_REPOSITORY/project/lib/source/file1` How do I do it? First I set: ``` setenv CVSROOT /opt/application/CVS_REPOSITORY ``` Then what should I do? ``` cvs co -r . ...
Try `cvs co project/lib/source/file1`
5731023
autotools: force make not to rebuild configure/Makefile
9
2011-04-20 13:23:02
<p>I have a project with autotools: automake, autoconf.</p> <p>I want to prohibit <code>make</code> from remaking files <code>configure</code>, <code>Makefile.in</code>, etc; just to do compile job.</p> <p>Some of files are edited by hand, and I know that I should not to do this. (Or the project was updated from CVS ...
4,624
196,561
2014-04-19 16:48:09
5,745,366
12
2011-04-21 14:20:25
98,530
2011-04-21 14:20:25
https://stackoverflow.com/q/5731023
https://stackoverflow.com/a/5745366
<p>First of all, if you edit a generated file directly, it wouldn't be rebuilt anyway, because it is then newer then its prerequisites.</p> <p>Then, there are two separate things going on here: <code>config.status</code> and <code>Makefile</code> are created during the build. It's hard to prevent these from being rem...
<p>First of all, if you edit a generated file directly, it wouldn't be rebuilt anyway, because it is then newer then its prerequisites.</p> <p>Then, there are two separate things going on here: <code>config.status</code> and <code>Makefile</code> are created during the build. It's hard to prevent these from being rem...
335, 1101, 1102, 4301, 7511
autoconf, automake, autotools, cvs, makefile
<h1>autotools: force make not to rebuild configure/Makefile</h1> <p>I have a project with autotools: automake, autoconf.</p> <p>I want to prohibit <code>make</code> from remaking files <code>configure</code>, <code>Makefile.in</code>, etc; just to do compile job.</p> <p>Some of files are edited by hand, and I know th...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,698
cvs
# autotools: force make not to rebuild configure/Makefile I have a project with autotools: automake, autoconf. I want to prohibit `make` from remaking files `configure`, `Makefile.in`, etc; just to do compile job. Some of files are edited by hand, and I know that I should not to do this. (Or the project was updated ...
First of all, if you edit a generated file directly, it wouldn't be rebuilt anyway, because it is then newer then its prerequisites. Then, there are two separate things going on here: `config.status` and `Makefile` are created during the build. It's hard to prevent these from being remade during the build unless you m...
1160887
Can .cvsignore exclude patterns found in recursive subdirectories?
9
2009-07-21 18:28:08
<p>Can I create a single .cvsignore file to exclude specific patterns for the current directory and recursively for all subdirectories? Basically I want to say at the top of my cvs module to exclude all *.swp or *.bak files instead of having to create a new .cvsignore for each subdirectory.</p> <p>I suppose this behav...
5,480
59,556
2009-07-21 20:20:51
1,161,214
12
2009-07-21 19:24:29
80,458
2009-07-21 20:20:51
https://stackoverflow.com/q/1160887
https://stackoverflow.com/a/1161214
<p><a href="http://docs.freebsd.org/info/cvs/cvs.info.cvsignore.html" rel="noreferrer">CVS docs</a> list several solutions. In your case the following applies the best if you can access the $CVSROOT on the server:</p> <blockquote> <ul> <li>The per-repository list in <code>$CVSROOT/CVSROOT/cvsignore</code> is ...
<p><a href="http://docs.freebsd.org/info/cvs/cvs.info.cvsignore.html" rel="noreferrer">CVS docs</a> list several solutions. In your case the following applies the best if you can access the $CVSROOT on the server:</p> <blockquote> <ul> <li>The per-repository list in <code>$CVSROOT/CVSROOT/cvsignore</code> is ...
335
cvs
<h1>Can .cvsignore exclude patterns found in recursive subdirectories?</h1> <p>Can I create a single .cvsignore file to exclude specific patterns for the current directory and recursively for all subdirectories? Basically I want to say at the top of my cvs module to exclude all *.swp or *.bak files instead of having to...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,699
cvs
# Can .cvsignore exclude patterns found in recursive subdirectories? Can I create a single .cvsignore file to exclude specific patterns for the current directory and recursively for all subdirectories? Basically I want to say at the top of my cvs module to exclude all *.swp or *.bak files instead of having to create a...
[CVS docs](http://docs.freebsd.org/info/cvs/cvs.info.cvsignore.html) list several solutions. In your case the following applies the best if you can access the $CVSROOT on the server: > - The per-repository list in > `$CVSROOT/CVSROOT/cvsignore` is > appended to the list, if that file exists. If you cannot access ...
1031179
How to check out a CVS branch point?
9
2009-06-23 07:51:56
<p>First, I have to admit I screwed up a little with CVS. I had a release tag <code>releaseX</code>, which was done some time back (i.e., not HEAD). Then I decided I need a maintenance branch at that point. Instead of creating a branch tag (<code>branchX</code>) in <em>addition</em> to <code>releaseX</code>, I <em>dele...
32,819
60,281
2021-08-02 13:46:08
1,042,367
12
2009-06-25 05:55:41
23,154
2021-08-02 13:46:08
https://stackoverflow.com/q/1031179
https://stackoverflow.com/a/1042367
<p>Since you did not set a tag when branching, the only way I see, is to use the date approach. But you can still set that tag now. Lets assume you want to call that initial release &quot;ReleaseX0&quot;, because unfortunately the name &quot;ReleaseX&quot; is already occupied for the branch. Depending on whether you wa...
<p>Since you did not set a tag when branching, the only way I see, is to use the date approach. But you can still set that tag now. Lets assume you want to call that initial release &quot;ReleaseX0&quot;, because unfortunately the name &quot;ReleaseX&quot; is already occupied for the branch. Depending on whether you wa...
335
cvs
<h1>How to check out a CVS branch point?</h1> <p>First, I have to admit I screwed up a little with CVS. I had a release tag <code>releaseX</code>, which was done some time back (i.e., not HEAD). Then I decided I need a maintenance branch at that point. Instead of creating a branch tag (<code>branchX</code>) in <em>addi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,700
cvs
# How to check out a CVS branch point? First, I have to admit I screwed up a little with CVS. I had a release tag `releaseX`, which was done some time back (i.e., not HEAD). Then I decided I need a maintenance branch at that point. Instead of creating a branch tag (`branchX`) in *addition* to `releaseX`, I *deleted* t...
Since you did not set a tag when branching, the only way I see, is to use the date approach. But you can still set that tag now. Lets assume you want to call that initial release "ReleaseX0", because unfortunately the name "ReleaseX" is already occupied for the branch. Depending on whether you want to set the tag on th...
4420566
SCM choice for a new user?
7
2010-12-12 06:31:28
<p>Real easy one here guys. Best justification gets the win.</p> <p>I'm a computer science student at a school you've heard of, and have been programming for several years now (about 8), so I've written a fair few lines of code. But since I've never really been distributing - source or binaries - nor doing team develo...
951
52,721
2018-02-22 12:50:56
4,427,318
12
2010-12-13 09:19:19
311,635
2018-02-22 12:50:56
https://stackoverflow.com/q/4420566
https://stackoverflow.com/a/4427318
<blockquote> <p>Given the choice between Git and Hg, I'd probably go with Git - any disagreement? </p> </blockquote> <p><strong>Warning, I'm a mercurial fanboy.</strong></p> <p>Git is not bad, but it has some quirks you have to know when you use it:</p> <ul> <li>You can push into a non-bare git repo, but this will...
<blockquote> <p>Given the choice between Git and Hg, I'd probably go with Git - any disagreement? </p> </blockquote> <p><strong>Warning, I'm a mercurial fanboy.</strong></p> <p>Git is not bad, but it has some quirks you have to know when you use it:</p> <ul> <li>You can push into a non-bare git repo, but this will...
63, 119, 335, 456, 802
cvs, git, mercurial, svn, version-control
<h1>SCM choice for a new user?</h1> <p>Real easy one here guys. Best justification gets the win.</p> <p>I'm a computer science student at a school you've heard of, and have been programming for several years now (about 8), so I've written a fair few lines of code. But since I've never really been distributing - source...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,701
cvs
# SCM choice for a new user? Real easy one here guys. Best justification gets the win. I'm a computer science student at a school you've heard of, and have been programming for several years now (about 8), so I've written a fair few lines of code. But since I've never really been distributing - source or binaries - n...
> Given the choice between Git and Hg, I'd probably go with Git - any disagreement? **Warning, I'm a mercurial fanboy.** Git is not bad, but it has some quirks you have to know when you use it: - You can push into a non-bare git repo, but this will screw up the working copy there (It moves the branch HEAD to the pus...
4720857
How to create 3D streoscopic images using MATLAB with image tool?
6
2011-01-18 05:47:25
<p>How do I create a 3D stereoscopic image from a 2D image using MATLAB?</p>
12,782
568,085
2015-01-03 03:12:46
4,724,311
12
2011-01-18 12:58:24
356,020
2011-01-19 06:46:20
https://stackoverflow.com/q/4720857
https://stackoverflow.com/a/4724311
<p>Either I'm misunderstanding your question (people have already pointed out that it's not clear), or you are misunderstanding the way 3D vision works. You don't "see 2D image using 3D glass". 3D vision is achieved by serving two different images, left image and right image, to the left eye and right eye, respectively...
<p>Either I'm misunderstanding your question (people have already pointed out that it's not clear), or you are misunderstanding the way 3D vision works. You don't "see 2D image using 3D glass". 3D vision is achieved by serving two different images, left image and right image, to the left eye and right eye, respectively...
854, 6941, 97017
image-processing, matlab, matlab-cvst
<h1>How to create 3D streoscopic images using MATLAB with image tool?</h1> <p>How do I create a 3D stereoscopic image from a 2D image using MATLAB?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,702
cvs
# How to create 3D streoscopic images using MATLAB with image tool? How do I create a 3D stereoscopic image from a 2D image using MATLAB?
Either I'm misunderstanding your question (people have already pointed out that it's not clear), or you are misunderstanding the way 3D vision works. You don't "see 2D image using 3D glass". 3D vision is achieved by serving two different images, left image and right image, to the left eye and right eye, respectively. A...
162960
Is there a source-control system that allows tracking of file name changes?
6
2008-10-02 15:21:09
<p>So, I've been living with my cvs repositories for some time. Though there is a thing I miss - if i rename a file that is already in repository, I need to delete the one with old name from there and add the new one. Hence, I loose all my change-history. And sometimes there's a need to rename a file in alredy existing...
295
4,172
2016-04-29 06:29:59
162,970
12
2008-10-02 15:22:28
4,494
2016-04-29 06:29:59
https://stackoverflow.com/q/162960
https://stackoverflow.com/a/162970
<p>Subversion can do this, but you have to do it with </p> <pre><code>svn move &lt;oldfile&gt; &lt;newfile&gt; </code></pre> <p>Edit: And in this decade, we do <code>git mv &lt;oldfile&gt; &lt;newfile&gt;</code>, or just use <code>mv</code> and git usually figures it out on its own.</p>
<p>Subversion can do this, but you have to do it with </p> <pre><code>svn move &lt;oldfile&gt; &lt;newfile&gt; </code></pre> <p>Edit: And in this decade, we do <code>git mv &lt;oldfile&gt; &lt;newfile&gt;</code>, or just use <code>mv</code> and git usually figures it out on its own.</p>
63, 335, 456
cvs, svn, version-control
<h1>Is there a source-control system that allows tracking of file name changes?</h1> <p>So, I've been living with my cvs repositories for some time. Though there is a thing I miss - if i rename a file that is already in repository, I need to delete the one with old name from there and add the new one. Hence, I loose al...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,703
cvs
# Is there a source-control system that allows tracking of file name changes? So, I've been living with my cvs repositories for some time. Though there is a thing I miss - if i rename a file that is already in repository, I need to delete the one with old name from there and add the new one. Hence, I loose all my chan...
Subversion can do this, but you have to do it with ``` svn move <oldfile> <newfile> ``` Edit: And in this decade, we do `git mv <oldfile> <newfile>`, or just use `mv` and git usually figures it out on its own.
5071
How to add CVS directories recursively
40
2008-08-07 18:05:28
<p>I've played with CVS a little bit and am not the most familiar with all of its capabilities, but a huge annoyance for me is trying to add new directories that contain more directories in them. Running "<code>cvs add</code>" only adds the contents of the current directory, and using "<code>cvs import</code>" didn't l...
72,657
422
2016-06-07 14:53:29
5,262
11
2008-08-07 20:22:32
116
2008-08-07 20:22:32
https://stackoverflow.com/q/5071
https://stackoverflow.com/a/5262
<p>Ah, spaces. This will work with spaces:</p> <pre><code>find . -type f -print0| xargs -0 cvs add </code></pre>
<p>Ah, spaces. This will work with spaces:</p> <pre><code>find . -type f -print0| xargs -0 cvs add </code></pre>
335
cvs
<h1>How to add CVS directories recursively</h1> <p>I've played with CVS a little bit and am not the most familiar with all of its capabilities, but a huge annoyance for me is trying to add new directories that contain more directories in them. Running "<code>cvs add</code>" only adds the contents of the current directo...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,704
cvs
# How to add CVS directories recursively I've played with CVS a little bit and am not the most familiar with all of its capabilities, but a huge annoyance for me is trying to add new directories that contain more directories in them. Running "`cvs add`" only adds the contents of the current directory, and using "`cvs ...
Ah, spaces. This will work with spaces: ``` find . -type f -print0| xargs -0 cvs add ```
2890757
Downloading Eclipse's Source Code
16
2010-05-23 05:34:16
<p>I'm doing a study on large Java projects and would like to view the source code for Eclipse. I have gone to this url (<a href="http://wiki.eclipse.org/index.php/CVS_Howto" rel="noreferrer">http://wiki.eclipse.org/index.php/CVS_Howto</a>) and figured that the most useful cvs repository for me to look at would be thi...
17,188
30,563
2018-07-29 03:18:10
2,890,889
11
2010-05-23 06:51:34
241,590
2018-07-29 03:18:10
https://stackoverflow.com/q/2890757
https://stackoverflow.com/a/2890889
<p>Just download the source tarball <code>eclipse-cvs.tgz</code> <a href="http://archive.eclipse.org/arch/" rel="nofollow noreferrer">from here</a> </p> <p>EDIT: This also includes version history, so it may be larger than you need. For just a current version download <a href="http://www.eclipse.org/downloads/download...
<p>Just download the source tarball <code>eclipse-cvs.tgz</code> <a href="http://archive.eclipse.org/arch/" rel="nofollow noreferrer">from here</a> </p> <p>EDIT: This also includes version history, so it may be larger than you need. For just a current version download <a href="http://www.eclipse.org/downloads/download...
17, 53, 335
cvs, eclipse, java
<h1>Downloading Eclipse's Source Code</h1> <p>I'm doing a study on large Java projects and would like to view the source code for Eclipse. I have gone to this url (<a href="http://wiki.eclipse.org/index.php/CVS_Howto" rel="noreferrer">http://wiki.eclipse.org/index.php/CVS_Howto</a>) and figured that the most useful cv...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,705
cvs
# Downloading Eclipse's Source Code I'm doing a study on large Java projects and would like to view the source code for Eclipse. I have gone to this url (<http://wiki.eclipse.org/index.php/CVS_Howto>) and figured that the most useful cvs repository for me to look at would be this one: :pserver:anonymous@dev.eclipse.o...
Just download the source tarball `eclipse-cvs.tgz` [from here](http://archive.eclipse.org/arch/) EDIT: This also includes version history, so it may be larger than you need. For just a current version download [Platform-SDK.3.5.2](http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.5.2-2010...
9300379
Automatic Face Detection Using MATLAB
9
2012-02-15 19:57:07
<p>I am trying to implement automatic face detection using MATLAB. I know how to implement it using OpenCV, but i would like to do it in MATLAB.</p> <p>I saw two websites on this:</p> <p>1) <a href="http://www.mathworks.com/matlabcentral/fileexchange/11073" rel="nofollow">http://www.mathworks.com/matlabcentral/fileex...
15,663
1,152,000
2015-07-03 10:44:34
10,963,699
11
2012-06-09 18:55:10
97,160
2013-04-06 22:14:38
https://stackoverflow.com/q/9300379
https://stackoverflow.com/a/10963699
<p>Starting with the R2012a release, the Computer Vision System Toolbox includes a <a href="http://www.mathworks.com/help/vision/ref/vision.cascadeobjectdetectorclass.html#btaovqu" rel="noreferrer">Viola-Jones based</a> <a href="http://www.mathworks.com/help/vision/gs/object-detection-and-tracking.html#btd13m8" rel="no...
<p>Starting with the R2012a release, the Computer Vision System Toolbox includes a <a href="http://www.mathworks.com/help/vision/ref/vision.cascadeobjectdetectorclass.html#btaovqu" rel="noreferrer">Viola-Jones based</a> <a href="http://www.mathworks.com/help/vision/gs/object-detection-and-tracking.html#btd13m8" rel="no...
854, 1720, 21030, 21754, 97017
computer-vision, face-detection, matlab, matlab-cvst, opencv
<h1>Automatic Face Detection Using MATLAB</h1> <p>I am trying to implement automatic face detection using MATLAB. I know how to implement it using OpenCV, but i would like to do it in MATLAB.</p> <p>I saw two websites on this:</p> <p>1) <a href="http://www.mathworks.com/matlabcentral/fileexchange/11073" rel="nofollow...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,706
cvs
# Automatic Face Detection Using MATLAB I am trying to implement automatic face detection using MATLAB. I know how to implement it using OpenCV, but i would like to do it in MATLAB. I saw two websites on this: 1) <http://www.mathworks.com/matlabcentral/fileexchange/11073>. Firstly, this website is good and it works ...
Starting with the R2012a release, the Computer Vision System Toolbox includes a [Viola-Jones based](http://www.mathworks.com/help/vision/ref/vision.cascadeobjectdetectorclass.html#btaovqu) [face detector](http://www.mathworks.com/help/vision/gs/object-detection-and-tracking.html#btd13m8) with the `vision.CascadeObjectD...
17544745
CVS remove sticky tag without update
8
2013-07-09 09:29:33
<p>CVS is really driving me crazy! </p> <p>Is there any trick to remove sticky tags without updating file contents? I know of 'cvs up -A' but this also changes my files. </p> <p>Or the other way round: Is there any way to update a complete directory to a previous date without setting sticky tags in the first place?...
17,239
220,220
2015-06-05 15:27:37
26,786,936
11
2014-11-06 18:38:12
2,476,389
2014-11-06 18:38:12
https://stackoverflow.com/q/17544745
https://stackoverflow.com/a/26786936
<p>This may depend on your version of CVS, and comes with the caveat that it's not supported, but I used to manually remove the sticky tag from the CVS/Entries file. I did this a lot when I wanted to roll back my working version to a past version but avoid the sticky tag so that I could just update normally when I'm r...
<p>This may depend on your version of CVS, and comes with the caveat that it's not supported, but I used to manually remove the sticky tag from the CVS/Entries file. I did this a lot when I wanted to roll back my working version to a past version but avoid the sticky tag so that I could just update normally when I'm r...
335
cvs
<h1>CVS remove sticky tag without update</h1> <p>CVS is really driving me crazy! </p> <p>Is there any trick to remove sticky tags without updating file contents? I know of 'cvs up -A' but this also changes my files. </p> <p>Or the other way round: Is there any way to update a complete directory to a previous date w...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,707
cvs
# CVS remove sticky tag without update CVS is really driving me crazy! Is there any trick to remove sticky tags without updating file contents? I know of 'cvs up -A' but this also changes my files. Or the other way round: Is there any way to update a complete directory to a previous date without setting sticky tags ...
This may depend on your version of CVS, and comes with the caveat that it's not supported, but I used to manually remove the sticky tag from the CVS/Entries file. I did this a lot when I wanted to roll back my working version to a past version but avoid the sticky tag so that I could just update normally when I'm ready...
3314468
How to get cvs log of commits without checking out repo
8
2010-07-23 00:05:19
<p>I want to get a list of all commits for a module in cvs without checking that module out. Is this possible? If so how?</p> <p>I can use the cvs log command like so:</p> <pre><code>cvs log &gt; commitlog.txt </code></pre> <p>but this only appears to work for already checked out module that i'm running the command ...
15,146
26,335
2015-10-19 14:10:24
3,314,495
11
2010-07-23 00:12:53
383,936
2015-10-19 14:10:24
https://stackoverflow.com/q/3314468
https://stackoverflow.com/a/3314495
<p>Yes. There is a "rlog" command. It is similar to log except doesn't require checked out code. In other words, the command is run "remotely."</p> <blockquote> <p>rlog [options] [files…]</p> <pre><code>Print out history information for modules. See log—Print out log </code></pre> <p>information for files.</...
<p>Yes. There is a "rlog" command. It is similar to log except doesn't require checked out code. In other words, the command is run "remotely."</p> <blockquote> <p>rlog [options] [files…]</p> <pre><code>Print out history information for modules. See log—Print out log </code></pre> <p>information for files.</...
335
cvs
<h1>How to get cvs log of commits without checking out repo</h1> <p>I want to get a list of all commits for a module in cvs without checking that module out. Is this possible? If so how?</p> <p>I can use the cvs log command like so:</p> <pre><code>cvs log &gt; commitlog.txt </code></pre> <p>but this only appears to ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,708
cvs
# How to get cvs log of commits without checking out repo I want to get a list of all commits for a module in cvs without checking that module out. Is this possible? If so how? I can use the cvs log command like so: ``` cvs log > commitlog.txt ``` but this only appears to work for already checked out module that i'...
Yes. There is a "rlog" command. It is similar to log except doesn't require checked out code. In other words, the command is run "remotely." > rlog [options] [files…] > > ``` > Print out history information for modules. See log—Print out log > ``` > > information for files. > > ``` > -b > > Only list revisions on ...
11079781
Cropping an ellipse from an image
6
2012-06-18 09:08:15
<p>I want to extract an elliptical region from an image (a portion of a face portion from an image) preferably in MATLAB:</p> <p><img src="https://i.sstatic.net/nXzFf.gif" alt="enter image description here"> </p> <p>For example, in this image, I want to extract the region within red boundary.<br> Can anyone help me w...
6,280
671,805
2015-10-24 09:03:15
11,081,695
11
2012-06-18 11:18:21
1,336,150
2012-06-19 07:02:39
https://stackoverflow.com/q/11079781
https://stackoverflow.com/a/11081695
<p>Cropping is easy, all you have to do is apply a proper mask. The trick is to create such a mask.</p> <p>Assuming <code>A</code> is your image, try this:</p> <pre><code>%# Create an ellipse shaped mask c = fix(size(A) / 2); %# Ellipse center point (y, x) r_sq = [76, 100] .^ 2; %# Ellipse radii squared (y-axis, x...
<p>Cropping is easy, all you have to do is apply a proper mask. The trick is to create such a mask.</p> <p>Assuming <code>A</code> is your image, try this:</p> <pre><code>%# Create an ellipse shaped mask c = fix(size(A) / 2); %# Ellipse center point (y, x) r_sq = [76, 100] .^ 2; %# Ellipse radii squared (y-axis, x...
854, 6941, 21030, 21754, 97017
computer-vision, face-detection, image-processing, matlab, matlab-cvst
<h1>Cropping an ellipse from an image</h1> <p>I want to extract an elliptical region from an image (a portion of a face portion from an image) preferably in MATLAB:</p> <p><img src="https://i.sstatic.net/nXzFf.gif" alt="enter image description here"> </p> <p>For example, in this image, I want to extract the region wi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%cvs%'; a.Body contains code block; q.Score > 5; a.Score > 10
13,709
cvs
# Cropping an ellipse from an image I want to extract an elliptical region from an image (a portion of a face portion from an image) preferably in MATLAB: ![enter image description here](https://i.sstatic.net/nXzFf.gif) For example, in this image, I want to extract the region within red boundary. Can anyone help m...
Cropping is easy, all you have to do is apply a proper mask. The trick is to create such a mask. Assuming `A` is your image, try this: ``` %# Create an ellipse shaped mask c = fix(size(A) / 2); %# Ellipse center point (y, x) r_sq = [76, 100] .^ 2; %# Ellipse radii squared (y-axis, x-axis) [X, Y] = meshgrid(1:size(...
927358
How do I undo the most recent local commits in Git?
27,180
2009-05-29 18:09:14
<p>I accidentally committed the wrong files to <a href="https://en.wikipedia.org/wiki/Git" rel="noreferrer">Git</a> but haven't pushed the commit to the server yet.</p> <p>How do I undo those commits from the <em>local</em> repository?</p>
16,515,583
89,904
2026-01-20 08:11:20
927,386
30,060
2009-05-29 18:13:42
62,130
2024-12-10 12:20:09
https://stackoverflow.com/q/927358
https://stackoverflow.com/a/927386
<h2>Undo a commit &amp; redo</h2> <pre class="lang-bash prettyprint-override"><code>$ git commit -m &quot;Something terribly misguided&quot; # (0: Your Accident) $ git reset HEAD~ # (1) # === If you just want to undo the commit, stop here! === [ edit files as necessary ] ...
<h2>Undo a commit &amp; redo</h2> <pre class="lang-bash prettyprint-override"><code>$ git commit -m &quot;Something terribly misguided&quot; # (0: Your Accident) $ git reset HEAD~ # (1) # === If you just want to undo the commit, stop here! === [ edit files as necessary ] ...
119, 456, 5766, 53850
git, git-commit, undo, version-control
<h1>How do I undo the most recent local commits in Git?</h1> <p>I accidentally committed the wrong files to <a href="https://en.wikipedia.org/wiki/Git" rel="noreferrer">Git</a> but haven't pushed the commit to the server yet.</p> <p>How do I undo those commits from the <em>local</em> repository?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,710
git
# How do I undo the most recent local commits in Git? I accidentally committed the wrong files to [Git](https://en.wikipedia.org/wiki/Git) but haven't pushed the commit to the server yet. How do I undo those commits from the *local* repository?
## Undo a commit & redo ``` $ git commit -m "Something terribly misguided" # (0: Your Accident) $ git reset HEAD~ # (1) # === If you just want to undo the commit, stop here! === [ edit files as necessary ] # (2) $ git add . # (3) $ git ...
2003505
How do I delete a Git branch locally and remotely?
20,362
2010-01-05 01:12:15
<p>Failed Attempts to Delete a Remote Branch:</p> <pre class="lang-bash prettyprint-override"><code>$ git branch -d remotes/origin/bugfix error: branch 'remotes/origin/bugfix' not found. $ git branch -d origin/bugfix error: branch 'origin/bugfix' not found. $ git branch -rd origin/bugfix Deleted remote branch origin/...
13,244,358
95,592
2025-01-16 08:39:12
2,003,515
26,777
2010-01-05 01:13:55
95,592
2025-01-16 08:39:12
https://stackoverflow.com/q/2003505
https://stackoverflow.com/a/2003515
<h1>Executive Summary</h1> <pre><code>git push -d &lt;remote_name&gt; &lt;branchname&gt; # Delete remote git branch -d &lt;branchname&gt; # Delete local </code></pre> <p><strong>Note:</strong> In most cases, <code>&lt;remote_name&gt;</code> will be <code>origin</code>.</p> <h1>Delete Local Branch</h1> <...
<h1>Executive Summary</h1> <pre><code>git push -d &lt;remote_name&gt; &lt;branchname&gt; # Delete remote git branch -d &lt;branchname&gt; # Delete local </code></pre> <p><strong>Note:</strong> In most cases, <code>&lt;remote_name&gt;</code> will be <code>origin</code>.</p> <h1>Delete Local Branch</h1> <...
119, 456, 28898, 41346, 76220
git, git-branch, git-push, git-remote, version-control
<h1>How do I delete a Git branch locally and remotely?</h1> <p>Failed Attempts to Delete a Remote Branch:</p> <pre class="lang-bash prettyprint-override"><code>$ git branch -d remotes/origin/bugfix error: branch 'remotes/origin/bugfix' not found. $ git branch -d origin/bugfix error: branch 'origin/bugfix' not found. ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,711
git
# How do I delete a Git branch locally and remotely? Failed Attempts to Delete a Remote Branch: ``` $ git branch -d remotes/origin/bugfix error: branch 'remotes/origin/bugfix' not found. $ git branch -d origin/bugfix error: branch 'origin/bugfix' not found. $ git branch -rd origin/bugfix Deleted remote branch origi...
# Executive Summary ``` git push -d <remote_name> <branchname> # Delete remote git branch -d <branchname> # Delete local ``` **Note:** In most cases, `<remote_name>` will be `origin`. # Delete Local Branch To delete the ***local*** branch, use one of the following: ``` git branch -d <branch_name> g...
6591213
How can I rename a local Git branch?
12,001
2011-07-06 03:20:36
<p>How can I rename a local branch which has not yet been pushed to a remote repository?</p> <p>Related:</p> <ul> <li><a href="https://stackoverflow.com/questions/1526794/rename-master-branch-for-both-local-and-remote-git-repositories?answertab=votes#tab-top">Rename master branch for both local and remote Git repositor...
6,307,279
338,204
2025-02-04 17:09:47
6,591,218
19,681
2011-07-06 03:21:42
394,487
2022-09-04 13:58:19
https://stackoverflow.com/q/6591213
https://stackoverflow.com/a/6591218
<p>To rename the current branch:</p> <pre><code>git branch -m &lt;newname&gt; </code></pre> <p>To rename a branch while pointed to any branch:</p> <pre><code>git branch -m &lt;oldname&gt; &lt;newname&gt; </code></pre> <p><code>-m</code> is short for <code>--move</code>.</p> <hr /> <p>To push the local branch and reset...
<p>To rename the current branch:</p> <pre><code>git branch -m &lt;newname&gt; </code></pre> <p>To rename a branch while pointed to any branch:</p> <pre><code>git branch -m &lt;oldname&gt; &lt;newname&gt; </code></pre> <p><code>-m</code> is short for <code>--move</code>.</p> <hr /> <p>To push the local branch and reset...
119, 456, 76220
git, git-branch, version-control
<h1>How can I rename a local Git branch?</h1> <p>How can I rename a local branch which has not yet been pushed to a remote repository?</p> <p>Related:</p> <ul> <li><a href="https://stackoverflow.com/questions/1526794/rename-master-branch-for-both-local-and-remote-git-repositories?answertab=votes#tab-top">Rename master ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,712
git
# How can I rename a local Git branch? How can I rename a local branch which has not yet been pushed to a remote repository? Related: - [Rename master branch for both local and remote Git repositories](https://stackoverflow.com/questions/1526794/rename-master-branch-for-both-local-and-remote-git-repositories?answert...
To rename the current branch: ``` git branch -m <newname> ``` To rename a branch while pointed to any branch: ``` git branch -m <oldname> <newname> ``` `-m` is short for `--move`. --- To push the local branch and reset the upstream branch: ``` git push origin -u <newname> ``` To delete the remote branch: ``` g...
179123
How to modify existing, unpushed commit messages?
7,640
2008-10-07 15:44:47
<p>I wrote the wrong thing in a commit message.</p> <p>How can I change the message? The commit has not been pushed yet.</p>
4,309,161
7,473
2025-07-22 15:53:50
179,147
19,076
2008-10-07 15:50:34
14,113
2022-01-25 00:38:55
https://stackoverflow.com/q/179123
https://stackoverflow.com/a/179147
<h1>Amending the most recent commit message</h1> <pre class="lang-sh prettyprint-override"><code>git commit --amend </code></pre> <p>will open your editor, allowing you to change the commit message of the most recent commit. Additionally, you can set the commit message directly in the command line with:</p> <pre class=...
<h1>Amending the most recent commit message</h1> <pre class="lang-sh prettyprint-override"><code>git commit --amend </code></pre> <p>will open your editor, allowing you to change the commit message of the most recent commit. Additionally, you can set the commit message directly in the command line with:</p> <pre class=...
119, 30968, 53850, 91259
git, git-amend, git-commit, git-rewrite-history
<h1>How to modify existing, unpushed commit messages?</h1> <p>I wrote the wrong thing in a commit message.</p> <p>How can I change the message? The commit has not been pushed yet.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,713
git
# How to modify existing, unpushed commit messages? I wrote the wrong thing in a commit message. How can I change the message? The commit has not been pushed yet.
# Amending the most recent commit message ``` git commit --amend ``` will open your editor, allowing you to change the commit message of the most recent commit. Additionally, you can set the commit message directly in the command line with: ``` git commit --amend -m "New commit message" ``` …however, this can make ...
348170
How do I undo 'git add' before commit?
11,597
2008-12-07 21:57:46
<p>I mistakenly added files to Git using the command:</p> <pre><code>git add myfile.txt </code></pre> <p>I have not yet run <code>git commit</code>. How do I undo this so that these changes will not be included in the commit?</p>
6,304,301
14,069
2025-01-05 04:38:28
348,234
13,865
2008-12-07 22:30:48
39,933
2023-10-11 02:02:19
https://stackoverflow.com/q/348170
https://stackoverflow.com/a/348234
<h3>To unstage a specific file</h3> <pre><code>git reset &lt;file&gt; </code></pre> <p>That will remove the file from the current index (the &quot;about to be committed&quot; list) without changing anything else.</p> <h3>To unstage all files from the current change set:</h3> <pre><code>git reset </code></pre> <hr /> <p...
<h3>To unstage a specific file</h3> <pre><code>git reset &lt;file&gt; </code></pre> <p>That will remove the file from the current index (the &quot;about to be committed&quot; list) without changing anything else.</p> <h3>To unstage all files from the current change set:</h3> <pre><code>git reset </code></pre> <hr /> <p...
119, 5766, 34792, 53850
git, git-add, git-commit, undo
<h1>How do I undo 'git add' before commit?</h1> <p>I mistakenly added files to Git using the command:</p> <pre><code>git add myfile.txt </code></pre> <p>I have not yet run <code>git commit</code>. How do I undo this so that these changes will not be included in the commit?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,714
git
# How do I undo 'git add' before commit? I mistakenly added files to Git using the command: ``` git add myfile.txt ``` I have not yet run `git commit`. How do I undo this so that these changes will not be included in the commit?
### To unstage a specific file ``` git reset <file> ``` That will remove the file from the current index (the "about to be committed" list) without changing anything else. ### To unstage all files from the current change set: ``` git reset ``` --- In old versions of Git, the above commands are equivalent to `git ...
1125968
How do I force "git pull" to overwrite local files?
9,950
2009-07-14 14:58:15
<p>How do I force an overwrite of local files on a <code>git pull</code>? My local repository contains a file of the same filename as on the server.</p> <blockquote> <p>error: Untracked working tree file 'example.txt' would be overwritten by merge</p> </blockquote>
9,503,082
98,046
2026-01-08 15:06:36
8,888,015
13,620
2012-01-17 00:02:58
489,564
2024-11-15 19:49:34
https://stackoverflow.com/q/1125968
https://stackoverflow.com/a/8888015
<blockquote> <h2>⚠ Warning:</h2> <p>Any uncommitted local change to tracked files will be lost, <strong>even if staged</strong>.</p> <p>But any local file that's <em>not</em> tracked by Git will <em>not</em> be affected.</p> </blockquote> <hr /> <p>First, update all <code>origin/&lt;branch&gt;</code> refs to latest:</p...
<blockquote> <h2>⚠ Warning:</h2> <p>Any uncommitted local change to tracked files will be lost, <strong>even if staged</strong>.</p> <p>But any local file that's <em>not</em> tracked by Git will <em>not</em> be affected.</p> </blockquote> <hr /> <p>First, update all <code>origin/&lt;branch&gt;</code> refs to latest:</p...
119, 456, 8000, 28896, 33720
git, git-fetch, git-pull, overwrite, version-control
<h1>How do I force "git pull" to overwrite local files?</h1> <p>How do I force an overwrite of local files on a <code>git pull</code>? My local repository contains a file of the same filename as on the server.</p> <blockquote> <p>error: Untracked working tree file 'example.txt' would be overwritten by merge</p> </block...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,715
git
# How do I force "git pull" to overwrite local files? How do I force an overwrite of local files on a `git pull`? My local repository contains a file of the same filename as on the server. > error: Untracked working tree file 'example.txt' would be overwritten by merge
> ## ⚠ Warning: > > Any uncommitted local change to tracked files will be lost, **even if staged**. > > But any local file that's *not* tracked by Git will *not* be affected. --- First, update all `origin/<branch>` refs to latest: ``` git fetch --all ``` Backup your current branch (e.g. `main`): ``` git branch bac...
4114095
How do I revert a Git repository to a previous commit?
7,607
2010-11-06 16:58:14
<p>How do I revert from my current state to a snapshot made on a certain commit?</p> <p>If I do <code>git log</code>, then I get the following output:</p> <pre><code>$ git log commit a867b4af366350be2e7c21b8de9cc6504678a61b` Author: Me &lt;me@me.com&gt; Date: Thu Nov 4 18:59:41 2010 -0400 blah blah blah... commit...
12,771,872
111,174
2025-02-23 12:21:56
4,114,122
12,571
2010-11-06 17:04:54
119,963
2024-03-06 15:03:35
https://stackoverflow.com/q/4114095
https://stackoverflow.com/a/4114122
<p>This depends a lot on what you mean by &quot;revert&quot;.</p> <h2>Temporarily switch to a different commit</h2> <p>If you want to temporarily go back to it, fool around, then come back to where you are, all you have to do is check out the desired commit:</p> <pre class="lang-sh prettyprint-override"><code># This wi...
<p>This depends a lot on what you mean by &quot;revert&quot;.</p> <h2>Temporarily switch to a different commit</h2> <p>If you want to temporarily go back to it, fool around, then come back to where you are, all you have to do is check out the desired commit:</p> <pre class="lang-sh prettyprint-override"><code># This wi...
119, 34403, 37230, 51381
git, git-checkout, git-reset, git-revert
<h1>How do I revert a Git repository to a previous commit?</h1> <p>How do I revert from my current state to a snapshot made on a certain commit?</p> <p>If I do <code>git log</code>, then I get the following output:</p> <pre><code>$ git log commit a867b4af366350be2e7c21b8de9cc6504678a61b` Author: Me &lt;me@me.com&gt; ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,716
git
# How do I revert a Git repository to a previous commit? How do I revert from my current state to a snapshot made on a certain commit? If I do `git log`, then I get the following output: ``` $ git log commit a867b4af366350be2e7c21b8de9cc6504678a61b` Author: Me <me@me.com> Date: Thu Nov 4 18:59:41 2010 -0400 blah ...
This depends a lot on what you mean by "revert". ## Temporarily switch to a different commit If you want to temporarily go back to it, fool around, then come back to where you are, all you have to do is check out the desired commit: ``` # This will detach your HEAD, that is, leave you with no branch checked out: git...
1783405
How can I check out a remote Git branch?
8,875
2009-11-23 14:23:46
<p>How do I check out the remote <code>test</code> branch? I can see it with <code>git branch -r</code>. I tried:</p> <ul> <li><code>git checkout test</code>, which does nothing</li> <li><code>git checkout origin/test</code> gives <code>* (no branch)</code></li> </ul>
9,585,100
179,467
2025-12-08 18:08:53
1,783,426
11,957
2009-11-23 14:26:08
214,090
2023-05-27 15:43:43
https://stackoverflow.com/q/1783405
https://stackoverflow.com/a/1783426
<p>The answer has been split depending on whether there is one remote repository configured or multiple. The reason for this is that for the single remote case, some of the commands can be simplified as there is less ambiguity.</p> <p><strong>Updated for Git 2.23:</strong> For older versions, see the section at the end...
<p>The answer has been split depending on whether there is one remote repository configured or multiple. The reason for this is that for the single remote case, some of the commands can be simplified as there is less ambiguity.</p> <p><strong>Updated for Git 2.23:</strong> For older versions, see the section at the end...
119, 31678, 37230
git, git-checkout, remote-branch
<h1>How can I check out a remote Git branch?</h1> <p>How do I check out the remote <code>test</code> branch? I can see it with <code>git branch -r</code>. I tried:</p> <ul> <li><code>git checkout test</code>, which does nothing</li> <li><code>git checkout origin/test</code> gives <code>* (no branch)</code></li> </ul>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,717
git
# How can I check out a remote Git branch? How do I check out the remote `test` branch? I can see it with `git branch -r`. I tried: - `git checkout test`, which does nothing - `git checkout origin/test` gives `* (no branch)`
The answer has been split depending on whether there is one remote repository configured or multiple. The reason for this is that for the single remote case, some of the commands can be simplified as there is less ambiguity. **Updated for Git 2.23:** For older versions, see the section at the end. ## With One Remote ...
292357
What is the difference between 'git pull' and 'git fetch'?
14,031
2008-11-15 09:51:09
<p>What are the differences between <a href="https://git-scm.com/docs/git-pull" rel="noreferrer"><code>git pull</code></a> and <a href="https://git-scm.com/docs/git-fetch" rel="noreferrer"><code>git fetch</code></a>?</p>
3,716,393
6,068
2025-10-10 04:36:48
292,359
11,691
2008-11-15 09:52:40
893
2024-11-17 12:49:41
https://stackoverflow.com/q/292357
https://stackoverflow.com/a/292359
<p>In the simplest terms, <a href="https://git-scm.com/docs/git-pull" rel="noreferrer"><code>git pull</code></a> does a <a href="https://git-scm.com/docs/git-fetch" rel="noreferrer"><code>git fetch</code></a> followed by a <a href="https://git-scm.com/docs/git-merge" rel="noreferrer"><code>git merge</code></a>.</p> <hr...
<p>In the simplest terms, <a href="https://git-scm.com/docs/git-pull" rel="noreferrer"><code>git pull</code></a> does a <a href="https://git-scm.com/docs/git-fetch" rel="noreferrer"><code>git fetch</code></a> followed by a <a href="https://git-scm.com/docs/git-merge" rel="noreferrer"><code>git merge</code></a>.</p> <hr...
119, 456, 28896, 33720
git, git-fetch, git-pull, version-control
<h1>What is the difference between 'git pull' and 'git fetch'?</h1> <p>What are the differences between <a href="https://git-scm.com/docs/git-pull" rel="noreferrer"><code>git pull</code></a> and <a href="https://git-scm.com/docs/git-fetch" rel="noreferrer"><code>git fetch</code></a>?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,718
git
# What is the difference between 'git pull' and 'git fetch'? What are the differences between [`git pull`](https://git-scm.com/docs/git-pull) and [`git fetch`](https://git-scm.com/docs/git-fetch)?
In the simplest terms, [`git pull`](https://git-scm.com/docs/git-pull) does a [`git fetch`](https://git-scm.com/docs/git-fetch) followed by a [`git merge`](https://git-scm.com/docs/git-merge). --- `git fetch` updates your remote-tracking branches under `refs/remotes/<remote>/`. This operation is safe to run at any ti...
2432764
How do I change the URI (URL) for a remote Git repository?
6,874
2010-03-12 12:48:47
<p>I have a repo (origin) on a USB key that I cloned on my hard drive (local). I moved &quot;origin&quot; to a NAS and successfully tested cloning it from here.</p> <p>I would like to know if I can change the URI of &quot;origin&quot; in the settings of &quot;local&quot; so it will now pull from the NAS, and not from t...
5,353,933
9,951
2026-01-16 16:29:41
2,432,799
11,124
2010-03-12 12:55:50
152,948
2026-01-16 16:29:41
https://stackoverflow.com/q/2432764
https://stackoverflow.com/a/2432799
<p>First, view the existing remotes to verify which URL is currently set:</p> <pre class="lang-bash prettyprint-override"><code>git remote -v </code></pre> <p>Then, you can set it with:</p> <pre class="lang-bash prettyprint-override"><code>git remote set-url origin &lt;NEW_GIT_URL_HERE&gt; </code></pre> <p>See <a href=...
<p>First, view the existing remotes to verify which URL is currently set:</p> <pre class="lang-bash prettyprint-override"><code>git remote -v </code></pre> <p>Then, you can set it with:</p> <pre class="lang-bash prettyprint-override"><code>git remote set-url origin &lt;NEW_GIT_URL_HERE&gt; </code></pre> <p>See <a href=...
119, 365, 41346
git, git-remote, url
<h1>How do I change the URI (URL) for a remote Git repository?</h1> <p>I have a repo (origin) on a USB key that I cloned on my hard drive (local). I moved &quot;origin&quot; to a NAS and successfully tested cloning it from here.</p> <p>I would like to know if I can change the URI of &quot;origin&quot; in the settings o...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,719
git
# How do I change the URI (URL) for a remote Git repository? I have a repo (origin) on a USB key that I cloned on my hard drive (local). I moved "origin" to a NAS and successfully tested cloning it from here. I would like to know if I can change the URI of "origin" in the settings of "local" so it will now pull from ...
First, view the existing remotes to verify which URL is currently set: ``` git remote -v ``` Then, you can set it with: ``` git remote set-url origin <NEW_GIT_URL_HERE> ``` See [`git help remote`](https://git-scm.com/docs/git-remote). You also can edit `.git/config` and change the URLs there. You're not in any dan...
1628088
Reset local repository branch to be just like remote repository HEAD
5,981
2009-10-27 00:27:20
<p>How do I reset my local branch to be just like the branch on the remote repository?</p> <p>I tried:</p> <pre><code>git reset --hard HEAD </code></pre> <p>But <code>git status</code> claims I have modified files:</p> <pre><code>On branch master Changes to be committed: (use &quot;git reset HEAD &lt;file&gt;...&quot...
7,265,310
128,983
2025-09-26 11:32:55
1,628,334
10,304
2009-10-27 01:44:30
95,706
2025-06-16 00:25:35
https://stackoverflow.com/q/1628088
https://stackoverflow.com/a/1628334
<p>Setting your branch to exactly match the remote branch can be done in two steps:</p> <pre class="lang-bash prettyprint-override"><code>git fetch origin git reset --hard origin/master </code></pre> <p>If you want to save your current branch's state before doing this (just in case), you can do:</p> <pre class="lang-b...
<p>Setting your branch to exactly match the remote branch can be done in two steps:</p> <pre class="lang-bash prettyprint-override"><code>git fetch origin git reset --hard origin/master </code></pre> <p>If you want to save your current branch's state before doing this (just in case), you can do:</p> <pre class="lang-b...
119, 5766
git, undo
<h1>Reset local repository branch to be just like remote repository HEAD</h1> <p>How do I reset my local branch to be just like the branch on the remote repository?</p> <p>I tried:</p> <pre><code>git reset --hard HEAD </code></pre> <p>But <code>git status</code> claims I have modified files:</p> <pre><code>On branch ma...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,720
git
# Reset local repository branch to be just like remote repository HEAD How do I reset my local branch to be just like the branch on the remote repository? I tried: ``` git reset --hard HEAD ``` But `git status` claims I have modified files: ``` On branch master Changes to be committed: (use "git reset HEAD <file...
Setting your branch to exactly match the remote branch can be done in two steps: ``` git fetch origin git reset --hard origin/master ``` If you want to save your current branch's state before doing this (just in case), you can do: ``` git commit -a -m "Saving my work, just in case" git branch my-saved-work ``` Now ...
61212
How do I remove local (untracked) files from the current Git working tree?
8,378
2008-09-14 09:06:10
<p>How do I delete untracked local files from the current working tree?</p>
3,676,359
4,883
2024-09-18 01:05:03
64,966
10,086
2008-09-15 17:32:55
null
2024-09-18 01:03:36
https://stackoverflow.com/q/61212
https://stackoverflow.com/a/64966
<blockquote> <h2><a href="https://git-scm.com/docs/git-clean" rel="noreferrer">git-clean</a> - Remove untracked files from the working tree</h2> <h3>Synopsis</h3> <pre><code>git clean [-d] [-f] [-i] [-n] [-q] [-e &lt;pattern&gt;] [-x | -X] [--] &lt;path&gt;…​ </code></pre> <h3>Description</h3> <p>Cleans the working tre...
<blockquote> <h2><a href="https://git-scm.com/docs/git-clean" rel="noreferrer">git-clean</a> - Remove untracked files from the working tree</h2> <h3>Synopsis</h3> <pre><code>git clean [-d] [-f] [-i] [-n] [-q] [-e &lt;pattern&gt;] [-x | -X] [--] &lt;path&gt;…​ </code></pre> <h3>Description</h3> <p>Cleans the working tre...
119, 1879, 76220
branch, git, git-branch
<h1>How do I remove local (untracked) files from the current Git working tree?</h1> <p>How do I delete untracked local files from the current working tree?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,721
git
# How do I remove local (untracked) files from the current Git working tree? How do I delete untracked local files from the current working tree?
> ## [git-clean](https://git-scm.com/docs/git-clean) - Remove untracked files from the working tree > > ### Synopsis > > ``` > git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <path>…​ > ``` > > ### Description > > Cleans the working tree by recursively removing files that are not under version control,...
1274057
How do I make Git forget about a file that was tracked, but is now in .gitignore?
8,599
2009-08-13 19:23:22
<p>I put a file that was previously being tracked by Git onto the <code>.gitignore</code> list. However, the file still shows up in <code>git status</code> after it is edited. How do I force Git to completely forget the file?</p>
2,735,817
16,957
2025-06-30 19:15:12
1,274,447
9,266
2009-08-13 20:40:59
19,563
2025-06-30 19:15:12
https://stackoverflow.com/q/1274057
https://stackoverflow.com/a/1274447
<p><code>.gitignore</code> will prevent untracked files from being added (without an <code>add -f</code>) to the set of files tracked by Git. However, Git will continue to track any files that are already being tracked.</p> <p>To stop tracking a file, we must remove it from the index:</p> <pre><code>git rm --cached &lt...
<p><code>.gitignore</code> will prevent untracked files from being added (without an <code>add -f</code>) to the set of files tracked by Git. However, Git will continue to track any files that are already being tracked.</p> <p>To stop tracking a file, we must remove it from the index:</p> <pre><code>git rm --cached &lt...
119, 25056, 112901
git, gitignore, git-rm
<h1>How do I make Git forget about a file that was tracked, but is now in .gitignore?</h1> <p>I put a file that was previously being tracked by Git onto the <code>.gitignore</code> list. However, the file still shows up in <code>git status</code> after it is edited. How do I force Git to completely forget the file?</p>...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,722
git
# How do I make Git forget about a file that was tracked, but is now in .gitignore? I put a file that was previously being tracked by Git onto the `.gitignore` list. However, the file still shows up in `git status` after it is edited. How do I force Git to completely forget the file?
`.gitignore` will prevent untracked files from being added (without an `add -f`) to the set of files tracked by Git. However, Git will continue to track any files that are already being tracked. To stop tracking a file, we must remove it from the index: ``` git rm --cached <file> ``` To remove a folder and all files...
2765421
How do I push a new local branch to a remote Git repository and track it too?
5,835
2010-05-04 12:58:34
<p>How do I:</p> <ol> <li><p>Create a local branch from another branch (via <code>git branch</code> or <code>git checkout -b</code>).</p> </li> <li><p>Push the local branch to the remote repository (i.e. publish), but make it trackable so that <code>git pull</code> and <code>git push</code> will work.</p> </li> </ol>
6,785,265
222,187
2025-07-21 20:01:47
6,232,535
8,656
2011-06-03 20:50:29
188,715
2025-03-03 07:58:22
https://stackoverflow.com/q/2765421
https://stackoverflow.com/a/6232535
<p>In Git 1.7.0 and later, you can checkout a new branch:</p> <pre><code>git checkout -b &lt;branch&gt; </code></pre> <p>Edit files, add and commit. Then <a href="https://git-scm.com/docs/git-push#Documentation/git-push.txt--u" rel="noreferrer">push with the <code>-u</code> (short for <code>--set-upstream</code>)</a> o...
<p>In Git 1.7.0 and later, you can checkout a new branch:</p> <pre><code>git checkout -b &lt;branch&gt; </code></pre> <p>Edit files, add and commit. Then <a href="https://git-scm.com/docs/git-push#Documentation/git-push.txt--u" rel="noreferrer">push with the <code>-u</code> (short for <code>--set-upstream</code>)</a> o...
119, 7330, 28898, 41346, 76220
git, git-branch, git-push, git-remote, repository
<h1>How do I push a new local branch to a remote Git repository and track it too?</h1> <p>How do I:</p> <ol> <li><p>Create a local branch from another branch (via <code>git branch</code> or <code>git checkout -b</code>).</p> </li> <li><p>Push the local branch to the remote repository (i.e. publish), but make it trackab...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,723
git
# How do I push a new local branch to a remote Git repository and track it too? How do I: 1. Create a local branch from another branch (via `git branch` or `git checkout -b`). 2. Push the local branch to the remote repository (i.e. publish), but make it trackable so that `git pull` and `git push` will work.
In Git 1.7.0 and later, you can checkout a new branch: ``` git checkout -b <branch> ``` Edit files, add and commit. Then [push with the `-u` (short for `--set-upstream`)](https://git-scm.com/docs/git-push#Documentation/git-push.txt--u) option: ``` git push -u origin <branch> ``` Git will set up the tracking informa...
1628563
Move the most recent commit(s) to a new branch with Git
6,760
2009-10-27 03:07:34
<p>How do I move my recent commits on <code>master</code> to a new branch, and reset master to before those commits were made? e.g. From this:</p> <pre><code>master A - B - C - D - E </code></pre> <p>To this:</p> <pre><code>newbranch C - D - E / master A - B </code></pre>
1,988,872
1,103,052
2025-09-03 16:12:25
1,628,584
8,629
2009-10-27 03:15:15
53,850
2024-02-28 16:23:17
https://stackoverflow.com/q/1628563
https://stackoverflow.com/a/1628584
<p>WARNING: You <strong>need to store uncommitted edits</strong> to your stash before doing this, using <code>git stash</code>. Once complete, you can retrieve the stashed uncommitted edits with <code>git stash pop</code>. <a href="https://git-scm.com/docs/git-reset#Documentation/git-reset.txt---hard" rel="noreferrer">...
<p>WARNING: You <strong>need to store uncommitted edits</strong> to your stash before doing this, using <code>git stash</code>. Once complete, you can retrieve the stashed uncommitted edits with <code>git stash pop</code>. <a href="https://git-scm.com/docs/git-reset#Documentation/git-reset.txt---hard" rel="noreferrer">...
119, 53847, 76220
branching-and-merging, git, git-branch
<h1>Move the most recent commit(s) to a new branch with Git</h1> <p>How do I move my recent commits on <code>master</code> to a new branch, and reset master to before those commits were made? e.g. From this:</p> <pre><code>master A - B - C - D - E </code></pre> <p>To this:</p> <pre><code>newbranch C - D - E ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,724
git
# Move the most recent commit(s) to a new branch with Git How do I move my recent commits on `master` to a new branch, and reset master to before those commits were made? e.g. From this: ``` master A - B - C - D - E ``` To this: ``` newbranch C - D - E / master A - B ```
WARNING: You **need to store uncommitted edits** to your stash before doing this, using `git stash`. Once complete, you can retrieve the stashed uncommitted edits with `git stash pop`. [git reset hard command will remove all changes!](https://git-scm.com/docs/git-reset#Documentation/git-reset.txt---hard) ## Moving to ...
5480258
How can I delete a remote tag?
5,106
2011-03-29 23:41:56
<p>How can I delete a Git tag that has already been pushed?</p>
2,584,796
97,101
2026-01-23 18:58:35
5,480,292
8,317
2011-03-29 23:45:58
15,872
2025-05-12 08:53:24
https://stackoverflow.com/q/5480258
https://stackoverflow.com/a/5480292
<p>You can push an 'empty' reference to the remote tag name:</p> <pre><code>git push origin :tagname </code></pre> <p>Or, more expressively, use the <code>--delete</code> option (or <code>-d</code> if your git version is older than 1.8.0):</p> <pre><code>git push --delete origin tagname </code></pre> <p>Note that git h...
<p>You can push an 'empty' reference to the remote tag name:</p> <pre><code>git push origin :tagname </code></pre> <p>Or, more expressively, use the <code>--delete</code> option (or <code>-d</code> if your git version is older than 1.8.0):</p> <pre><code>git push --delete origin tagname </code></pre> <p>Note that git h...
119, 60718
git, git-tag
<h1>How can I delete a remote tag?</h1> <p>How can I delete a Git tag that has already been pushed?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,725
git
# How can I delete a remote tag? How can I delete a Git tag that has already been pushed?
You can push an 'empty' reference to the remote tag name: ``` git push origin :tagname ``` Or, more expressively, use the `--delete` option (or `-d` if your git version is older than 1.8.0): ``` git push --delete origin tagname ``` Note that git has tag namespace and branch namespace so you may use the same name fo...
215718
How can I reset or revert a file to a specific revision?
5,887
2008-10-18 23:34:02
<p>How can I revert a modified file to its previous revision at a specific commit hash (which I determined via <a href="https://git-scm.com/docs/git-log" rel="noreferrer"><code>git log</code></a> and <a href="https://git-scm.com/docs/git-diff" rel="noreferrer"><code>git diff</code></a>)?</p>
3,302,709
3,410
2024-11-11 14:29:44
215,731
7,903
2008-10-18 23:39:35
893
2023-12-10 20:50:14
https://stackoverflow.com/q/215718
https://stackoverflow.com/a/215731
<p>Assuming the hash of the commit you want is <code>c5f567</code>:</p> <pre><code>git checkout c5f567 -- file1/to/restore file2/to/restore </code></pre> <p>The <a href="https://git-scm.com/docs/git-checkout" rel="noreferrer">git checkout</a> man page gives more information.</p> <p>If you want to revert to the commit b...
<p>Assuming the hash of the commit you want is <code>c5f567</code>:</p> <pre><code>git checkout c5f567 -- file1/to/restore file2/to/restore </code></pre> <p>The <a href="https://git-scm.com/docs/git-checkout" rel="noreferrer">git checkout</a> man page gives more information.</p> <p>If you want to revert to the commit b...
119, 456, 37230, 165501
git, git-checkout, git-restore, version-control
<h1>How can I reset or revert a file to a specific revision?</h1> <p>How can I revert a modified file to its previous revision at a specific commit hash (which I determined via <a href="https://git-scm.com/docs/git-log" rel="noreferrer"><code>git log</code></a> and <a href="https://git-scm.com/docs/git-diff" rel="noref...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,727
git
# How can I reset or revert a file to a specific revision? How can I revert a modified file to its previous revision at a specific commit hash (which I determined via [`git log`](https://git-scm.com/docs/git-log) and [`git diff`](https://git-scm.com/docs/git-diff))?
Assuming the hash of the commit you want is `c5f567`: ``` git checkout c5f567 -- file1/to/restore file2/to/restore ``` The [git checkout](https://git-scm.com/docs/git-checkout) man page gives more information. If you want to revert to the commit before `c5f567`, append `~1` (where 1 is the number of commits you want...
134882
Undoing a git rebase
4,464
2008-09-25 17:59:22
<p>How do I easily undo a git rebase? A lengthy manual method is:</p> <ol> <li>checkout the commit parent to both of the branches</li> <li>create and checkout a temporary branch</li> <li>cherry-pick all commits by hand</li> <li>reset the faulty rebased branch to point to the temporary branch</li> </ol> <p>In my current...
2,363,923
6,349
2025-10-29 15:18:23
135,614
6,204
2008-09-25 19:56:28
19,563
2025-03-20 18:01:33
https://stackoverflow.com/q/134882
https://stackoverflow.com/a/135614
<p>The easiest way would be to find the head commit of the branch as it was immediately before the rebase started in the <a href="https://git-scm.com/docs/git-reflog" rel="noreferrer">reflog</a>...</p> <pre><code>git reflog </code></pre> <p>and to reset the current branch to it.</p> <p>Suppose the old commit was <code>...
<p>The easiest way would be to find the head commit of the branch as it was immediately before the rebase started in the <a href="https://git-scm.com/docs/git-reflog" rel="noreferrer">reflog</a>...</p> <pre><code>git reflog </code></pre> <p>and to reset the current branch to it.</p> <p>Suppose the old commit was <code>...
119, 5766, 8974, 29934
git, git-rebase, rebase, undo
<h1>Undoing a git rebase</h1> <p>How do I easily undo a git rebase? A lengthy manual method is:</p> <ol> <li>checkout the commit parent to both of the branches</li> <li>create and checkout a temporary branch</li> <li>cherry-pick all commits by hand</li> <li>reset the faulty rebased branch to point to the temporary bran...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,728
git
# Undoing a git rebase How do I easily undo a git rebase? A lengthy manual method is: 1. checkout the commit parent to both of the branches 2. create and checkout a temporary branch 3. cherry-pick all commits by hand 4. reset the faulty rebased branch to point to the temporary branch In my current situation, this wo...
The easiest way would be to find the head commit of the branch as it was immediately before the rebase started in the [reflog](https://git-scm.com/docs/git-reflog)... ``` git reflog ``` and to reset the current branch to it. Suppose the old commit was `HEAD@{2}` in the ref log: ``` git reset --soft "HEAD@{2}" ``` ...
1338728
How do I delete a commit from a branch?
4,504
2009-08-27 03:39:50
<p>How do I delete a commit from my branch history? Should I use <code>git reset --hard HEAD</code>?</p>
5,728,939
128,983
2025-07-21 16:28:16
1,338,744
5,730
2009-08-27 03:44:04
64,004
2024-03-30 21:31:37
https://stackoverflow.com/q/1338728
https://stackoverflow.com/a/1338744
<p><strong>Careful:</strong> <code>git reset --hard</code> <strong>WILL DELETE YOUR WORKING DIRECTORY CHANGES</strong>. Be sure to <strong>stash any local changes you want to keep</strong> before running this command.</p> <p>Assuming you are sitting on that commit, then this command will wack it...</p> <pre class="lang...
<p><strong>Careful:</strong> <code>git reset --hard</code> <strong>WILL DELETE YOUR WORKING DIRECTORY CHANGES</strong>. Be sure to <strong>stash any local changes you want to keep</strong> before running this command.</p> <p>Assuming you are sitting on that commit, then this command will wack it...</p> <pre class="lang...
119, 5597, 29934, 51381, 53850
commit, git, git-commit, git-rebase, git-reset
<h1>How do I delete a commit from a branch?</h1> <p>How do I delete a commit from my branch history? Should I use <code>git reset --hard HEAD</code>?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,729
git
# How do I delete a commit from a branch? How do I delete a commit from my branch history? Should I use `git reset --hard HEAD`?
**Careful:** `git reset --hard` **WILL DELETE YOUR WORKING DIRECTORY CHANGES**. Be sure to **stash any local changes you want to keep** before running this command. Assuming you are sitting on that commit, then this command will wack it... ``` git reset --hard HEAD~1 ``` The `HEAD~1` means the commit before head. O...
1143796
Remove a file from a Git repository without deleting it from the local filesystem
4,060
2009-07-17 14:56:43
<p>I want to remove a file from my repository.</p> <pre><code>git rm file_to_remove.txt </code></pre> <p>will remove the file from the repository, but it will also remove the file from the local file system. How do I remove this file from the repo <strong>without</strong> deleting my local copy of the file?</p>
1,346,366
127,056
2025-07-22 12:49:25
1,143,800
5,657
2009-07-17 14:57:26
36,723
2022-07-25 05:07:20
https://stackoverflow.com/q/1143796
https://stackoverflow.com/a/1143800
<p>The <a href="https://git-scm.com/docs/git-rm" rel="noreferrer"><code>git rm</code></a> documentation states:</p> <blockquote> <p>When <code>--cached</code> is given, the staged content has to match either the tip of the branch or the file on disk, allowing the file to be removed from just the index.</p> </blockquote...
<p>The <a href="https://git-scm.com/docs/git-rm" rel="noreferrer"><code>git rm</code></a> documentation states:</p> <blockquote> <p>When <code>--cached</code> is given, the staged content has to match either the tip of the branch or the file on disk, allowing the file to be removed from just the index.</p> </blockquote...
119, 7330, 18556, 37510, 112901
delete-file, git, git-rm, remote-server, repository
<h1>Remove a file from a Git repository without deleting it from the local filesystem</h1> <p>I want to remove a file from my repository.</p> <pre><code>git rm file_to_remove.txt </code></pre> <p>will remove the file from the repository, but it will also remove the file from the local file system. How do I remove this ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,730
git
# Remove a file from a Git repository without deleting it from the local filesystem I want to remove a file from my repository. ``` git rm file_to_remove.txt ``` will remove the file from the repository, but it will also remove the file from the local file system. How do I remove this file from the repo **without** ...
The [`git rm`](https://git-scm.com/docs/git-rm) documentation states: > When `--cached` is given, the staged content has to match either the tip of the branch or the file on disk, allowing the file to be removed from just the index. So, for a single file: ``` git rm --cached file_to_remove.txt ``` and for a single ...
2389361
Undo a Git merge that hasn't been pushed yet
4,981
2010-03-05 19:24:44
<p>I accidentally ran <code>git merge some_other_branch</code> on my local master branch. I haven't pushed the changes to origin master. How do I undo the merge?</p> <hr /> <p>After merging, <code>git status</code> says:</p> <pre><code># On branch master # Your branch is ahead of 'origin/master' by 5 commits. </code></...
3,492,366
107,277
2025-05-29 10:26:57
2,389,423
5,628
2010-03-05 19:34:01
5,731
2018-11-30 02:00:37
https://stackoverflow.com/q/2389361
https://stackoverflow.com/a/2389423
<p>With <code>git reflog</code> check which commit is one prior the merge (<code>git reflog</code> will be a better option than <code>git log</code>). Then you can reset it using:</p> <pre><code>git reset --hard commit_sha </code></pre> <p>There's also another way:</p> <pre><code>git reset --hard HEAD~1 </code></pre...
<p>With <code>git reflog</code> check which commit is one prior the merge (<code>git reflog</code> will be a better option than <code>git log</code>). Then you can reset it using:</p> <pre><code>git reset --hard commit_sha </code></pre> <p>There's also another way:</p> <pre><code>git reset --hard HEAD~1 </code></pre...
119, 5766, 28897
git, git-merge, undo
<h1>Undo a Git merge that hasn't been pushed yet</h1> <p>I accidentally ran <code>git merge some_other_branch</code> on my local master branch. I haven't pushed the changes to origin master. How do I undo the merge?</p> <hr /> <p>After merging, <code>git status</code> says:</p> <pre><code># On branch master # Your bran...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,731
git
# Undo a Git merge that hasn't been pushed yet I accidentally ran `git merge some_other_branch` on my local master branch. I haven't pushed the changes to origin master. How do I undo the merge? --- After merging, `git status` says: ``` # On branch master # Your branch is ahead of 'origin/master' by 5 commits. ``` ...
With `git reflog` check which commit is one prior the merge (`git reflog` will be a better option than `git log`). Then you can reset it using: ``` git reset --hard commit_sha ``` There's also another way: ``` git reset --hard HEAD~1 ``` It will get you back 1 commit. **Be aware that any modified and uncommitted/u...
3042437
How can I change the commit author for a single commit?
3,314
2010-06-15 04:00:08
<p>I want to change the <code>author</code> of a specific commit in the <code>git</code> history, and it's <strong>not</strong> the <em>latest</em> commit.</p> <p><strong>Related:</strong> <a href="https://stackoverflow.com/questions/750172/how-do-i-change-the-author-of-a-commit-in-git">How do I change the author and c...
1,974,883
69,684
2025-08-20 17:14:31
3,042,512
5,324
2010-06-15 04:31:46
148,870
2020-04-03 10:25:31
https://stackoverflow.com/q/3042437
https://stackoverflow.com/a/3042512
<p>Interactive rebase off of a point earlier in the history than the commit you need to modify (<code>git rebase -i &lt;earliercommit&gt;</code>). In the list of commits being rebased, change the text from <code>pick</code> to <code>edit</code> next to the hash of the one you want to modify. Then when git prompts you t...
<p>Interactive rebase off of a point earlier in the history than the commit you need to modify (<code>git rebase -i &lt;earliercommit&gt;</code>). In the list of commits being rebased, change the text from <code>pick</code> to <code>edit</code> next to the hash of the one you want to modify. Then when git prompts you t...
119, 53850
git, git-commit
<h1>How can I change the commit author for a single commit?</h1> <p>I want to change the <code>author</code> of a specific commit in the <code>git</code> history, and it's <strong>not</strong> the <em>latest</em> commit.</p> <p><strong>Related:</strong> <a href="https://stackoverflow.com/questions/750172/how-do-i-chang...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,733
git
# How can I change the commit author for a single commit? I want to change the `author` of a specific commit in the `git` history, and it's **not** the *latest* commit. **Related:** [How do I change the author and committer name/email for multiple commits?](https://stackoverflow.com/questions/750172/how-do-i-change-t...
Interactive rebase off of a point earlier in the history than the commit you need to modify (`git rebase -i <earliercommit>`). In the list of commits being rebased, change the text from `pick` to `edit` next to the hash of the one you want to modify. Then when git prompts you to change the commit, use this: ``` git co...
115983
How do I add an empty directory to a Git repository?
5,509
2008-09-22 16:41:03
<p>How do I add an empty directory (that contains no files) to a Git repository?</p>
1,734,320
7,473
2025-07-19 21:25:58
932,982
5,245
2009-05-31 22:10:40
115,218
2018-11-20 11:59:59
https://stackoverflow.com/q/115983
https://stackoverflow.com/a/932982
<p>Another way to make a directory stay (almost) empty (in the repository) is to create a <code>.gitignore</code> file inside that directory that contains these four lines:</p> <pre><code># Ignore everything in this directory * # Except this file !.gitignore </code></pre> <p>Then you don't have to get the order right...
<p>Another way to make a directory stay (almost) empty (in the repository) is to create a <code>.gitignore</code> file inside that directory that contains these four lines:</p> <pre><code># Ignore everything in this directory * # Except this file !.gitignore </code></pre> <p>Then you don't have to get the order right...
119, 218, 34792
directory, git, git-add
<h1>How do I add an empty directory to a Git repository?</h1> <p>How do I add an empty directory (that contains no files) to a Git repository?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,734
git
# How do I add an empty directory to a Git repository? How do I add an empty directory (that contains no files) to a Git repository?
Another way to make a directory stay (almost) empty (in the repository) is to create a `.gitignore` file inside that directory that contains these four lines: ``` # Ignore everything in this directory * # Except this file !.gitignore ``` Then you don't have to get the order right the way that you have to do in m104's...
67699
How do I clone all remote branches?
4,839
2008-09-15 22:42:07
<p>My <code>master</code> and <code>development</code> branches are tracked remotely on <a href="http://en.wikipedia.org/wiki/GitHub" rel="noreferrer">GitHub</a>. How do I clone both these branches?</p>
1,897,398
117
2025-12-17 14:08:28
72,156
5,229
2008-09-16 13:28:22
12,089
2022-08-02 22:29:56
https://stackoverflow.com/q/67699
https://stackoverflow.com/a/72156
<p>First, clone a remote <a href="http://en.wikipedia.org/wiki/Git_%28software%29" rel="noreferrer">Git</a> repository and <a href="http://en.wikipedia.org/wiki/Cd_%28command%29" rel="noreferrer"><code>cd</code></a> into it:</p> <pre><code>$ git clone git://example.com/myproject $ cd myproject </code></pre> <p>Next, lo...
<p>First, clone a remote <a href="http://en.wikipedia.org/wiki/Git_%28software%29" rel="noreferrer">Git</a> repository and <a href="http://en.wikipedia.org/wiki/Cd_%28command%29" rel="noreferrer"><code>cd</code></a> into it:</p> <pre><code>$ git clone git://example.com/myproject $ cd myproject </code></pre> <p>Next, lo...
119, 31678, 34099, 76220
git, git-branch, git-clone, remote-branch
<h1>How do I clone all remote branches?</h1> <p>My <code>master</code> and <code>development</code> branches are tracked remotely on <a href="http://en.wikipedia.org/wiki/GitHub" rel="noreferrer">GitHub</a>. How do I clone both these branches?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,735
git
# How do I clone all remote branches? My `master` and `development` branches are tracked remotely on [GitHub](http://en.wikipedia.org/wiki/GitHub). How do I clone both these branches?
First, clone a remote [Git](http://en.wikipedia.org/wiki/Git_%28software%29) repository and [`cd`](http://en.wikipedia.org/wiki/Cd_%28command%29) into it: ``` $ git clone git://example.com/myproject $ cd myproject ``` Next, look at the local branches in your repository: ``` $ git branch * master ``` But there are o...
1085162
Commit only part of a file's changes in Git
3,705
2009-07-06 02:25:02
<p>When I make changes to a file in Git, how can I commit only some of the changes?</p> <p>For example, how could I commit only 15 lines out of 30 lines that have been changed in a file?</p>
726,383
76,509
2024-03-05 22:47:00
1,085,191
5,097
2009-07-06 02:36:42
120,146
2022-06-17 17:14:12
https://stackoverflow.com/q/1085162
https://stackoverflow.com/a/1085191
<p>You can use:</p> <pre class="lang-bash prettyprint-override"><code>git add --patch &lt;filename&gt; </code></pre> <p>or for short:</p> <pre class="lang-bash prettyprint-override"><code>git add -p &lt;filename&gt; </code></pre> <p>Git will break down your file into what it thinks are sensible &quot;hunks&quot; (porti...
<p>You can use:</p> <pre class="lang-bash prettyprint-override"><code>git add --patch &lt;filename&gt; </code></pre> <p>or for short:</p> <pre class="lang-bash prettyprint-override"><code>git add -p &lt;filename&gt; </code></pre> <p>Git will break down your file into what it thinks are sensible &quot;hunks&quot; (porti...
119, 53850
git, git-commit
<h1>Commit only part of a file's changes in Git</h1> <p>When I make changes to a file in Git, how can I commit only some of the changes?</p> <p>For example, how could I commit only 15 lines out of 30 lines that have been changed in a file?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,736
git
# Commit only part of a file's changes in Git When I make changes to a file in Git, how can I commit only some of the changes? For example, how could I commit only 15 lines out of 30 lines that have been changed in a file?
You can use: ``` git add --patch <filename> ``` or for short: ``` git add -p <filename> ``` Git will break down your file into what it thinks are sensible "hunks" (portions of the file). It will then prompt you with this question: ``` Stage this hunk [y,n,q,a,d,/,j,J,g,s,e,?]? ``` Here is a description of each op...
52522565
Git is not working after macOS update ("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools")
3,513
2018-09-26 16:43:18
<p>I updated to the latest OS, and/or restarted my computer (this happens on every major update, but this time all I did was restart my computer on 2022-09-13).</p> <p>This morning I navigated to my work's codebase in the command line on my <a href="https://en.wikipedia.org/wiki/MacBook_Pro" rel="noreferrer">MacBook Pr...
1,507,400
8,221,725
2026-01-05 19:17:15
52,522,566
5,072
2018-09-26 16:43:18
8,221,725
2023-10-03 14:34:27
https://stackoverflow.com/q/52522565
https://stackoverflow.com/a/52522566
<p>The problem is that Xcode Command-line Tools needs to be updated due to a MacOs update.</p> <ul> <li>Did not run into this on Sonoma. <ul> <li>Maybe Apple fixed the process?</li> </ul> </li> <li>Updated for Ventura</li> </ul> <p>After opening the terminal after restarting, I tried to go to my code, and do a <code>gi...
<p>The problem is that Xcode Command-line Tools needs to be updated due to a MacOs update.</p> <ul> <li>Did not run into this on Sonoma. <ul> <li>Maybe Apple fixed the process?</li> </ul> </li> <li>Updated for Ventura</li> </ul> <p>After opening the terminal after restarting, I tried to go to my code, and do a <code>gi...
119, 369, 391, 908, 1231
command-line, git, macos, terminal, xcode
<h1>Git is not working after macOS update ("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools")</h1> <p>I updated to the latest OS, and/or restarted my computer (this happens on every major update, but this time all I did was restart my computer on 2022-09-13).</p> <p>This morning I navig...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,737
git
# Git is not working after macOS update ("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools") I updated to the latest OS, and/or restarted my computer (this happens on every major update, but this time all I did was restart my computer on 2022-09-13). This morning I navigated to my work...
The problem is that Xcode Command-line Tools needs to be updated due to a MacOs update. - Did not run into this on Sonoma. - Maybe Apple fixed the process? - Updated for Ventura After opening the terminal after restarting, I tried to go to my code, and do a `git status`, and I got an error and prompt for command li...
520650
Make an existing Git branch track a remote branch?
4,119
2009-02-06 15:14:04
<p>I know how to make a new branch that tracks remote branches, but <strong>how do I make an existing branch track a remote branch?</strong></p> <p>I know I can just edit the <code>.git/config</code> file, but it seems there should be an easier way.</p>
1,950,315
825
2023-09-06 04:32:19
2,286,030
4,958
2010-02-18 03:06:52
95,706
2020-08-21 18:22:38
https://stackoverflow.com/q/520650
https://stackoverflow.com/a/2286030
<p>Given a branch <code>foo</code> and a remote <code>upstream</code>:</p> <p><strong>As of Git 1.8.0:</strong></p> <pre><code>git branch -u upstream/foo </code></pre> <p>Or, if local branch <code>foo</code> is not the current branch:</p> <pre><code>git branch -u upstream/foo foo </code></pre> <p>Or, if you like to typ...
<p>Given a branch <code>foo</code> and a remote <code>upstream</code>:</p> <p><strong>As of Git 1.8.0:</strong></p> <pre><code>git branch -u upstream/foo </code></pre> <p>Or, if local branch <code>foo</code> is not the current branch:</p> <pre><code>git branch -u upstream/foo foo </code></pre> <p>Or, if you like to typ...
119, 1879, 76220
branch, git, git-branch
<h1>Make an existing Git branch track a remote branch?</h1> <p>I know how to make a new branch that tracks remote branches, but <strong>how do I make an existing branch track a remote branch?</strong></p> <p>I know I can just edit the <code>.git/config</code> file, but it seems there should be an easier way.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,738
git
# Make an existing Git branch track a remote branch? I know how to make a new branch that tracks remote branches, but **how do I make an existing branch track a remote branch?** I know I can just edit the `.git/config` file, but it seems there should be an easier way.
Given a branch `foo` and a remote `upstream`: **As of Git 1.8.0:** ``` git branch -u upstream/foo ``` Or, if local branch `foo` is not the current branch: ``` git branch -u upstream/foo foo ``` Or, if you like to type longer commands, these are equivalent to the above two: ``` git branch --set-upstream-to=upstrea...
424071
How do I list all the files in a commit?
3,687
2009-01-08 12:26:32
<p>How can I print a plain list of all files that were part of a given commit?</p> <p>Although the following lists the files, it also includes unwanted diff information for each:</p> <pre><code>git show a303aa90779efdd2f6b9d90693e2cbbbe4613c1d </code></pre>
2,426,121
11,123
2024-08-08 06:36:35
424,142
4,953
2009-01-08 13:02:22
8,985
2023-02-03 10:33:16
https://stackoverflow.com/q/424071
https://stackoverflow.com/a/424142
<p><strong>Preferred Way</strong> (because it's a <em>plumbing</em> command; meant to be programmatic):</p> <pre><code>$ git diff-tree --no-commit-id --name-only bd61ad98 -r index.html javascript/application.js javascript/ie6.js </code></pre> <p><strong>Another Way</strong> (less preferred for scripts, because it's a <...
<p><strong>Preferred Way</strong> (because it's a <em>plumbing</em> command; meant to be programmatic):</p> <pre><code>$ git diff-tree --no-commit-id --name-only bd61ad98 -r index.html javascript/application.js javascript/ie6.js </code></pre> <p><strong>Another Way</strong> (less preferred for scripts, because it's a <...
119, 74295
git, git-show
<h1>How do I list all the files in a commit?</h1> <p>How can I print a plain list of all files that were part of a given commit?</p> <p>Although the following lists the files, it also includes unwanted diff information for each:</p> <pre><code>git show a303aa90779efdd2f6b9d90693e2cbbbe4613c1d </code></pre>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,739
git
# How do I list all the files in a commit? How can I print a plain list of all files that were part of a given commit? Although the following lists the files, it also includes unwanted diff information for each: ``` git show a303aa90779efdd2f6b9d90693e2cbbbe4613c1d ```
**Preferred Way** (because it's a *plumbing* command; meant to be programmatic): ``` $ git diff-tree --no-commit-id --name-only bd61ad98 -r index.html javascript/application.js javascript/ie6.js ``` **Another Way** (less preferred for scripts, because it's a *porcelain* command; meant to be user-facing) ``` $ git sh...
572549
Difference between "git add -A" and "git add ."
3,494
2009-02-21 06:51:06
<p>What is the difference between <a href="https://git-scm.com/docs/git-add#Documentation/git-add.txt--A" rel="noreferrer"><code>git add [--all | -A]</code></a> and <a href="https://git-scm.com/docs/git-add" rel="noreferrer"><code>git add .</code></a>?</p>
2,209,611
64,313
2025-03-13 15:13:49
572,660
4,919
2009-02-21 09:00:04
19,563
2021-02-20 19:57:41
https://stackoverflow.com/q/572549
https://stackoverflow.com/a/572660
<p><em>This answer only applies to <strong>Git version 1.x</strong>. For Git version 2.x, see other answers.</em></p> <hr /> <p><strong>Summary:</strong></p> <ul> <li><p><code>git add -A</code> stages <strong>all changes</strong></p> </li> <li><p><code>git add .</code> stages new files and modifications, <strong>withou...
<p><em>This answer only applies to <strong>Git version 1.x</strong>. For Git version 2.x, see other answers.</em></p> <hr /> <p><strong>Summary:</strong></p> <ul> <li><p><code>git add -A</code> stages <strong>all changes</strong></p> </li> <li><p><code>git add .</code> stages new files and modifications, <strong>withou...
119, 34792
git, git-add
<h1>Difference between "git add -A" and "git add ."</h1> <p>What is the difference between <a href="https://git-scm.com/docs/git-add#Documentation/git-add.txt--A" rel="noreferrer"><code>git add [--all | -A]</code></a> and <a href="https://git-scm.com/docs/git-add" rel="noreferrer"><code>git add .</code></a>?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,740
git
# Difference between "git add -A" and "git add ." What is the difference between [`git add [--all | -A]`](https://git-scm.com/docs/git-add#Documentation/git-add.txt--A) and [`git add .`](https://git-scm.com/docs/git-add)?
*This answer only applies to **Git version 1.x**. For Git version 2.x, see other answers.* --- **Summary:** - `git add -A` stages **all changes** - `git add .` stages new files and modifications, **without deletions** (on the current directory and its subdirectories). - `git add -u` stages modifications and deletion...
1580596
How do I make Git ignore file mode (chmod) changes?
2,957
2009-10-16 21:43:38
<p>I have a project in which I have to change the mode of files with <code>chmod</code> to 777 while developing, but which should not change in the main repo. </p> <p>Git picks up on <code>chmod -R 777 .</code> and marks all files as changed. Is there a way to make Git ignore mode changes that have been made to files?...
1,611,478
149,389
2025-07-04 16:14:57
1,580,644
4,909
2009-10-16 21:53:40
893
2025-07-04 15:04:56
https://stackoverflow.com/q/1580596
https://stackoverflow.com/a/1580644
<p>Try:</p> <pre class="lang-none prettyprint-override"><code>git config core.fileMode false </code></pre> <p>From <a href="https://www.kernel.org/pub/software/scm/git/docs/git-config.html" rel="noreferrer">git-config(1)</a>:</p> <blockquote> <pre class="lang-none prettyprint-override"><code>core.fileMode Tells Git...
<p>Try:</p> <pre class="lang-none prettyprint-override"><code>git config core.fileMode false </code></pre> <p>From <a href="https://www.kernel.org/pub/software/scm/git/docs/git-config.html" rel="noreferrer">git-config(1)</a>:</p> <blockquote> <pre class="lang-none prettyprint-override"><code>core.fileMode Tells Git...
119, 4333, 12380
chmod, git, ignore
<h1>How do I make Git ignore file mode (chmod) changes?</h1> <p>I have a project in which I have to change the mode of files with <code>chmod</code> to 777 while developing, but which should not change in the main repo. </p> <p>Git picks up on <code>chmod -R 777 .</code> and marks all files as changed. Is there a way ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,741
git
# How do I make Git ignore file mode (chmod) changes? I have a project in which I have to change the mode of files with `chmod` to 777 while developing, but which should not change in the main repo. Git picks up on `chmod -R 777 .` and marks all files as changed. Is there a way to make Git ignore mode changes that ha...
Try: ``` git config core.fileMode false ``` From [git-config(1)](https://www.kernel.org/pub/software/scm/git/docs/git-config.html): > ``` > core.fileMode > Tells Git if the executable bit of files in the working tree > is to be honored. > > Some filesystems lose the executable bit when a file that is > ...
1139762
Ignore files that have already been committed to a Git repository
2,888
2009-07-16 19:26:35
<p>I have an already initialized Git repository that I added a <code>.gitignore</code> file to. How can I refresh the file index so the files I want ignored get ignored?</p>
997,778
134,482
2024-08-28 20:37:42
1,139,797
4,817
2009-07-16 19:32:50
134,482
2024-08-28 20:37:42
https://stackoverflow.com/q/1139762
https://stackoverflow.com/a/1139797
<p>To untrack a <em>single</em> file that has already been added/initialized to your repository, <em>i.e.</em>, stop tracking the file but not delete it from your system use: <code>git rm --cached filename</code></p> <p>To untrack <em>every</em> file that is now in your <code>.gitignore</code>:</p> <p><strong>First com...
<p>To untrack a <em>single</em> file that has already been added/initialized to your repository, <em>i.e.</em>, stop tracking the file but not delete it from your system use: <code>git rm --cached filename</code></p> <p>To untrack <em>every</em> file that is now in your <code>.gitignore</code>:</p> <p><strong>First com...
119, 456, 1763, 25056, 112901
caching, git, gitignore, git-rm, version-control
<h1>Ignore files that have already been committed to a Git repository</h1> <p>I have an already initialized Git repository that I added a <code>.gitignore</code> file to. How can I refresh the file index so the files I want ignored get ignored?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,742
git
# Ignore files that have already been committed to a Git repository I have an already initialized Git repository that I added a `.gitignore` file to. How can I refresh the file index so the files I want ignored get ignored?
To untrack a *single* file that has already been added/initialized to your repository, *i.e.*, stop tracking the file but not delete it from your system use: `git rm --cached filename` To untrack *every* file that is now in your `.gitignore`: **First commit any outstanding code changes**, and then, run this command: ...
2596805
How do I make git use the editor of my choice for editing commit messages?
3,497
2010-04-08 00:28:46
<p>How do I globally configure git to use a particular editor (e.g. <code>vim</code>) for commit messages?</p>
1,642,234
6,340
2024-10-09 13:23:48
2,596,835
4,759
2010-04-08 00:34:28
129,190
2022-07-11 06:33:07
https://stackoverflow.com/q/2596805
https://stackoverflow.com/a/2596835
<h4>Setting the default editor for Git</h4> <p>Pick one:</p> <ul> <li><p>Set <a href="http://git-scm.com/book/en/Customizing-Git-Git-Configuration#Basic-Client-Configuration" rel="noreferrer"><code>core.editor</code></a> in your Git config:</p> <pre><code>git config --global core.editor &quot;vim&quot; </code></pre> </...
<h4>Setting the default editor for Git</h4> <p>Pick one:</p> <ul> <li><p>Set <a href="http://git-scm.com/book/en/Customizing-Git-Git-Configuration#Basic-Client-Configuration" rel="noreferrer"><code>core.editor</code></a> in your Git config:</p> <pre><code>git config --global core.editor &quot;vim&quot; </code></pre> </...
119, 370, 371, 3809, 5025
commit-message, editor, emacs, git, vim
<h1>How do I make git use the editor of my choice for editing commit messages?</h1> <p>How do I globally configure git to use a particular editor (e.g. <code>vim</code>) for commit messages?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,743
git
# How do I make git use the editor of my choice for editing commit messages? How do I globally configure git to use a particular editor (e.g. `vim`) for commit messages?
#### Setting the default editor for Git Pick one: - Set [`core.editor`](http://git-scm.com/book/en/Customizing-Git-Git-Configuration#Basic-Client-Configuration) in your Git config: ``` git config --global core.editor "vim" ``` - Set the [`GIT_EDITOR`](http://git-scm.com/docs/git-var#_variables) environment var...
1146973
How do I revert all local changes in Git managed project to previous state?
2,758
2009-07-18 07:52:29
<p>I ran <code>git status</code> which told me everything was up to date and there were no local changes.</p> <p>Then I made several consecutive changes and realized I wanted to throw everything away and get back to my original state. Will this command do it for me?</p> <pre><code>git reset --hard HEAD </code></pre>
3,193,251
27,328
2025-08-31 06:33:04
1,146,981
4,742
2009-07-18 07:57:46
3,146
2022-07-17 00:43:33
https://stackoverflow.com/q/1146973
https://stackoverflow.com/a/1146981
<p>To revert changes made to your working copy, do this:</p> <pre><code>git checkout . </code></pre> <p>Or equivalently, for git version &gt;= 2.23:</p> <pre><code>git restore . </code></pre> <p>To revert changes made to the index (i.e., that you have added), do this. <strong>Warning this will reset all of your unpushe...
<p>To revert changes made to your working copy, do this:</p> <pre><code>git checkout . </code></pre> <p>Or equivalently, for git version &gt;= 2.23:</p> <pre><code>git restore . </code></pre> <p>To revert changes made to the index (i.e., that you have added), do this. <strong>Warning this will reset all of your unpushe...
119, 12309, 37230
git, git-checkout, revert
<h1>How do I revert all local changes in Git managed project to previous state?</h1> <p>I ran <code>git status</code> which told me everything was up to date and there were no local changes.</p> <p>Then I made several consecutive changes and realized I wanted to throw everything away and get back to my original state. ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
13,744
git
# How do I revert all local changes in Git managed project to previous state? I ran `git status` which told me everything was up to date and there were no local changes. Then I made several consecutive changes and realized I wanted to throw everything away and get back to my original state. Will this command do it fo...
To revert changes made to your working copy, do this: ``` git checkout . ``` Or equivalently, for git version >= 2.23: ``` git restore . ``` To revert changes made to the index (i.e., that you have added), do this. **Warning this will reset all of your unpushed commits to master!**: ``` git reset ``` To revert a ...