GitHub Desktop :: Why is my GitIgnore file being ignored? #55860
Replies: 4 comments 2 replies
-
Hello 👋🏻 If you already have a remote repository (on github):
If it was useful mark it as answer and if you need more help don't shy 🤝 |
Beta Was this translation helpful? Give feedback.
-
@Mirlahiji Thanks Mirlahiji, I've followed your advice, but I want to ask a few follow-up questions before I do anything. Thanks in advance! On the GitHub website, I've created a remote repository, using the documentation you cited and including the .gitignore that you provided. (Thanks!) I've also put a copy of that same .gitignore file in the root folder of my project, here on my laptop. Okay. Right now, the full project is on my laptop, and the empty repo is up on GitHub. So if I pull the repo as it is now, I assume I'll be challenged for where the cloned repo goes on my laptop? If I specify the root directory of my project, won't the new, empty repo overwrite the contents of the local project? (i.e., I'd be effectively deleting all my local files.) Also: I understand that I have to manually add my files into a Git project before they can be committed and pushed. Presently, if I select "Add Existing Repository" in the GitDesktop app, GitDesktop adds all 24,883 files that make up the local project - .gitignore is ignored. In your bulletpoint instruction list above, how do I add the project files? How/When does .gitignore come in to play? Thank you so much! |
Beta Was this translation helpful? Give feedback.
-
@Mirlahiji Thanks again Mirlahiji, Yeah, I'm not sure I understand my question myself. Git seems to be one of those technologies that everyone understands intuitively, and I just can't get the concept. Thanks for being so patient. STEP ONE: Create a new repo on GitHub.com, making sure to include the Unity .gitignore file. Do you think that process should work? Thank you. |
Beta Was this translation helpful? Give feedback.
-
@airtower-luna Thanks Airtower. Thank God I didn't try my plan, I appreciate you helping out! The problem with a Unity project is that there are a ton of files, almost ~2Gbytes of data. I don't think its wise to try and transplant all those files into a new directory; I'd probably confuse Unity and make things worse. I need a solution where I can back up only the essential files of my project... in other words, the files that would be identified by a .gitignore. I guess I'll have to read the book. Thank you for pointing it out to me! |
Beta Was this translation helpful? Give feedback.
-
Hi all, I'm a building a game with Unity Game Engine and I'm struggling to back it up in a private GitHub repository. I've been reading up on Git, GitHub, and GitHub Desktop. And while I understand the basic concepts of GitHub, I'm afraid still find the user-to-Git interaction to be baffling.
Adding to my confusion, Unity projects are quite large; my little POC prototype is over 1.8 Gbytes on disk. I read quite a few "Unity & GitHub" tutorials, and in this one the presenter makes the point that most of the files within a Unity project are tmp files or general Unity that do not have to be backed up. In fact, at time index 2:44, the presenter explains that a robust GitIgnore file will highlight only the specific files that are needed to back up the project. He even provides the
.gitignore
file to use.So I put a copy of the
.gitignore
into my project's root directory, and then followed his tutorial. In the video, you can see that when he goes to Current Repository --> Add --> Add Existing Repository, (in GitHub Desktop) he initially commits 454 files -- very reasonable.But when I followed his steps, GitHub Desktop only allows me to do the "Add Local Repository" option. When I click "Add Repository", GitHub Desktop identifies 26,000+ files to back up, and that's too large for GitHub. Brick wall.
Anyone have any experience in this area? Better yet, could someone recommend a better tutorial? I'll take any advice or criticism you might offer.
Beta Was this translation helpful? Give feedback.
All reactions