I would like to tell git not to commit files larger than 250 MB to my remote repository.
First, initiated the repository:
cd existing_folder
git init
git remote add origin https://git.xxx.com/username/repository_name.git
Next, I would like to tell git, not to commit files larger than 200 MB to my remote repository. For this, I came across this answer on Stackoverflow which suggests to run the following code.
echo "# Files over 250mb" >> .gitignore
find * -size +250M -type f -print >> .gitignore
However, when I run the code in Windows PowerShell ISE it says
PS C:\Users\Username\Rep> find * -size +250M -type f -print >> .gitignore
find : FIND: Parameter format not correct
At line:1 char:1
+ find * -size +250M -type f -print >> .gitignore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (FIND: Parameter format not correct:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Next I would have just run the following code. As I understand, in theory, from now on git would always exclude files larger than 250 MB.
git add .
git commit -m "Initial commit"
git push -u origin main
How can I correctly tell git not to commit files larger than 250MB to my remote repository?