# the standard hotfix from production scenario not working for me in git...

6 messages from 2011-07-28 to 2011-07-28. Participants: deanhiller, Luke Diamand, Andreas Schwab.
Thread: https://gitlist.dev/t/27947

## deanhiller, 2011-07-28 17:35

Subject: the standard hotfix from production scenario not working for me in git...
Message-ID: <1311874508381-6630648.post@n2.nabble.com>
URL: https://gitlist.dev/e/1311874508381-6630648.post%40n2.nabble.com

```
I am doing the typical scenario and have tried much of the documentation but
must be getting something wrong.  I want to do something exactly like
this...

context: I am on branchBigFeature and a production hot fix comes in.  I
would like to
1. git stash --ALL_including_untracked_Files
2. git checkout master
3. git checkout -b newHotfix145
4. work on hotfix, fix it
5. git addANDrm * (is there a way to do this??????)  I don't want to have to
git rm each file to remove!!! or can I do git rm * ....does that work or
will that delete everything....ugh.  Better yet, is there a way to git
commit --skipStaging --includeUntrackedFiles --autoDeleteTheDeletions,
ie...basically any change in the view I want applied(unless files are in
.gitignore of course)
5. git checkout master
6. git merge newHotfix145
7. git push
8. git checkout branchBigFeature
9. git stash pop
and I am back to seeing all my untracked files.

I tried to do this with commit INSTEAD of stash like so but it failed
miserably.  I basically tried commit instead of stash and then to get the
files back to untracked, unversioned on the branchBigFeature, I used git
revert HEAD and this reverted everything but then it was all in the staging
area...maybe there is one more command I need to get it from the staging
area.

and one last question, I 90% of the time want to apply all unstaged files
deletes, adds, modifies...is there just one command I can use like git
commit * --skipstaging or something.  I have been burned too many times by
the build works with ALL the changes and then missing a checkin so I prefer
to check it all in every time and stay in that habit.

thanks,
Dean



--
View this message in context: http://git.661346.n2.nabble.com/the-standard-hotfix-from-production-scenario-not-working-for-me-in-git-tp6630648p6630648.html
Sent from the git mailing list archive at Nabble.com.

```

## Luke Diamand, 2011-07-28 19:14

Subject: Re: the standard hotfix from production scenario not working for me in git...
Message-ID: <4E31B51D.2080208@diamand.org>
URL: https://gitlist.dev/e/4E31B51D.2080208%40diamand.org
In-Reply-To: <1311874508381-6630648.post@n2.nabble.com>

```
On 28/07/11 18:35, deanhiller wrote:
> I am doing the typical scenario and have tried much of the documentation but
> must be getting something wrong.  I want to do something exactly like
> this...
>
> context: I am on branchBigFeature and a production hot fix comes in.  I
> would like to

0. Would it help to use 'git status' to make sure that you don't have 
untracked flies kicking around?

> 1. git stash --ALL_including_untracked_Files
> 2. git checkout master
> 3. git checkout -b newHotfix145

Can you just do 'git checkout -b newHitfix145 master' ?

> 4. work on hotfix, fix it
> 5. git addANDrm * (is there a way to do this??????)  I don't want to have to
> git rm each file to remove!!! or can I do git rm * ....does that work or
> will that delete everything....ugh.  Better yet, is there a way to git
> commit --skipStaging --includeUntrackedFiles --autoDeleteTheDeletions,
> ie...basically any change in the view I want applied(unless files are in
> .gitignore of course)
> 5. git checkout master
> 6. git merge newHotfix145
> 7. git push
> 8. git checkout branchBigFeature
> 9. git stash pop
> and I am back to seeing all my untracked files.
>
> I tried to do this with commit INSTEAD of stash like so but it failed
> miserably.  I basically tried commit instead of stash and then to get the
> files back to untracked, unversioned on the branchBigFeature, I used git
> revert HEAD and this reverted everything but then it was all in the staging
> area...maybe there is one more command I need to get it from the staging
> area.

Personally I would try to avoid having untracked files around, but maybe 
that's just me.
>
> and one last question, I 90% of the time want to apply all unstaged files
> deletes, adds, modifies...is there just one command I can use like git
> commit * --skipstaging or something.  I have been burned too many times by
> the build works with ALL the changes and then missing a checkin so I prefer
> to check it all in every time and stay in that habit.

I usually find I only have a few untracked files at any given time 
(after all, how fast can most people create new code?) so just keeping 
them tracked isn't a problem. Then 'git commit -a' will do the right 
thing won't it?

Luke

```

