So now that you have set up your repository, we can talk about working with repositories.
But first, let me repeat what we have just done in the strong authentication setup.
The issue is that GitHub does not accept username and password authentication anymore.
And as an easy alternative, you can use SSH key base authentication.
I would recommend you do that because it's a native protocol to Linux and should be easy
to set up.
So first, on Linux, you need to create a key pair using ssh-keygen-t ed25519, that's a
key type, and "-c", followed by your email address, because your email address is used
to identify yourself on GitHub.
Then you add your key to the SSH agent on your local machine using eval ssh-agent-s
ssh-add, followed by the private key that you have just used.
By doing so, you make sure that it is cached, and that is particularly convenient if you
have any passphrases securing your private key.
Then you need to get the content of the public key.
You can do that by getting it from the .ssh-id-underscore-ed25519.pub file.
Now you need to go to the GitHub website, where on your GitHub account, Settings, SSH
and GPG keys, you add the new SSH key, and make sure to save it, and set the remote on
your Linux machine based on the SSH URL.
So the git remote that you have seen on the previous slides needs to be changed, and this
is how you change it.
So git remote set-url origin git add github.com.
That specifies the Git protocol.
There you use your username, followed by the name of the repo, .git.
And then it should be all set.
And now you can start using your Git repositories.
So the basic skills, you can use git clone HTTPS git server slash repo name to clone
the contents of a remote repository to your server.
And to update the local repository to the latest commit, use git pull.
So if in between somebody has changed the content of the remote Git repository, git
pull will synchronize your local system.
So if you are a developer, every now and then you probably want to upload changed files.
And modified files need to go through the staging process.
So after changing files, you use git status to see which files have changed.
Then you use git add to add these files to the staging area.
Alternatively, sometimes you also need to remove files.
Git rm will remove the file.
It will remove the file from your current repository.
And it will also flag it for removal in the remote.
And then you can use git commit minus m with a commit message.
Use any message that you want.
And finally, you can use git push origin main to push your changes.
And next, from any client, git pull can be used to update the current Git clone.
Let me show you.
So I'm going to copy some new files.
I'm going to paste the ATC G star to here.
And LS is showing the new files.
So in the Git repo, I'm using git status.
And git status is giving me information about untracked files.
So that is what I'm going to fix using git add G star.
Or just git add star.
That will be okay as well.
Now, git status once more is showing that we have changes to be committed.
They are in the staging area.
Git now knows about them.
And I can use git commit minus m followed by the message that you want to use.
Minor changes.
Good enough.
Next, I'm using git push origin main.
And it will push the changes to the Git repository.
And now we're all done.
So any client who is using git pull will get access to the updated files.