git-stash

Why can't stash be applied to the working directory?

纵饮孤独 提交于 2019-11-27 05:17:44
问题 I cannot apply stash back to the working directory. Little story: First I tried to push some committed changes, but it said: "no you can't, pull first"... OK then, I'll pull things from GitHub and then push my changes. When I tried to pull, it said that I had changes that would be overwritten, and that I should stash my changes. OK, I stashed the changes... did the pull, and push the committed changes. But now, I cannot restore the uncommitted changes I was working on. This is the error:

Stash changes to specific files

五迷三道 提交于 2019-11-27 04:03:26
问题 I have a large git project that I, stupidly, imported to eclipse and ran an autoformat on. Now, every file in the project is showing as modified. Rather than commit my formatted files, I would rather revert all the files that I have only been formatted and not had other changes. For instance: $ git status # On branch master # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) #

Git: Create a branch from unstaged/uncommitted changes on master

时光毁灭记忆、已成空白 提交于 2019-11-27 02:19:56
Context: I'm working on master adding a simple feature. After a few minutes I realize it was not so simple and it should have been better to work into a new branch. This always happens to me and I have no idea how to switch to another branch and take all these uncommited changes with me leaving the master branch clean. I supposed git stash && git stash branch new_branch would simply accomplish that but this is what I get: ~/test $ git status # On branch master nothing to commit (working directory clean) ~/test $ echo "hello!" > testing ~/test $ git status # On branch master # Changed but not

Is it possible to get commit logs/messages of a remote git repo without git clone

与世无争的帅哥 提交于 2019-11-27 01:55:52
Is it possible to get commit logs/messages of a remote git repo without git clone? The git repo I am working with is huge, even if I run git clone with --depth=1 still takes sometime before I am able to clone it. I am looking for something like this, git remote-log . I have also looked in to git -ls-remote, which only provides the SHA and the Heads/tags. I am interested in getting the last 2 commit title, commit user and commit SHA? Anyone know how to do that? Noob If you are looking to see the last few commits of a branch, try: git clone -b [branch name] --single-branch [repo url] --depth=3

git stash is slow on windows

寵の児 提交于 2019-11-27 00:26:57
问题 On my windows machine git stash has about 3.5 seconds overhead on each invocation, which adds about 7 seconds to my git commit hook. The same command under linux (same machine) takes about 0.01 seconds. The performance issue applies to empty repositories as well. I have tried the following from this thread and this thread: core.fscache is set to true core.preloadindex is set to true gc.auto is set to 256 Setting PS1='$ ' Running cmd in administration mode Running inside cmd.exe instead of git

git stash apply version

喜夏-厌秋 提交于 2019-11-26 23:44:52
问题 I have 2 branches: master | design Working in design I did a stash and switched to master, made some adjustments. Switched back to design and did a stash apply only to lose all my changes in the design branch. I am hoping all my work is within a stash as I have not cleared or removed these. If I do a stash list I get 4 results: stash@{0}: WIP on design: f2c0c72... Adjust Password Recover Email stash@{1}: WIP on design: f2c0c72... Adjust Password Recover Email stash@{2}: WIP on design: eb65635

How can I rename a git stash?

夙愿已清 提交于 2019-11-26 22:29:15
问题 I have a stash with an incorrect name. I would like to fix the name so it's accurate. How can I rename a stash? 回答1: Let's assume your stash list looks like this: $ git stash list stash@{0}: WIP on master: Add some very important feature stash@{1}: WIP on master: Fix some silly bug First, you must remove stash entry which you want to rename: $ git stash drop stash@{1} Dropped stash@{1} (af8fdeee49a03d1b4609f294635e7f0d622e03db) Now just add it again with new message using sha of commit

How many / how long are stashes saved by git?

╄→гoц情女王★ 提交于 2019-11-26 20:13:10
问题 I'm very new to git and have some question about stashing. If I've worked on a branch but was not able to get to a position where I can commit the branch, stashing is the right thing to use. My questions regarding stashing are: How many stashes are saved? How long are these stashes saved? Do they just temporarily save the work such that the changes are lost when you reboot your computer? If someone could quickly help clarifying these would be really appreciated. 回答1: 1 - How many stashes are

Why does git stash pop say that it could not restore untracked files from stash entry?

浪尽此生 提交于 2019-11-26 19:56:36
问题 I had a bunch of staged and unstaged changes and I wanted to quickly switch to another branch and then switch back. So I staged my changes using: $ git stash push -a (In hindsight I probably could have used --include-untracked instead of --all ) Then when I went to pop the stash I get a whole lot of errors along the lines of: $ git stash pop foo.txt already exists, no checkout bar.txt already exists, no checkout ... Could not restore untracked files from stash entry There doesn't seem to be

What's the difference between git stash save and git stash push?

故事扮演 提交于 2019-11-26 19:41:02
问题 When should I use git stash save instead of git stash push and vice-versa? 回答1: git stash save accepts a single non-option argument — the stash message. git stash push accepts the message with option -m and accepts a list of files to stash as arguments. 回答2: Just to be clear, starting Git 2.15/2.16 (Q1 2018), git stash save has been deprecated in favour of git stash push (though git stash save is still available for the time being). See commit c0c0c82, commit fd2ebf1, commit db37745 (22 Oct