Skip to content

Instantly share code, notes, and snippets.

@licensed
Forked from nishitpatel/Readme.text
Created January 18, 2020 14:37
Show Gist options
  • Save licensed/1e5c68f098f75ab865064330f0c8eaff to your computer and use it in GitHub Desktop.
Save licensed/1e5c68f098f75ab865064330f0c8eaff to your computer and use it in GitHub Desktop.
Add GitIgnore to existing Repository.
Step 1: Mannually add git ignore file on git server with predefine templates for ex. if you are adding gitignore file in
iOS project than user Object-C template.
Step 2: After successfully adding git ignore update your local branch code with latest code.
Step 3: While Merging master code with local code may be you will see VIM editor to add commit message. So for VIM editor
Just press ESC -> : -> x it will close VIM editor. After than perform
Git add .
Git commit -m "COMMIT MESSAGE"
Git Push origin "BRANCH_NAME"
Step 4: After you run your project you will still see the untracked files. To remove those files perform following setps.
May be in your repository you will see any other file so below path is just for reference please don't take it seriousally
other wise you will be in trouble.
i: git rm --cached ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate
ii: git commit -m "Removed file that shouldn't be tracked"
Step 5: After performing above steps again add, commit and push to server branch.
Step 6: FINISH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment