This project might consist of several smaller projects \acme world domination If you want to share your hello world project with the world, you can push it to GitHub without being afraid of people also getting a glimpse of your world domination project. Here you have three different project and they should be three different repositories. If you forget about git for a moment and just take a look at your hard drive, you might have a folder structure there similar to \Projects ![]() In general, one repo should be one project, even though it has become more common to talk about ‘mono repo’ the later years. A branch is just a reference to a commit. Each commit contains a full set of files and folders as they were when the commit was made. It gives you a little different introduction to what git repositories are and how they work.Ĭommits are versions of your projects. I'm guessing by making changes you want and committing them on one branch, and doing the same (with the other changes) on the other branch. They can have different files within that, or changes from one branch to another. >Do all branches have to share the same files?Īll branches share the directory structure. (It would have, if you created the files when you were in that branch.) But yeah, it would have been easier if it had strongly hinted that you should commit those files when you were in the branch where they go. If you want them in a different branch, you can call git stash push, switch branches, and git stash pull to get them back. If you want them in this branch, you add them. > Git Bash won't let me do anything if I have some untracked files. What are you supposed to do with a file that's not in version 1 and not in version 2? Should you.delete it? Maybe tell them you're deleting it? Let them keep it and think that everything's fine, but at some point things blow up because the files on the dev's box aren't in source control? Something else? You delete a.txt and add b.txt as you switch to version 2, because those changed between the versions. Imagine you're writing software that's going to let users get the software to where it was in version 1, then switch to version 2. This is directly related to what you were just asking. >Also, what's wrong with untracked files? The same place as the other changes: they're in git's internal database. If you focus no a particular file instead of the version, you might see a file appear as you switch to version 2 and then disappear again as you switch to version 1, or vice versa, depending on which file you're looking at. ![]() When you switch to version 2, you would expect those changes to be there. ![]() When you switch to version 1, you would expect all the changes you made for version 2 to be gone. I want to make changes and make it version 2." So you do: you delete one file, add 2 new ones, remove several lines, add some new lines, and change some lines. Why do branch files disappear from their folder and reappear when I switch branches
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |