문제

In Git, what does "deletion" of a branch mean?

Will it be gone from the repository? Or will it still be navigable to via git branch?

What I really want to do is mark a branch as "dead end", i.e., the branch is so far from master, that nobody should use it as a starting point, though there were some good ideas down that branch, so we'd like to keep it, for reference.

도움이 되었습니까?

해결책

You can delete the branch, but tag it first, so that it's history doesn't disappear. This way, the branch doesn't show up in the branch list, which should hopefully deter people from working on it, but the work won't be permanently erased (even after garbage collection is run). For instance, whenever I have a branch that has become irrelevant, but I'm not prepared to permanently delete it, I tag it as "archive/<branch-name>".

While on master or some other branch:

git tag archive/foo foo
git branch -D foo

This creates a tag named archive/foo from the foo branch before deleting foo. You can also add a message to the tag, that explains what is in the branch, why it existed, why it's now a dead end, etc.

git tag -m 'Foo is deprecated in favor of bar' archive/foo foo

The ability to record why a branch is being deprecated is perhaps an advantage of tagging versus moving branches to an alternate namespace.

If you ever need to resurrect a branch that has been archived this way, it's as simple as:

git branch foo archive/foo
git tag -d archive/foo       # Optional

Now the branch is back as though it was never deleted.

다른 팁

TaxonomyFieldControl 또는 TaxonomyWebTaggingControl을 살펴보아야합니다.이 목적을 위해 TaxonomyWebtaggingControl을 사용하고 있습니다.이 블로그를 봅니다.//blog.vgrem.com/2013/01/21/using-sharepoint-taxonomyWebTaggingControl-Control-specifying-parenterms/

git branch -D <branchName> will delete your branch from repository. You will not be able to see it or navigate anymore. Also you will lose all file changes made in that branch.

https://git-scm.com/docs/git-branch

내 조언은 지금 배경 작업 방법을 사용하기 시작하는 것입니다.당신이 할 수있는 모든 것은 배경에서 같은 코드를 실행하는 것입니다 ...당신은 5 분 안에 그것을 할 수 있어야합니다.이제 코드에 소비 할 수있는 다른 솔루션에 많은 시간을 보내는 것입니다.DelayedJob, BachGroudDRB 또는 다른 옵션을 사용하여 돌아 오지 않을 것입니다.
여기에 도움이 될 수있는 좋은 게시물이 있습니다. http : //www.tobinharris.com/past/2009/3/9/6-ways-to-run-background-jobs-in-rubyonRails/


Rails on Rails : 백그라운드에서 물건을 실행하는 방법?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top