LoginSignup
1
1

More than 1 year has passed since last update.

【Git】既にリモートにあるファイルをGitの管理下から外す

Last updated at Posted at 2023-04-02

はじめに

Xcodeを触るたびに変化が加わってしまう、厄介なファイルがあったので管理下から外して今後コミットしないようにしました。記録しておきます

やりかた

git rm --cachedで管理下から外す

ターミナル
git rm --cached /Users/miyamototaishin/Desktop/G-Search/TwitterSearch.xcodeproj/xcuserdata/miyamototaishin.xcuserdatad/xcschemes/xcschememanagement.plist

.gitignoreにファイル名を追加して今後コミットしないようにする

.gitignore
xcschememanagement.plist

.gitignoreをコミット&プッシュする

ターミナル
git add .gitignore
git commit -m 'add: .gitignore'
git push origin main

おわり

gitはむずいですね

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1