## deanhiller, 2011-07-28 19:25

Subject: Re: the standard hotfix from production scenario not working for me in git...
Message-ID: <1311881145388-6631009.post@n2.nabble.com>
URL: https://gitlist.dev/e/1311881145388-6631009.post%40n2.nabble.com
In-Reply-To: <4E31B51D.2080208@diamand.org>

```
/Can you just do 'git checkout -b newHitfix145 master' ?/

Coooooool, one less step!!!!! I think I remember reading that at somepoint,
but forgot about it.

/0. Would it help to use 'git status' to make sure that you don't have 
untracked flies kicking around?/

Not really, I know that I have untracked files lying around(and frequently
do git status currently anyways)

/Personally I would try to avoid having untracked files around, but maybe 
that's just me.  I usually find I only have a few untracked files at any
given time 
(after all, how fast can most people create new code?) so just keeping 
them tracked isn't a problem. Then 'git commit -a' will do the right 
thing won't it?/

On a prototype project, the rate of file creation is pretty high so I
frequently have untracked files....and I 99% of the time never have an
untracked file that I won't be checking in eventually(excluding the
.gitignore files of course), so having to do a specific step with them is
quite annoying.

Also, having to rm each file is "very" annoying...anyway to just do a git
commit ALL(which includes untracked files(except for .gitignore specified
ones), deleted files, modified files...I think that is the whole list).  

If I could do a git commit ALL, and then when I get back to that branch,
maybe there is a way to do a git reset HEAD BUT restore the committed files
to the filesystem as untracked/unstaged, etc. etc????

Today, I just copied the whole repository since I was having so much trouble
so then it is easier to do what I want, but the fact that I have to do that
feels like I am back in svn again where I did that as well so I would just
switch between directories when working on a hotfix...feels like there
should be a way in git as I thought git was avoiding that situation.

thanks,
Dean

Luke
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
View this message in context: http://git.661346.n2.nabble.com/the-standard-hotfix-from-production-scenario-not-working-for-me-in-git-tp6630648p6631009.html
Sent from the git mailing list archive at Nabble.com.

```

## Andreas Schwab, 2011-07-28 19:31

Subject: Re: the standard hotfix from production scenario not working for me in git...
Message-ID: <m2fwlqi4n2.fsf@igel.home>
URL: https://gitlist.dev/e/m2fwlqi4n2.fsf%40igel.home
In-Reply-To: <1311874508381-6630648.post@n2.nabble.com>

```
deanhiller <dhiller@ghx.com> writes:

> 5. git addANDrm * (is there a way to do this??????)

$ git add -A .

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

```

## deanhiller, 2011-07-28 20:20

Subject: Re: the standard hotfix from production scenario not working for me in git...
Message-ID: <1311884415976-6631220.post@n2.nabble.com>
URL: https://gitlist.dev/e/1311884415976-6631220.post%40n2.nabble.com
In-Reply-To: <m2fwlqi4n2.fsf@igel.home>

```
THANKYOU.... THAT ROCKS!!! adds deleted files to staging and everything!!!!!

Then the question is after I commit the staging, how can I roll it back so
everything that was in staging before the commit is that way on the
filesystem.

--
View this message in context: http://git.661346.n2.nabble.com/the-standard-hotfix-from-production-scenario-not-working-for-me-in-git-tp6630648p6631220.html
Sent from the git mailing list archive at Nabble.com.

```

## deanhiller, 2011-07-28 20:28

Subject: Re: the standard hotfix from production scenario not working for me in git...
Message-ID: <1311884899204-6631245.post@n2.nabble.com>
URL: https://gitlist.dev/e/1311884899204-6631245.post%40n2.nabble.com
In-Reply-To: <1311884415976-6631220.post@n2.nabble.com>

```
SwEEEET, so I tested this with the git stash save and it works
phenomenal....EXACTLY what I wanted!!!!

thankyou, thankyou!!!

then just a git stash pop when I get back to the branch.

--
View this message in context: http://git.661346.n2.nabble.com/the-standard-hotfix-from-production-scenario-not-working-for-me-in-git-tp6630648p6631245.html
Sent from the git mailing list archive at Nabble.com.

```
