On Mar 15, 3:12 am, vfclists <[email protected]> wrote: > I have the master and a branch of my project checked out into > different directories. > > I want to make one of the branchesthe new master, which I think I can > achieve by copying the contents of the branch's working directory into > the master's, committing and pushing. > > Is there some way to do that by issuing a command directly from the > branch's working directory?
You seem to miss the most crucial points about Git's idea of managing branches. Reading or re-reading some book or tutorial on Git is highly recommended. In short: unlike Subversion and friends, Git's branches are no more than files placed in a special place in the Git repo which hold hashes of the commits representing tips of that branches. So what you want to achieve is just a matter of replacing the contents of one file representing a branch, which is routinely done by the `git branch` command. Basically, suppose you want to make the branch "wonderful" to be the new "master", then do this: $ git branch -m master junk $ git branch -m wonderful master Now, since you mentioned pushing, the problem is that your remote repo now has a different idea about what the master branch really is. To "fix" this you want to do "forced update" by using the "-f" command- line option: $ git push -f origin master And I feel oblidged to repeat: read or re-read a good book on Git. Otherwise you're on track to frustration. -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.
