Git
Git
Git
$ git init <- This is to initialize git into the example folder and creates a new
repository in your PC
Initialized empty Git repository in /Users/user/myproject/.git/
$ touch index.html
$ touch script.js
$ touch style.css
This is to create a files named index.html, script.js, style.css
in the example folder
$ git rm --cached index.html <- this is to unstage index.html from the repo
rm 'index.html'
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: index.html
new file: script.js
new file: style.css
Untracked files:
(use "git add <file>..." to include in what will be committed)
commit 221ec6e10aeedbfd02b85264087cd9adc18e4b26
Author: yourusername <[email protected]>
Date: Sun Apr 26 14:33:07 2023 +0100
My commit Message
$ git checkout branch_name <- This is to switch from one branch to another
git checkout branch_name
Switched to branch 'branch_name'
Commands
git --help
ctrl + l
git show
cd .. --> to go back
dir
git config
git config -l
ls -a
git merge main