TFS 명령 shelve / unshelve에 해당하는 Git은 무엇입니까? 체리 픽?
TFS의 shelve / unshelve 명령은 매우 편리하고 사용하기 매우 간단하다는 것을 알았습니다. Git에서 동등한 것은 무엇입니까?
다음은 TFS의 시나리오입니다.
- 나는 트렁크를 변경했다
- I shelve : 변경 세트가 서버 (레이블 포함)에 저장되고 변경 전에 소스를 다시 가져옵니다.
- 나는 트렁크에서 일한다
- 누군가가 보류를 취소 할 수 있음 : 작업 공간에서 변경 세트 가져 오기
명령 호출 cherry-pick이 있다는 것을 알고 있지만 워크 플로우가 필요에 맞는지 잘 모르겠습니다.
설명하는 내용은 git stash
git 과 유사하지만 , git을 사용하면 자신의 저장소 (서버의 단일 저장소가 아닌)가 있기 때문에 해당 변경 세트를 다시 가져올 수 있습니다.
일반적인 아이디어는 다음과 같습니다.
# do some stuff
vim foo/bar.c
# stash away your changes
git stash
# do some other things...
# retrieve your changes
git stash pop
다른 사람이이 변경 세트에 액세스 할 수 있도록하려면 대신 작업 브랜치에 커밋하는 것이 좋습니다.
# make yourself a branch
git checkout -b temp-featureA
# commit to it
git add foo/bar.c; git commit
# now you push this branch (or they could just fetch straight from you)
git push origin temp-featureA
# Now, in someone else's repo:
# Fetch updates
git fetch origin
# Make a branch tracking the remote branch
git branch temp-featureA origin/temp-featureA
# Either check it out:
git checkout temp-featureA
# or cherry-pick it, to apply the changes somewhere else:
git cherry-pick temp-featureA
# or, if it's multiple commits, rebase it!
git rebase --onto my-branch start-of-featureA temp-featureA
당신이 원하는 것은 git에서 평범한 오래된 분기로 달성됩니다.
에서 멋진 StackOverflow의 응답 에 의해 JaredPar :
Shelving은 체크 인하 지 않고 박스의 모든 변경 사항을 저장하는 방법입니다. 변경 사항은 서버에 유지됩니다.
이것은 브랜치에 커밋하고 git의 서버로 푸시하는 것과 유사합니다.
방법 :
"마스터"브랜치에서 작업 중이고 기능 X를 구현하기로 결정했다고 가정 해 보겠습니다. 시작은 잘되었지만, 상사는 기능 Y가 가능한 한 빨리 구현되어야한다고 말합니다. 기능 Y를 수행하는 동안 기능 X를 완료하기 위해 자원 봉사자보다 다음 큐브에있는 Phil. 수행 할 작업은 다음과 같습니다.
새 분기를 만들고 전환합니다.
$ git checkout -b feature-x
Commit your changes:
$ git add filethatyouchanged.cc
$ git commit -m 'partial implementation of feature X'
Push it to a server that Phil can see:
$ git push origin feature-x
Go back to the master branch (which has not changed):
$ git checkout master
You might also want to proactively create a new branch for feature Y:
$ git checkout -b feature-y
Phil can now pull down your feature X work and pick up where you left off:
phil$ git fetch origin
phil$ git checkout -t origin/feature-x
git stash is a bit similar, except it is limited to your working tree.
In a DVCS, to achieve that kind of workflow, you need to:
- commit your current changes in a new branch
- checkout the original branch where you can go on, with none of the changes you had introduced (but committed in the new branch)
- push that new branch to a bare repo
- allow another developer to pull that new branch and merge it to his current branch.
Another way would be to let the other developer fetch your branch (where you have committed that special set of changes), and cherry-pick it, but that is not recommended, for cherry-picked commits are hard to track.
'IT TIP' 카테고리의 다른 글
개체 매개 변수로 Moq 확인 (0) | 2020.11.01 |
---|---|
전면 광고 AdMob 광고 : 'IllegalStateException : 전체 화면 활동 만 방향을 요청할 수 있습니다.' (0) | 2020.11.01 |
여기서 @plt는 무엇을 의미합니까? (0) | 2020.11.01 |
간접 확장이란 무엇입니까? (0) | 2020.11.01 |
Bash case 문에서 빈 문자열을 어떻게 테스트합니까? (0) | 2020.11.01 |