How To Use Git Source Control with Xcode 9

Forgive a newbie question.

So I followed the tutorial and have 2 questions

  1. We started with local git repo. Then we also committed to remote repo. Once I have a remote repo, why would I still need local repo? Can I just get rid of it and if so how?

  2. Letā€™s say I keep both local and remote repos. Getting confused on which branch of local/remote is active. Are my code changes getting committed in both my local and remote repos?

Please take a look at this Stack Overflow post when you get a chance:

I hope it helps. Thank you! :]

Hi Topia!

You have to keep your local repo. Thatā€™s where all of your work is. You cannot work in a remote, only push/pull completed changes. In addition to the Stack Overflow post Cosmin referred you to, I highly recommend our ā€œBeginning Gitā€ and ā€œMastering Gitā€ video courses. They will answer these questions and many more.

All the best,
-r

Regarding Tip2 ā€¦

I think you were right. I think I created the gitignore file after the file that I wanted to be ignored. It was relatively easy [and scary] to fix.

git rm -r --cached .
git add .
git commit -m "fixed untracked files"

This tutorial is more than six months old so questions regarding it are no longer supported for the moment. Thank you!