video Git and GitHub for beginners Flashcards
clone
bring a repository that is hosted somewhere like GitHub into a folder on your local machine
track your files and changes in Git: command
add
push
upload Git commits to a remote repo, like Github
pull
download changes from remote repo to your local machine
the opposite of the push
how to clone a Github repository on your computer?
open Git Bash
open repository on GitHub
settings - deploy keys - create new
in Bash: ssh-keygen -t rsa -b 4096 -C “my@email”
open ssh agent in Bash: eval $(ssh-agent -s)
add the key to that agent: ssh-add ~/.ssh/name_key (default is id_rsa or whatever it writes earlier during the creation)
to copy the key: clip < ~/.ssh/name_key.pub
back at GitHub: paste into the key field, give it some name, allow writing, create. Now the repo has a key.
code - code dropdown - choose SSH, copy the address
in Bash: back to the home directory: cd
git clone paste_the_address
if it asks - say “yes”
cd name_of_the_repo
how to commit changes on your computer?
make changes, then:
to check, if the changes occurred: git status
to add to commit: git add .
to commit: git commit -m “name of the commit”
push commits to GitHub from a project that was originally cloned from GitHub to your machine
to push: git push
at GitHub: new commit should appear in the “code” tab of the repo