Created
September 4, 2020 09:04
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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