Jump to content

.gitignore - how to use


Adam
 Share

Recommended Posts

I've recently been messaged a lot, as people have added things to their .gitignore file however changes are still picking up, this is because you need to remove files to match from the git cache

 

I will be showing you how to do this using GitHub Desktop

 

First find your repo, click 'Repository' at the top then select the option 'Open in Command Prompt'

 

If you get a notice to install git, do that and restart your pc before carrying on

 

write in the following command, replacing *.bin with your file

 

git rm -r --cached *.bin

 

 

If you see some files pop up, it worked and you'll see them as removed files on to commit. DONT PANIC, THESE FILES WILL STILL REMAIN ON YOUR LOCAL MACHINE

 

If you see the following message:

fatal: pathspec '*.bin' did not match any files

 

You have no pushes containing the file/file type, and the file will be ignored like normal.

 

Edited by Adam
Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share