Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is git stash stack pushed to the remote repo?

Tags:

git

git-stash

Is my stash stack pushed to the remote repo? Or is it completely ignored?

I'm just curious if I should tend to it every once in a while to drop some of it to save space on the server.

like image 446
Dunno Avatar asked May 30 '14 10:05

Dunno


People also ask

Does git stash get pushed to remote?

Git stash saves the uncommitted changes locally, allowing you to make changes, switch branches, and perform other Git operations. You can then reapply the stashed changes when you need them. A stash is locally scoped and is not pushed to the remote by git push .

Is git stash local or remote?

Note that the stash is local to your Git repository; stashes are not transferred to the server when you push.

What happens when I git stash?

The answer to this issue is the git stash command. Stashing takes the dirty state of your working directory — that is, your modified tracked files and staged changes — and saves it on a stack of unfinished changes that you can reapply at any time (even on a different branch).

Where is a git stash stored?

All are stored in . git/refs/stash . git stash saves stashes indefinitely, and all of them are listed by git stash list . Please note that dropping or clearing the stash will remove it from the stash list, but you might still have unpruned nodes with the right data lying around.


1 Answers

No. Stashes are local.

$ man git stash:

Use git stash when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away reverts the working directory to match the HEAD commit.

I wouldn't keep too many of them around locally though. You'll lose track of them over time and they'll become somewhat useless.

like image 166
bcmcfc Avatar answered Sep 19 '22 14:09

bcmcfc