How to 'unstage' a file

791 views
Skip to first unread message

anler

unread,
Jul 27, 2010, 12:23:27 PM7/27/10
to Subversion SVN
Hi, I've just started to use svn some days ago and I have a little
question, if I change a file how do I prevent the commit of that file
when I commit the rest of my changes?

ian....@wandisco.com

unread,
Jul 27, 2010, 2:11:03 PM7/27/10
to Subversion SVN
Hi Anler,

Which Subversion client do you use?

From the command line, as far as I know, there isn't a way to exclude
one particular file from a commit. What you can do is specify all of
the files you do want to commit and therefore manually exclude the one
file you'd like to hold back. To do this, you just need to specify the
filenames after your log message eg 'svn ci -m "Commit Log Message"
file1 file2 file3' etc

Best Wishes,

Ian Wild
WANdisco, Inc.

Free Online Subversion Training
http://hub.wandisco.com/eTraining

Join the Open Source Subversion Community
http://hub.wandisco.com/eCommunity

Follow us on Twitter
http://hub.wandisco.com/eTwitter

Join us on facebook!
http://hub.wandisco.com/eFacebook



ian....@wandisco.com

unread,
Aug 4, 2010, 8:58:25 PM8/4/10
to Subversion SVN
I actually meant to add something to this thread, which I then forgot
to post... As I'd written it anyway though:

Also with Subversion, you can easily just:

> svn status --verbose <file>

There should be a 'M' at the beginning of the output to indicate that
the file has been modified in the working copy.

> rm <file>
> svn update <file>
> svn status --verbose <file>

should show that file as being no longer being modified and should
back to the latest.

> svn update -r <revision> <file>

can be used to update the file to a specific desired revision.

Regards,

Ian

On Jul 27, 11:11 am, "ian.w...@wandisco.com" <ian.w...@wandisco.com>
wrote:
> On Jul 27, 9:23 am, anler <anle...@gmail.com> wrote:
>
> > Hi, I've just started to use svn some days ago and I have a little
> > question, if I change a file how do I prevent the commit of that file
> > when I commit the rest of my changes?
>
> Hi Anler,
>
> Which Subversion client do you use?
>
> From the command line, as far as I know, there isn't a way to exclude
> one particular file from a commit. What you can do is specify all of
> the files you do want to commit and therefore manually exclude the one
> file you'd like to hold back. To do this, you just need to specify the
> filenames after your log message eg 'svn ci -m "Commit Log Message"
> file1 file2 file3' etc
>
> Best Wishes,
>
> Ian Wild
> WANdisco, Inc.
>
> Free Online Subversion Traininghttp://hub.wandisco.com/eTraining

anler

unread,
Aug 5, 2010, 3:45:17 AM8/5/10
to Subversion SVN
that would help, thanks!

On Aug 5, 2:58 am, "ian.w...@wandisco.com" <ian.w...@wandisco.com>
wrote:

Arturs Jansons

unread,
Oct 12, 2012, 12:20:29 PM10/12/12
to subvers...@googlegroups.com
The solution could be the one-line script, which will copy selected file into some .svn/unstage/ folder, saving it`s path and after that just replace this file with HEAD revision.

Janus Troelsen

unread,
Jan 11, 2013, 8:42:08 PM1/11/13
to subvers...@googlegroups.com
On Tuesday, July 27, 2010 8:11:03 PM UTC+2, ian....@wandisco.com wrote:
On Jul 27, 9:23 am, anler <anle...@gmail.com> wrote:
> Hi, I've just started to use svn some days ago and I have a little
> question, if I change a file how do I prevent the commit of that file
> when I commit the rest of my changes?

Hi Anler,

Which Subversion client do you use?

From the command line, as far as I know, there isn't a way to exclude
one particular file from a commit. What you can do is specify all of
the files you do want to commit and therefore manually exclude the one
file you'd like to hold back. To do this, you just need to specify the
filenames after your log message eg 'svn ci -m "Commit Log Message"
file1 file2 file3' etc
 
you can specify directories too 
Reply all
Reply to author
Forward
0 new messages