DEV Community

StuartCreed
StuartCreed

Posted on • Updated on

Using git and github together via Command Line

Github link: https://github.com/
Useful link to turn a local git into a global git on github: https://docs.github.com/en/github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line

Set up your computer so that it is allowed to access your Github account. To do this follow the steps in the following link:
https://help.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account

Or you can use Github Desktop, which avoids manually setting up the SSH. But the SSH method above is required for Unix command line environments where the Github Desktop GUI is not available.

"git clone" can be used to clone an online repository you have created on github. This can also be useful if you have just forked someone elses repository or you are using a different computer than normal. Link for more info: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository

Once cloned and you have made some changes to the directory:

Stage all commits:
git add -A

Commit the changes with a comment:
git commit -m "comment"

Push the committed files to the repository on Github:
git push

Now if you look at your Github repository online the changes will be visible.

Top comments (0)