-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit_cli.txt
More file actions
25 lines (22 loc) · 1.48 KB
/
Copy pathgit_cli.txt
File metadata and controls
25 lines (22 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
GIT AND GITHUB DEFINITION
**GIT - git is a version control mechanism that is used to basically keep track of changes made to files
--and enabling access to older versions of the changes made to that file or programme
**GITHUB - github is a platform that is built on top of git to enhance remote repositories. In other words,
--github let's users (developers) to save their commited files and programes to its host server which
--guarantees the file's safety and accessibility.
GIT CLI (COMMAND LINE INTERFACE) - local implementations
1-git init: initialise a folder to use version control. often called repository
2-git status: check the state of files
3-git add: move files to the staging phase
4-git commit: make permenent changes after staging
5-git commit -m: -m flag used to include a message about changes when commiting
6-git rm --cached (-r) <file>: unstage files or remove files from the staging phase
7-git log: inspect all activities and changes
8-git restore --staged <file>: unstage files or remove files from the staging phase
9-git checkout <file>: restore/roll back to the previous changes/commit made to the file
GIT/GIHUB REPOSITORY (REMOTE REPOSITORY) - global implementations
1-create a remote repository on github and copy the link to it
2-run the command **git remote add origin <copied link>**
3-git push -u origin main: to push local repo to remote repo
GITIGNORE (hiding secrete/sensitive information and files on github)
1-.gitignore file is used to hide sensitive files and information.