Git Notes
Git Notes
Git
↳
-Hitesh Choudhary
githa
it & different t
L
software
Version Control
->
System
-> track files for changes
->
Learning->
Path
Get the basics
-> Use it daily
-> face the Problem -> solve the problem
- I have covered more than basics in this
Repo Git
>
on
system
US
tracking (Repo)
git--version
Git Rebo
->
1 -
Not tracked
-> Git
history Seo
-> git status
git -
a hidden folder to keep history of all files
& sub-folders
Don't re-share without
tagging me !
=> Commit
↓
Working Dis
git commit
Write - Add - Commit Repo ↳
git bush
,
Github
=>
Stage
- git init
Create file or files
git add filel filed II git add ·
git status
->
Commit
git commit -m "a
good descriptive message"
status
git
-> Repeat 2-3 times
fix Focused
on
Present
. on one
editor" code--wait"
git config--global↳> core
online
->
get template ,
batterns
M
can be tricky
Strangel
0
-o
-
0-0-0-0-0 -
0 you are
always on some
Lo-to-o Branch
->
Head -> master
Head points to where a branch is
currently at
master. "
o
-
-
&
master " Find
branch
git
branch bugfixe
git
git switch bugfix
git log
git switch master
HEAD
a mater
=
- -
My-branch
that are on
you
=====
es
3))
->
fix
Conflict that came from another branch (merge)
buy
·
+ +
file s
lines little preview of it
changes in &
·
-
clean up tool (Clean up commits)
-o -
-
W
⑧ 0-0-0 3
4 I
commits
merge
-
-0-0-0-0-0 -Rebase
master shgfis
git init
work & commit on main branch
foota
git switch-c
work & add a
foote in feature branch
git commit -
am "add footh text"
git switch main
E
sp
By
Erect
Never Rebase commits that you have shared
Pushed to Github NEVER rebase -
have strict commit
some
companies guidelines regarding
to be added
messages like ticket id . You can use rebase
to re-write
your git history before sending ,
a
bull request
git rebase -i HEADWS (order is reverse)
pick reword
, (your hash also gets a
change)
these are commands
many more
like
->> Tags :
a
sticky note
->
git show v3 .
0 . 0
git tag hitesh 2467b289 (tag previous tag)
tags needs to be unique
git tag-d hitesh (delete tags)
git bush--tags (push to remote repol
Reflog
track of where
git keeps your HEAD is
moving ,
ex :
branch to branch
These logs are local ,
not shared Rare expired
git reflog show HEAD
-> Github Discussion
Git is a software & Github is a service to host git online
·
Github - collaboration Backup + Open Source
+
Gitlab or Bitbucket
Setup SSH
keys to connect with github github/
·
check instruction for your 05 on
github website
,
as
git bush
& it push the code
directly to
github
When clome a repo you get just main branch connected
you , ,
branch-name
git switch
connects remote ↳ tanch to local
git branch -
I
②
git fetch
↑
-
Read me file
->
matk down format
Gists
Adding
->
"Hitesh Choudhary" on
you tube
whitesh dot com on twitte or X