Skip to content

Instantly share code, notes, and snippets.

@gunesmes
Created September 4, 2020 09:04
Show Gist options
  • Save gunesmes/769d68b0ad923f6b7c2eeaa3555e6714 to your computer and use it in GitHub Desktop.
Save gunesmes/769d68b0ad923f6b7c2eeaa3555e6714 to your computer and use it in GitHub Desktop.
add file as base then ignore it - git add will not discover it
# push base of file
git add file_name/folder_name
git commit -m "added base for the file/folder"
git push origin feature/branch
#ignore the file
cat .gitignore
/file_name
# git update index to assume unchanged
git update-index --assume-unchanged file_name
# EXAMPLE
~/P/v/Movies-Sample-ios (feature/setup-script ⚡↩) git status
On branch feature/setup-script
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: .apple-cred
modified: .gitignore
~/P/v/Movies-Sample-ios (feature/setup-script ⚡↩) git update-index --assume-unchanged .apple-cred
~/P/v/Movies-Sample-ios (feature/setup-script ⚡↩) git status
On branch feature/setup-script
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: .gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment