No video

How to Ignore Git Folders and Directories .gitignore

  Рет қаралды 60,595

Cameron McKenzie

Cameron McKenzie

Күн бұрын

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.

Пікірлер: 61
@Pasdpawn
@Pasdpawn Жыл бұрын
such an easy to understand tutorial, Cameron. Thanks much
@cameronmcnz
@cameronmcnz 9 ай бұрын
Glad I could help!
@svens3722
@svens3722 Жыл бұрын
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.
@kayodeolanrewaju1895
@kayodeolanrewaju1895 2 жыл бұрын
Your explanation was so concise and easy to understand. Thanks
@TechNestHubOfficial
@TechNestHubOfficial 8 ай бұрын
excellent and good understanding technique
@cameronmcnz
@cameronmcnz 8 ай бұрын
Thanks for the kind words! I try and get right to the point.
@marsdwarf
@marsdwarf 2 жыл бұрын
Perfect explanation. Short and Sweet. Thank you!
@cameronmcnz
@cameronmcnz 2 жыл бұрын
What about the thumbnail art? I think the thumbnail art is hilarious. :) Thanks so much for the kind words and the encouragement.
@marsdwarf
@marsdwarf 2 жыл бұрын
@@cameronmcnz To be honest I was a bit confused with the thumbnail. Maybe it's just me!
@pratyushvaibhaw6170
@pratyushvaibhaw6170 Жыл бұрын
Most concise and to the video.
@Xaffre
@Xaffre 9 ай бұрын
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!
@cameronmcnz
@cameronmcnz 9 ай бұрын
Imma have to go an re-watch that...
@ethangordon3935
@ethangordon3935 2 жыл бұрын
Amazing explanation my man. Thank you!
@cameronmcnz
@cameronmcnz 2 жыл бұрын
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!
@AnanshGupta
@AnanshGupta 2 ай бұрын
Very precise and informative video , thank you
@bitelogger
@bitelogger Жыл бұрын
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?
@cameronmcnz
@cameronmcnz Жыл бұрын
It should copy over every time you branch off a piece of code that already has a gitignore.
@soubiluv98
@soubiluv98 2 жыл бұрын
Thank for the quick easy tutorial!
@cameronmcnz
@cameronmcnz 2 жыл бұрын
Glad I could be of assistance. Happy Git!
@tony355367
@tony355367 Жыл бұрын
Thanks !! A lot of teaching did not say to key touch .ignore
@xXAngelmlXx
@xXAngelmlXx 2 жыл бұрын
I tried this and it's not working for me :( When I write: foldername/ it just wont ignore the folder
@blinking_file8948
@blinking_file8948 Ай бұрын
i'm suggesting that you have already solved that issue years ago, yet i want to answer this problem nonetheless - the root of the problem may be in the file encoding, because i had an issue exactly with that and had to change UTF-16 LE to UTF-8, and exactly that fixed the problem
@hakami1426
@hakami1426 Жыл бұрын
What if the folder we want to ignore is already added or committed?
@cameronmcnz
@cameronmcnz Жыл бұрын
I think if it's already in the repo you're out of luck, but I'd have to look at the docs.
@lester_cch9877
@lester_cch9877 2 жыл бұрын
God bless you man, you saved my job
@nuraybaxsl827
@nuraybaxsl827 Жыл бұрын
Thank you for easy explanation .It helps me a lot
@rehamalbulushi520
@rehamalbulushi520 2 жыл бұрын
Thanks for such a quick useful tutorial ;)
@cameronmcnz
@cameronmcnz 2 жыл бұрын
Glad I could help. Trying to keep my tutorials quick and to the point!
@S.Saurabh_
@S.Saurabh_ Жыл бұрын
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.
@wicaksonoleksono7327
@wicaksonoleksono7327 3 ай бұрын
im panicking after trying to push 40gb asset storage accidentally, thanks man
@cameronmcnz
@cameronmcnz 3 ай бұрын
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.
@wicaksonoleksono7327
@wicaksonoleksono7327 3 ай бұрын
@@cameronmcnz yeah but in log there is already a commit log, i just reset and rebase haha, but thank god its all fixed
@cameronmcnz
@cameronmcnz 3 ай бұрын
@@wicaksonoleksono7327 As long as you recovered. Now stop copying giant files into your git repo!
@spiralni
@spiralni 2 жыл бұрын
what about if I dont want to add content from folders inside another folders. e.g folder1/target, folder2/target...?
@filipetrujeira3359
@filipetrujeira3359 2 жыл бұрын
The only reason nobody was looking at me was because I forgot to take the .gitignore sign off my back! Thank you!
@germanungo9435
@germanungo9435 2 жыл бұрын
Totally worked. Thanks!
@TrySomeCG
@TrySomeCG Жыл бұрын
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?
@_origin5858
@_origin5858 Жыл бұрын
did u find any solution for this ?
@TrySomeCG
@TrySomeCG Жыл бұрын
@@_origin5858 yes, just type Content/"your folder"/*
@_origin5858
@_origin5858 Жыл бұрын
​@@TrySomeCG you mean Content/Parent_Folder/ Folder_to_Ignore ?
@TrySomeCG
@TrySomeCG Жыл бұрын
@@_origin5858 yes if you have a parent folder that will work but dont forget to add "/*" in the end
@vurkins
@vurkins Жыл бұрын
Is there a way to ignore any folder but keep files? I don't know what folder name would be created by someone else
@notjpengineer
@notjpengineer Жыл бұрын
Amazing content, thank you!
@fmww702
@fmww702 Жыл бұрын
Thank you!
@cameronmcnz
@cameronmcnz Жыл бұрын
Happy to help!
@rohiniraj5692
@rohiniraj5692 Жыл бұрын
Is that possible to ignore a set of files while raising PR request?
@emirhandemir3872
@emirhandemir3872 2 жыл бұрын
I LOVE YOU SO MUCH :)
@cameronmcnz
@cameronmcnz 2 жыл бұрын
LOL! So glad I could help you out!
@Will_of_Iron
@Will_of_Iron Жыл бұрын
Thanks.
@cameronmcnz
@cameronmcnz Жыл бұрын
Glad I could help!
@larkicode8704
@larkicode8704 2 жыл бұрын
Thanks man!
@cameronmcnz
@cameronmcnz 2 жыл бұрын
My pleasure!
@fotoh1589
@fotoh1589 Жыл бұрын
Thanks youuuuu
@rorygrignard9742
@rorygrignard9742 Жыл бұрын
Nice vid
@jubaaissaoui5678
@jubaaissaoui5678 Жыл бұрын
Thanks
@davidshum1938
@davidshum1938 2 жыл бұрын
thanks
@cameronmcnz
@cameronmcnz 2 жыл бұрын
I'm just going to ignore that comment. :)
@ksdnsdkumar1375
@ksdnsdkumar1375 Жыл бұрын
@1:51 video starts
@cameronmcnz
@cameronmcnz Жыл бұрын
It's not like it's a long video! I try and keep all my videos fairly short.
@lucutes2936
@lucutes2936 8 ай бұрын
meow
@cameronmcnz
@cameronmcnz 7 ай бұрын
Is that a good 'meow' or a 'bad meow?'
Git Tutorial For Dummies
19:25
Nick White
Рет қаралды 1,1 МЛН
Learning Git - How to use the gitignore file
7:14
DevOps Journey
Рет қаралды 22 М.
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 5 МЛН
Magic trick 🪄😁
00:13
Andrey Grechka
Рет қаралды 54 МЛН
Inside the Hidden Git Folder - Computerphile
8:33
Computerphile
Рет қаралды 193 М.
Git It? How to use Git and Github
12:19
Fireship
Рет қаралды 748 М.
5. Source Control with Xcode: Gitignore and config files
21:16
Stewart Lynch
Рет қаралды 1,8 М.
Using docker in unusual ways
12:58
Dreams of Code
Рет қаралды 441 М.
Stow has forever changed the way I manage my dotfiles
8:09
Dreams of Autonomy
Рет қаралды 235 М.
How to remove already tracked file and add it to .gitignore file
12:36
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 5 МЛН