![]() Less common options include trunk and development.Ībsent any restrictions from the tools you use or team you're on, any valid branch name will work. The most popular alternative name is main. Previously, the default branch was almost always named master. Git 2.28 added the ability to choose an initial branch name.Īt the same time, Azure Repos, GitHub, and other Git hosting providers added the ability to choose a different initial branch name. ![]() There are other aspects you should consider before making this change. Once you've set the new default branch, you may delete the previous one if you want. next to the branch you want to set as default, then select Set as default branch. Your branches are displayed under your repo. Now if I take a look, you see, it looks like the same files, the same folders and same files, but if we were to drill down deeper and take a look at the contents of those files and those projects you'd see they're changing as I'm going through the course.Select the settings button in your project to open the project administration page. I typed in the wrong branch, so you see I got this error, pathspec does not match any files known to git, so that's because I made a typo. Oops, I forgot the word check, I forgot the word git, checkout 04-04. So we'll do a git branch -a to see em all. So you see, when you switch branches, it changes the state, now I have a different set of files. Now you see that I have some sub-folders, DebugConsole, DebugWpf and RobotNameGenerator, and if I drill down, like this, you can see I've got some CS project files in there, those are just C# projects, and I've got a CS file, which is some code file, and I've got a couple of text files. Now let's see what happens when I switch to checkout 01-01 and then do a dir. So what does this imply for the files? Remember that if I do a dir, here, I'm in the source folder, I only have these two files. How would you do that? Git checkout master, and then we'll do a branch to see that we're back on master. The green tech shows me that I am on that branch, and then it shows that I also have the master branch available to switch back to master. I am currently on 01-01, that's what the asterisk means, that's where the head is pointing. ![]() And now if I do git branch, again, like this, it shows that I have two branches I've checked out. It tells me a switch to a new branch, and it's also telling me it's set up to track the remote branch from 01-01, from origin. So let me clear the screen, first, and then I'll type in git checkout, and then I need to tilt the name of the branch, 01-01. So I would like to switch to branch 01-01. Now I can see all their branches are available to me by typing in git branch -a, and all the ones that are in red are in the repository, but I haven't checked out any of those yet so they're not listed as local. ![]() So I'll type in git branch, and this tells me that I've only checked out one branch so far, and I'm currently on that branch called master, that's in green text here. ![]() First of all, let's take a look at which branch I am currently got checked out on my local computer. I've cloned the repository to the local folder, and I would like to switch to another branch. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |