Alright,
so what I'm going to do at this point, so I'm going to remove
the .idea directory
and this is done
not through the typical rm command, which you would expect.
It's done through git rm
-r
and then the directory.
So, it's removed
all of these files now
and if I change, well actually it's not going to be there.
If I go to Pycharm, it's probably going to tell me that something has changed.
It needs to be a
no? notifcations yet, alright.
Let's just do this, let's run git
add -A
git commit
-m Remove .idea directory
and git
push
Now, if we go back here and refresh,
the idea directory is still here.
Because it just dot right now.
So, I'm going to close Pycharm entirely.
Let's run the remove,
again.
to removed it with -f because it's been modified
then lets git push again.
There, if I refresh, I should see that directory gone and I do.
How do you get git
to
completely ignore
that directory. Because it's going to be automatically created everytime I launch
Pycharm, or whatever Jet Brains
IDE your working in.
and I'm not sure if it does it for other
IDEs if it creates a little hidden
directory there that you don't necessarily want to be included in the repository,
but if it does,
get the name of that directory and do this:
So, in the main
repository directory, I'm going to run git
ignore
I think that's actually
using a hyphen
and I'm going to ignore that directory and everything in that directory.
So, if I type nano
.gitignore
I see this.
which is good.
We're going to exit out of there.
and I'm going to type git -ignore
and just the directory
There.
So now, if I open up Pycharm,
Let's make some modifications to the main.py file
and then we're going to commit those changes
and send them up to the repository.
And we should...
we should
be able to see that the idea directory is excluded.
So, I'm going to open up main.py here.
lets define main function
text message
let's print message
and then we are going to just call main
Hello
People
and Save.
We can now run this
in the IDE, if we want to make sure it works before we commit it.
So now, let's go back over here. Let's run git add
git commit -m
"Changed main.py"
and then git
push.
There we go.
So, I'm going to refresh this.
And
we've got the main.py file is the newest version. We can see there.
We don't have the .idea directory because we've ignored it
and this is our gitignore
file.
So, that's cool. This is how you would use git.
in terminal.