{"thread":{"id":"19028","subject":"Is there a way to lock branches in GIT?","startedAt":"2009-04-23T21:43:00Z","lastAt":"2009-04-24T03:23:22Z","messageCount":2,"participants":["ask4thunder","Daniel Barkalow"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"112138","messageId":"23204641.post@talk.nabble.com","threadId":"19028","inReplyTo":null,"subject":"Is there a way to lock branches in GIT?","fromName":"ask4thunder","fromEmail":"ask4thunder@gmail.com","sentAt":"2009-04-23T21:43:00Z","receivedAt":"2009-04-23T21:43:00Z","isPatch":false,"sender":{"key":"ask4thunder@gmail.com","avatar":null},"body":"\nHi GIT Gurus,\n\n1. If there are 2 user are working and having their own clone and branches\n(not master, other branches). and there is another parent clone with a\nbranch (not master). Can these 2 users merge to the parent clone branch at\nthe same time? or only one user will be able to merge first and then the\nother. in other words, will the target branch be checkedout to that user\nalone and other user cant checkout that branch or use the checked out\nbranch. \n\n2. Is there a way to lock branches, so that if a user want to merge his\nchanges to a parent branch of another clone, it can be unlocked for him\nalone? Hope you can help me on this. \n\n\nThanks \nask4thunder\n\n\n-- \nView this message in context: http://www.nabble.com/Is-there-a-way-to-lock-branches-in-GIT--tp23204641p23204641.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"112152","messageId":"alpine.LNX.2.00.0904232300360.2147@iabervon.org","threadId":"19028","inReplyTo":"23204641.post@talk.nabble.com","subject":"Re: Is there a way to lock branches in GIT?","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-04-24T03:23:22Z","receivedAt":"2009-04-24T03:23:22Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Thu, 23 Apr 2009, ask4thunder wrote:\n\n> 1. If there are 2 user are working and having their own clone and branches\n> (not master, other branches). and there is another parent clone with a\n> branch (not master). Can these 2 users merge to the parent clone branch at\n> the same time? or only one user will be able to merge first and then the\n> other. in other words, will the target branch be checkedout to that user\n> alone and other user cant checkout that branch or use the checked out\n> branch. \n\nYou can't merge into a remote repository; you can only move the remote \nrepository forward. That is, when you \"push\" to the remote repository, you \nreplace what it currently there with a commit you supply that's based on \nthe commit that's there.\n\nTwo people can't both push to the same remote repository at the same time, \nbecause each of them will be sending something that the other hasn't based \ntheir commit on. Whoever's second will be refused, and will have to fetch \nthe other commit and make a merge commit, which is based on both the \ncommits. Git makes sure, in updating the remote repository, to do the \nnecessary locking to have one side or the other lose the race cleanly.\n\n> 2. Is there a way to lock branches, so that if a user want to merge his\n> changes to a parent branch of another clone, it can be unlocked for him\n> alone? Hope you can help me on this. \n\nNot with git program support. Of course, you can use Unix permissions to \nget exclusive write access to the branch and prevent another else from \nupdating it. And, of course, you can have a branch that's always your own \n(Linux kernel development works primarily by every developer having one or \nmany private branches, and it's rare for multiple people to have write \naccess to the same branch). But there turns out not to be much benefit to \nbranches that people can sometimes but not always write to, in a system \nwhere everybody has local branches they can always write to regardless of \nwhat other people do.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}