📎 Webclip
How to master the art of Git
The article introduces Git as version control software and GitHub as a place to store and view repositories online. It is aimed at aspiring developers and college freshmen, and it focuses on the basic commands used to learn Git faster.
It walks through creating a repository, cloning it to a local machine, checking file status, staging changes with git add, committing with a message, pushing to GitHub, pulling updates, and undoing mistakes with git checkout and git reset --hard.
Reading notes#
- Git is described as version control software that lets developers see versions of their code and track changes, revisions, and improvements.
- GitHub is presented as a hub for repositories, where code can be stored and viewed online.
- The article recommends installing Git, creating a GitHub account, and making a new repository before working locally.
- Cloning is explained as copying the repository from GitHub to the computer and linking the local folder to the origin repository.
git statusis presented as the main command for seeing edited files and the difference between the origin and the local working directory.git add -Astages all changed files, whilegit add <file>lets the user choose files one by one.git commit -m "meaningful messages"stores the staged files in a new commit with a message.git pushuploads committed changes to GitHub, andgit pullbrings the latest version of the code base to the local machine.- The article advises checking status often, changing only the files you want, staging changes carefully, committing before pushing, and pulling before pushing.
git checkout -- pineapple.txtis shown as a way to discard unwanted changes in a file.git reset --hardis shown as a way to discard all changes since the last commit.
