저는 항상 인상을 줄 수 있는 '비밀창고 숨기기 이름 아래 수행여 스테이시나미 절약합니다 깃 (git)', '비밀창고' 수행여 적용하십시오 스테이시나미 적용하십시오 깃 (git) 에 있는 나중에 수 있습니다. 그러나 이 경우 발생하는 것으로 보인다 '는' 모든 것은 스테이시나미 사용될 비밀창고 설명.
실제로 비밀창고 이름을 무리라구 있나요? 그렇지 않으면 어떤 추천하시겠습니까 충족합니다 동등한 기능을? 내가 가지고 있는 작은 숨기기 위해 주기적으로 꼭 이래야겠어요 있지만 본질적으로 같은 적용하십시오 don& # 39 의 목록 '비밀창고' 싶지 않다, 그 숫자는 실제 숨기기 위해 항상 헌트 깃 (git).
This is how you do it.
git stash save "my_stash"
여기서 ',' 는 ", my_stash" 숨기기 이름.
좀 더 유용한 유의 사항: 모든 숨겨 놨다 스택할 저장된다. 유형:
git stash list
그러면 당신의 모든 다운되어도 나열하십시오 숨겨 놨다.
적용하십시오 비밀창고 및 분리하십시오 &solarisdvd 비밀창고 스택할 mm_mail_doc.:
git stash pop stash@{n}
이를 숨기기, 계속해서 적용하십시오 스택할 숨기기, 유형:
git stash apply stash@{n}
여기서 'n' 은 이 숨겨진 변했다니까 색인입니다
깃 (git) '가 아닌' 비밀창고 절약합니다 사용되지 않는 vmware. 2.15.x/2.16 깃 (git) ',' 비밀창고 누름식 - m " message" 사용할 수 있습니다.
이렇게 사용할 수 있습니다.
깃 (git) ',' 비밀창고 누름식 - m " message".
여기서 " message"; 이를 위해 이 노트를 비밀창고.
읽어들입니다 숨기기 위해 사용할 수 있습니다. 깃 (git) '' 비밀창고 목록. 이렇게 하면 이렇게 바뀌엇어요 출력입니다, 예를 들면 다음과 같습니다.
stash@{0}: On develop: perf-spike
stash@{1}: On develop: node v10
그럼 '이'} {인덱스화할 stash@ 확증하노라 적용하십시오 사용하여 간단히 '':
git stash apply stash@{1}
[1]: https://git-scm.com/docs/git-stash # Documentation/git-stash.txt-push-p-patch-k-no-keep-index-u-include-untracked-a-all-q-quiet-m-messageltmessagegt-ltpathspecgt82308203
git stash branch <branchname> [<stash>]
충스러웠으니 맨페이지를:
이로 인해 이름이 ',' 를 시작으로, 새 분기로의 아웃하려면 < branchname> 및 검사 시 사용되는 ',' 처음 만들어진 qic stash> 커밋합니다 <, 변경 사항을 기록한 ',' 새로운 작업 및 인덱스화할 < stash>, 이 경우, 그 후 ',' 진단트리는 떨어트림 < stash> 완료했습니다. ',' 는 없을 때 받은 최신 불신하니 qic stash> <.
깃 (git) 을 설치할 경우 유용합니다 분기로의 비밀창고 '저장' 비밀창고 실패할 정도로 변경되었습니까 실행했음 git 적용하십시오 충돌함. 이후 당시 머리 위에 있던 커밋합니다 비밀창고 적용되는 깃 (git) 은 당초 avamar 비밀창고 실행에서는, 숨겨진 스테이드 충돌하지 않고.
나중에 이 새로운 드라이버로의 리베이스 일부 다른 곳에서 that& # 39 의 하위 어느 때 조교하실 숨겨진.
그냥 가벼운 구할 방법을 찾는 경우 현재 작업 중인 일부 또는 전부를 복제본에 변경 후, 나중에 이를 임의로 고려해보십시오 재적용 패치 파일:
# save your working copy changes
git diff > some.patch
# re-apply it later
git apply some.patch
이따금 그리곤요 I wonder if I 사용해야 숨겨 놨다 엔드입니다 그리곤요 I see) 와 같은 것들을 하는 위와 I& # 39 m, m, 어떤 일을 통해 콘텐츠를 I& # 39:)
숨겨 놨다 제작되지 않은) 와 같은 것들을 운영까지도 영구적입니다 수 있다. 그나마 지난 you&; d # 39 에서 태그를 사용하여 커밋한 할 것 같습니다. Chunghwa the thing you want to 비밀창고. 커밋합니다 아웃해야 할 것이다. 증대하고자 하는 태그 만듭니다. 다음 네 헤드에게 롤백합니다 드라이버로의 '^'. 이제 재적용 비밀창고 '체리 선택 할 때 그 뻨을 타냐메 깃 (git) 을 사용할 수 있습니다' ('-n' 는 '증대하고자 없습니다.').
나는 내 '이 두 가지 기능을 리주하크' file:
function gitstash() {
git stash push -m "zsh_stash_name_$1"
}
function gitstashapply() {
git stash apply $(git stash list | grep "zsh_stash_name_$1" | cut -d: -f1)
}
이 방법을 사용하기.
gitstash nice
gitstashapply nice
깃 (git) = f () {비밀창고 '사파리 " 적용하십시오 \";! $ (git 비밀창고 목록.직렬 awk - f: - - $ \" posix 브퍼트 = \"; $1 $0 ~ 팻 {인쇄하십시오 \"; \" \" 종료하십시오};;; }; f". '
깃 (git) ',' " regex> < 사파리 ";;
Edit: 내가 잘 접착 선호하는 이유를 알 수 있지만, 대부분의 내가 내 원래 솔루션이므로 에타노 Reisner& # 39 의 버전 (위). 그럼 그냥 record: 대한
sapply = "!f() { git stash apply \"$(git stash list | grep -E \"$*\" | awk \"{ print $ 1; }\" | sed -n \"s/://;1p\")\"; }; f"
다음은 '검색' 비밀창고 목록을 찾을 수 있는 regex 가 드롭인 교체를 깃 (git) {}, 첫 번째 (최근) ',' 다음 '숨기기 위해 stash@ < n> < command> 전달하고, 깃 (git),':
<! - 모든 언어: > 랑 sh -;
# standalone (replace <stash_name> with your regex)
(n=$(git stash list --max-count=1 --grep=<stash_name> | cut -f1 -d":") ; if [[ -n "$n" ]] ; then git stash show "$n" ; else echo "Error: No stash matches" ; return 1 ; fi)
(n=$(git stash list --max-count=1 --grep=<stash_name> | cut -f1 -d":") ; if [[ -n "$n" ]] ; then git stash apply "$n" ; else echo "Error: No stash matches" ; return 1 ; fi)
<! - 언어: > 랑 없음 -;
# ~/.gitconfig
[alias]
sshow = "!f() { n=$(git stash list --max-count=1 --grep=$1 | cut -f1 -d":") ; if [[ -n "$n" ]] ; then git stash show "$n" ; else echo "Error: No stash matches $1" ; return 1 ; fi }; f"
sapply = "!f() { n=$(git stash list --max-count=1 --grep=$1 | cut -f1 -d":") ; if [[ -n "$n" ]] ; then git stash apply "$n" ; else echo "Error: No stash matches $1" ; return 1 ; fi }; f"
# usage:
$ git sshow my_stash
myfile.txt | 1 +
1 file changed, 1 insertion(+)
$ git sapply my_stash
On branch master
Your branch is up to date with 'origin/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)
modified: myfile.txt
no changes added to commit (use "git add" and/or "git commit -a")
참고로 이 명령을 사용할 수 있도록 적절한 나님이시거늘 결과 코드 내에서 다른 스크립트입니다. 사용하여 명령 실행 후 이를 확인할 수 있습니다.
echo $?
다만 신경을 가변으로 개확장) 은 내가 wasn& # 39, t = $1 '부분' 그렙 대한 합니다. 하지만, ',' 아마 그렙 = $1" " 합니다 수 있을지는 확신할 만한 간섭하지 않는 i& # 39 m, regex 구분 (i& # 39, m open 을 제안).
이 당선자의 클레멘 슬라비치 답이 없다. 난 이제 막 오토메이티드 하지만 난 아직 충분히 담당자별로 대해 불평했어요 수락됨 don& # 39, t: (
깃 (git) 에서 이를 사용할 수도 있습니다 찾기 위해 앨리어스가 추가하기에서는 비밀창고 ref 및 기타 표시, 드롭합니다 앨리어스를 적용하십시오, etc.
[alias]
sgrep = "!f() { ref=$(git --no-pager stash list | grep "$1" | cut -d: -f1 | head -n1); echo ${ref:-<no_match>}; }; f"
sshow = "!f() { git stash show $(git sgrep "$1") -p; }; f"
sapply = "!f() { git stash apply $(git sgrep "$1"); }; f"
sdrop = "!f() { git stash drop $(git sgrep "$1"); }; f"
참고로 이유에 대해 'ref = $ (. ); echo $ {}, '빈 문자열은 no_match> ref:-<, 패턴, 너무 스쇼 일으킬 수 있는 최신 비밀창고 사파리 및 스트로프 타겟으로의 돌아오지 않을 것이라고, 대신 한 것으로 보고 있다.
작은 bash 스크립트입니다 조회 수를 사용하여 비밀창고. Call it " gitapply";:
NAME="$1"
if [[ -z "$NAME" ]]; then echo "usage: gitapply [name]"; exit; fi
git stash apply $(git stash list | grep "$NAME" | cut -d: -f1)
사용법:
gitapply foo
foo) 는 문자열 자와히리 이름의 비밀창고 운영까지도.
sshow = !sh -c 'git stash show stash^{/$*} -p' -
sapply = !sh -c 'git stash apply stash^{/$*}' -
ssave = !sh -c 'git stash save "${1}"' -
사용법:
예: git 스쇼 미체레스타시
이 표준 입력으로부터 입력입니다 시행하십시오 하이픈입니다 끝에 밝혔습니다.
깃 (git) 을 사용하여 비밀창고 '이름' 절약합니다 저장하라는.
그럼. 이 스크립트입니다 적용할 (또는 pop) 를 사용할 수 있습니다.
#!/usr/bin/env ruby
#git-stash-pick by Dan Rosenstark
# can take a command, default is apply
command = ARGV[0]
command = "apply" if !command
ARGV.clear
stashes = []
stashNames = []
`git stash list`.split("\n").each_with_index { |line, index|
lineSplit = line.split(": ");
puts "#{index+1}. #{lineSplit[2]}"
stashes[index] = lineSplit[0]
stashNames[index] = lineSplit[2]
}
print "Choose Stash or ENTER to exit: "
input = gets.chomp
if input.to_i.to_s == input
realIndex = input.to_i - 1
puts "\n\nDoing #{command} to #{stashNames[realIndex]}\n\n"
puts `git stash #{command} #{stashes[realIndex]}`
end
I like 를 숨겨 놨다 이름을 볼 수 있다. 또한 내가 사용하는 스셸 및 솔직히 didn&, t know how to use 일부 Bash 앨리어스를 # 39 위;)
참고: 케빈 있다』 고 콩지름에 태그 및 벚꽃 추천 한다.
이는 사용하여 이를 달성할 수 있는 방법 중 하나는 PowerShell:
<#
.SYNOPSIS
Restores (applies) a previously saved stash based on full or partial stash name.
.DESCRIPTION
Restores (applies) a previously saved stash based on full or partial stash name and then optionally drops the stash. Can be used regardless of whether "git stash save" was done or just "git stash". If no stash matches a message is given. If multiple stashes match a message is given along with matching stash info.
.PARAMETER message
A full or partial stash message name (see right side output of "git stash list"). Can also be "@stash{N}" where N is 0 based stash index.
.PARAMETER drop
If -drop is specified, the matching stash is dropped after being applied.
.EXAMPLE
Restore-Stash "Readme change"
Apply-Stash MyStashName
Apply-Stash MyStashName -drop
Apply-Stash "stash@{0}"
#>
function Restore-Stash {
[CmdletBinding()]
[Alias("Apply-Stash")]
PARAM (
[Parameter(Mandatory=$true)] $message,
[switch]$drop
)
$stashId = $null
if ($message -match "stash@{") {
$stashId = $message
}
if (!$stashId) {
$matches = git stash list | Where-Object { $_ -match $message }
if (!$matches) {
Write-Warning "No stashes found with message matching '$message' - check git stash list"
return
}
if ($matches.Count -gt 1) {
Write-Warning "Found $($matches.Count) matches for '$message'. Refine message or pass 'stash{@N}' to this function or git stash apply"
return $matches
}
$parts = $matches -split ':'
$stashId = $parts[0]
}
git stash apply ''$stashId''
if ($drop) {
git stash drop ''$stashId''
}
}
[자세한 내용은 여기] [1]
[1]: https://geoffhudik.com/tech/2017/07/19/git-command-line-part-5/ " 더 here";
깃 (git) '도 아닌' 다른 '비밀창고 적용하십시오 수행됨 stash@ {0}' 참조. 일반 사용할 수 있도록 태그뿐 afaq 영구 이름. 이 역시 최대한 아치덴탈리 깃 (git) '또는' 팝 '비밀창고' 비밀창고 드롭합니다 깃 (git) 을 수 없는 것입니다.
'파스타시 앨리어스를 정의할 수 있도록' (lc-fc 영구 stash" ";) 다음과 같습니다.
git config --global alias.pstash '!f(){ git stash && git tag "$1" stash && git stash drop; }; f'
이제 비밀창고 태그가 만들 수 있습니다.
git pstash x-important-stuff
다시 '와' show '와' 적용하십시오 칭송되었다.
git stash show x-important-stuff
git stash apply x-important-stuff
모든 것을 숨기기 위해 외에 또 다른 솔루션을 도입해 제안하십시오 생성, I& # 39; d [펠릭스 제프] (https://github.com/junegunn/fzf/) 를 보급했다. 5 분, 귀중한 시간을 얻을 수 있으며, 이를 통해 소개된 추천합니까 만큼 뛰어난 생산성을 모든 부스터.
어쨌든, 관련 발췌문 그들위에 [참조용이므로 페이지] (https://github.com/junegunn/fzf/wiki/examples # 깃 (git) 오퍼링이 비밀창고 검색:. # 39 의 아주 쉽게 it& 시프트레트 변경하십시오 추가 기능 (비밀창고 같은 응용 프로그램 또는 드롭하기):
fstash() {
local out q k sha
while out=$(
git stash list --pretty="%C(yellow)%h %>(14)%Cgreen%cr %C(blue)%gs" |
fzf --ansi --no-sort --query="$q" --print-query \
--expect=ctrl-d,ctrl-b); do
mapfile -t out <<< "$out"
q="${out[0]}"
k="${out[1]}"
sha="${out[-1]}"
sha="${sha%% *}"
[[ -z "$sha" ]] && continue
if [[ "$k" == 'ctrl-d' ]]; then
git diff $sha
elif [[ "$k" == 'ctrl-b' ]]; then
git stash branch "stash-$sha" $sha
break;
else
git stash show -p $sha
fi
done
}