Re: [git-users] Re: git const branch
On Fri, Nov 27, 2009 at 1:58 PM, Konstantin Khomoutov wrote: > On Nov 27, 9:51 pm, Rick DeNatale wrote: > Some branches in git are tracking another branches (for example, usually master tracks origin/master). Let's assume, that in my work- flow i don't want accidentally commit in master, but i want master to track origin/master. I release that i can do this with hooks, but this solution seems to me complicated. Can i make some git branches const? > [...] >> I think that by definition a branch is a movable pointer to a commit, >> so a const branch is a bit of an oxymoron. >> >> The concept for a fixed pointer to a commit is called a tag. If I >> want to mark a point I might want to get back to, such as the commit >> corresponding to a current release, the I tag it and push the tag. > > Good point, but there's one exception: you can't fast forward a tag, > while this is often the sole reason for the existance of the master > branch > as a mirror of origin/master. > But then again, to fast forward a branch it must not be immutable ;-) You can't fast forward, or merge to, a tag because it is a constant pointer to a given commit. Which is what the OP seemed to be asking for. Q.E.D. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To post to this group, send email to git-us...@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.
Re: [git-users] Re: git const branch
On Fri, Nov 27, 2009 at 1:00 PM, Konstantin Khomoutov wrote: > On Nov 26, 11:23 am, itroot wrote: > >> Some branches in git are tracking another branches (for example, >> usually master tracks origin/master). Let's assume, that in my work- >> flow i don't want accidentally commit in master, but i want master to >> track origin/master. I release that i can do this with hooks, but this >> solution seems to me complicated. >> >> Can i make some git branches const? > > I think you can not, but until you have pushed the branch with wrongly > applied commits > you can easily revert these wrong changes using `git reset -- > hard ...`, > so the absence of immutable branches is not a big loss. > > On the other hand, Git already includes certain things which are there > mostly > for convenience, so why not. > In either case, you should suggest your idea on the official Git > mailing list, not here. I think that by definition a branch is a movable pointer to a commit, so a const branch is a bit of an oxymoron. The concept for a fixed pointer to a commit is called a tag. If I want to mark a point I might want to get back to, such as the commit corresponding to a current release, the I tag it and push the tag. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To post to this group, send email to git-us...@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.