Reputation: 2202
So I have a video folder in my repository that contains some files with .mp4
extension. So I've added them to .gitignore
like this:
.gitignore:
.mp4
And If I understood all correctly it should ignore all files with .mp4
extension. But it doesn't.
I've made next procedure:
git rm -r --cached .
git add .
git commit -m "fixing .gitignore"
git push repositoryname master
But it still pushing my .mp4
files.
How can I fix it?
p.s. My .gitignore
file is located inside root folder of my project, not inside .git
folder
p.s.s. I've added *.mp4
but problem still occurs, here are the logs:
PS C:\inetpub\wwwroot\utg> git rm -r --cached .;git add .;git commit -m 'gitignore';git push utgpage mas
rm '.gitignore'
rm '.project'
rm 'README.md'
rm 'css/bounce.css'
rm 'css/parallax.css'
rm 'fonts/airbrne2.ttf'
rm 'img/logo_white_common.png'
rm 'img/overlay-pattern.png'
rm 'img/utg_logo_white.png'
rm 'index.php'
rm 'js/script.js'
rm 'js/smooth.js'
rm 'video/vid1.mp4'
rm 'video/vid2.mp4'
warning: LF will be replaced by CRLF in css/bounce.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in index.php.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/script.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/smooth.js.
The file will have its original line endings in your working directory.
[master 59dcc7f] gitignore
3 files changed, 1 insertion(+), 1 deletion(-)
delete mode 100644 video/vid1.mp4
delete mode 100644 video/vid2.mp4
Counting objects: 81, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (71/71), done.
Writing objects: 100% (72/72), 129.33 MiB | 311.00 KiB/s, done.
Total 72 (delta 37), reused 0 (delta 0)
remote: error: GH001: Large files detected.
remote: error: Trace: 863068061510dfca317ad799de2a9cad
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File video/vid2.mp4 is 129.55 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/Tachii/utg-frontpage.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '****'
Upvotes: 1
Views: 7127
Reputation: 66
By specifying .mp4
in your .gitignore file, you are simply instructing Git to ignore either a file or folder named '.mp4'.
To ignore all files ending with '.mp4', you need to add a wildcard operator which in this case is an asterisk. So in your .gitignore file, use *.mp4
and all files with a name ending with .mp4 will be ignored.
Upvotes: 2
Reputation: 2915
If you want to ignore all mp4 files, I believe the .gitignore line would be:
*.mp4
Upvotes: 3
Reputation: 1451
Try this putting an Asterisk in front of it:
*.mp4
Check this link for more info about gitignore: http://git-scm.com/docs/gitignore
Upvotes: 3