How to Ignore Git Folders and Directories .gitignore
HTML-код
- Опубликовано: 4 окт 2021
- Here's a quick overview of how to use the .gitignore file to ignore Git folders and directories.
There's no big trick to ignoring folder in Git. Just add the name of the folder with a trailing slash to your .gitignore file. Then, the next time you commit or push with Git, the directory will be ignored and the folder will not be part of the commit.
Your explanation was so concise and easy to understand. Thanks
such an easy to understand tutorial, Cameron. Thanks much
Glad I could help!
Amazing explanation my man. Thank you!
Glad I could help. Lots of Git features that aren't documented too well. Happy to fill in a few gaps for a great tool!
thank you for not overcomplicating it and stretch it to 10 mins. thank you a lot. have a great day. you helped me a lot.
Thank you for easy explanation .It helps me a lot
Very precise and informative video , thank you
Most concise and to the video.
Thank for the quick easy tutorial!
Glad I could be of assistance. Happy Git!
Thanks for such a quick useful tutorial ;)
Glad I could help. Trying to keep my tutorials quick and to the point!
God bless you man, you saved my job
Amazing content, thank you!
what about if I dont want to add content from folders inside another folders. e.g folder1/target, folder2/target...?
I tried this and it's not working for me :(
When I write: foldername/
it just wont ignore the folder
Hi Cameron, amazing video maybe the best explanation I have seen about this subject, question how can I make sure this ".gitignore" goes towards any new branch?
It should copy over every time you branch off a piece of code that already has a gitignore.
Totally worked. Thanks!
I want to ignore a particular file within many files inside a folder. I specified the exact location of that file, but still it is not being ignored. What might be the reason.
Is that possible to ignore a set of files while raising PR request?
Is there a way to ignore any folder but keep files? I don't know what folder name would be created by someone else
excellent and good understanding technique
Thanks for the kind words! I try and get right to the point.
Thanks !! A lot of teaching did not say to key touch .ignore
Perfect explanation. Short and Sweet. Thank you!
What about the thumbnail art? I think the thumbnail art is hilarious. :) Thanks so much for the kind words and the encouragement.
@@cameronmcnz To be honest I was a bit confused with the thumbnail. Maybe it's just me!
A little bit of confusion hit me @2:52 when you said "...we don't want that target folder to be added to the git repository...".
Seconds earlier it was said that we don't want anything "in" that target folder up to the server.
So with that syntax "target/" does it ignore the folder itself? (as well as the contents)
Thanks!
Imma have to go an re-watch that...
The only reason nobody was looking at me was because I forgot to take the .gitignore sign off my back! Thank you!
I LOVE YOU SO MUCH :)
LOL! So glad I could help you out!
Nice vid
What if the folder we want to ignore is already added or committed?
I think if it's already in the repo you're out of luck, but I'd have to look at the docs.
Thank you!
Happy to help!
how do i ignore folder inside another folder? but i want to keep the parent folder, for example i have a folder called "Content" and inside content i have another folder called "CustomAssets" i want git to ignore "Custom Assets" but keep "Content" folder, how do i do it?
did u find any solution for this ?
@@_origin5858 yes, just type Content/"your folder"/*
@@TrySomeCG you mean Content/Parent_Folder/ Folder_to_Ignore ?
@@_origin5858 yes if you have a parent folder that will work but dont forget to add "/*" in the end
Thanks man!
My pleasure!
Thanks youuuuu
Thanks
Thanks.
Glad I could help!
im panicking after trying to push 40gb asset storage accidentally, thanks man
Been there, done that. Did GitHub reject the push? Normally it would unless you have a special plan.
At times like that, what I often do instead of trying to fix your local repo where the big file is inside of it, just do a new clone from GitHub.
Since GitHub will reject a big file, if you do a new clone you get everything from before your last push, minus a few recent changes.
If you can just add those changes since the last push without the big files in your repo, you're good.
Just an easier option than trying to remove things from your git history.
@@cameronmcnz yeah but in log there is already a commit log, i just reset and rebase haha, but thank god its all fixed
@@wicaksonoleksono7327 As long as you recovered. Now stop copying giant files into your git repo!
thanks
I'm just going to ignore that comment. :)
@1:51 video starts
It's not like it's a long video! I try and keep all my videos fairly short.
meow
Is that a good 'meow' or a 'bad meow?'