Q)What is Git?
→ Free and open source version control system.
Q)What is Version Control?
→ The management of changes to documents, computer programs, large web sites, and other collection of information.
<aside> 💡 Git code Editor - Any text editor but, Visual Studio Code (best)🙂
</aside>
TERMINILOGIES
TERMS:
DIRECTORY- Folder.
TERMINAL OR COMMAND LINE - Interface for Text Commands.
CLI - Command Line Interface.
CD - Change Directory.
CODE EDITOR - Word Procrssor for writting code.
REPOSITORY - Project, or the Folder/Place where your Project is kept.
GITHUB - A website to host your repositories online.
COMMANDS AT A GLANCE
GIT TERMINAL COMMANDS:
[NOTE:- ALL COMMANDS ARE IN SMALL LETTERS(CASE)]
CLONE- Brings a repository that is hosted somewhere like Github into a folder on your local machine.
ADD - Track your files and changes in Git.
COMMIT - Save your files in Git.
PUSH - Upload Git commits from remote repo, GitHub.
PULL - Download changes from remote repo to your local machine, the opposite of push.
STATUS - To know the status of the file (is their any modification is or not)
DIFF - Show the difference in changes of file
RESET - Undo the commitment (Kinda same XD)
INIT - Add the folder to repo
REMOTE - To add new remote
LOG - To check the history/logs of file
SSH
GITHUB SSH KEY:
LOCALLY ON MACHINE:
1. (on terminal) ssh-keygen -t rsa -b 4096 -C "<ur github email ID>"
2. go the directory where the ssh-key has been saved and copy the private key on the file with email.
3. GOTO github > settings > SSH and PGP keys > create new ssh key and paste the ssh key that was copied from ssh key file.
ADD SSH KEY TO SSH-AGENT:
-> eval "$(ssh-agent -s)"
-> ssh-add -K <ssh-key location>