Now that we GIT installed and our GIT repository setup here,
we also need to configure our user account.
And so how we're going to to that is through the Git Config
So run git space config, two dashes and make your word global user.name
and in the quotations here,
we're gonna type our name.
and then git config
global user.email
it's going to be
this.
So, now our user is set up,
we can pull from this repository and push to it.
So, let's do a pull. Let's run git
pull
and you're going to see that it's going to give an error because
it doesn't know exactly, which branch
is the upstream.
And that's basically, which branch you should always pull and push from.
So, you have two options, you can either,
run git pull origin
and then the branch name which is in this case, master.
This will work,
But also, you can set the upstream branch, so I'm going to do that,
So on git branch --set-upstream-to=
and here, we're going to type
origin slash the branch name
in this case, it is master.
That's not going to work.
Let's do a pull. Let's do a manual pull first.
So, git pull
origin master
and if I run ls, we now see that we have the readme in here.
So, I'm going to try setting the upstream again.
There.
So, you do need to do a pull first.
And that basically tells your machine, what repository or what branch
does the repository have
and then you can set the upstream to one of those branches.
But the repository
on your local machine has to be aware of the branches first.
So now, we've got a repository set up.
We have a file that we can edit, and I'm going to do that.
So, I'm going to go over to Pycharm here.
And open up the project.
Dismiss that for now.
We've got a readme file
So, I'm just going to write a quick description here.
There.
So, I'm going to Control+S to save that.
and come back over here,
I'm going to clear this so it looks a bit cleaner.
And now, what we're going to do is put this change to the server.
And how we do that is we
first need to,
add all the files
to the tracker
and secondly we need to commit our changes
and then we need to push.
So,
to add the file, you can either run git add
and then the file name
or if you want to add all changed files, you can run git add
-A
Now that we've got the files added, we need to commit the files.
And we'ge going to do that with git
commit
-m
and then our commit message, which basically is a headline
for these changes we've made. So, it should
it should describe the changes that we've made.
and be less than say 140 characters.
Because, this is going to show
right here.
And if get's too long,
you know, it might
be as convenient
as it should be.
So, I'm just going to name this one updated
readme
added
main.py
and then hit Enter.
Now,
I'm going to a
let's just push it.
So, git push
Now, if I haven't set the upstream to origin master
I would have to type git push origin master here.
But I have the upstream set, So, I'm just going to type
git
push
and then enter the username.
and the password.
and this command has been successfully pushed to the remote repository.
So, if I come back to this page and refresh,
we're gonna see,
the change the README file
has succeeded.
The main.py file has been added.
and
we also got this directory right here,
which is for the Pycharm IDE,
this files, provide information to Pycharm about
say, which files are currently open
stuff like that, so if I close Pycharm and reopen it,
It knows what files to open
from my last session.