Git and Github.com another post codewithharry.com
- Get link
- X
- Other Apps
One of Best and Easiest Training better than paying Traning on Git and GitHub.com is with codewithHarry.com for who undertand URDU / HINDI for Pakistanis and Indians
My suggestion is to speed video with speed of 1.25x or 1.5x
https://www.youtube.com/watch?v=evknSAkUIvs&list=PLu0W_9lII9agwhy658ZPA0MTStKUJTWPi
What is Git/GitHub & Why do we need it? | Git Tutorials #1
$ git init
Initialized empty Git repository in F:/GIT/.git/
$ git add first.txt &&& to transfer file from Untracked/working directory to Stage Area , Stagging area
$ git commit first.txt -m 'changed first.txt and added better design'
$ git log && following will be out
commit 3daf1bf3398e58033f4659d1f6daab7d84968c3c (HEAD -> master)
Author: SAEED HASSAN <saeedhisbani@yahoo.co.uk>
Date: Fri Sep 22 16:33:20 2023 +0500
modified excel
commit 11a8a3652a4a0b4a85b9371d1eee59ed7a7d4b15
Author: SAEED HASSAN <saeedhisbani@yahoo.co.uk>
Date: Fri Sep 22 16:30:13 2023 +0500
changed first.txt and added better design
commit 30d797a3dab427e268a0573873617e328d547581
Author: SAEED HASSAN <saeedhisbani@yahoo.co.uk>
Date: Fri Sep 22 16:20:08 2023 +0500
Initial Commit
Saeed Hassan Hisbani@Saeed-PC MINGW64 /f/GIT (master)
$
video No 5
To remove whole git repositry
$ rm -rf .git
video No 6
$ git add newfile will became TRACKED FILE Unmodifield
When we modify any Staged File status will be MODIFIED STAGED file
if we modify Commit (ed) file then it will be MODIFIED UNSTAGED file
All statuses will be apparantly seen on the screen messages of git no need to remember
video No 7 .gitignore: Ignoring Files in Git
for ignore any file add in vi .gitignore doc as
*.log means all .log file
dir/ means all files in dir/ directory and also ignore dir/dir/ files.
empty folder is befault is in ignore condition
video No 8 Git Diff: Showing Changes Between Commits/Staging Area & Working Directory
1. first modified t file
of same file as in case file name t
In other more technical words:
$ git diff compare the same file of working directory and stage directory/area
https://www.youtube.com/watch?v=1t56nLJJbMU&list=PLu0W_9lII9agwhy658ZPA0MTStKUJTWPi&index=10
$ git diff --staged
The above command will compare staged area file with commit(ed) area same corresponding files
Git: Skipping The Staging Area | Git Tutorials #9
https://www.youtube.com/watch?v=epGcuDu3z7k&list=PLu0W_9lII9agwhy658ZPA0MTStKUJTWPi&index=9
Any new file added in .git reposity/dir it UNTRACKED File
$ git add newfile will became TRACKED FILE Unmodifield
When we modify any Staged File status will be MODIFIED STAGED file
if we modify Commit (ed) file then it will be MODIFIED UNSTAGED file
All statuses will be apparantly seen on the screen messages of git no need to remember
$ git commit -a -m 'Commit by skipping stage area'
Note: above command will not commit the UNTRACKED Files
It will commit all the old TRACKED file. means if you modified old commit (ed)
1....many files all TRACKED file will be commit ed with one command
Instead of directly removing file in git repo you use
$ git rm <filename>
This command will send file in stage area,
$ git mv <filename> <newfilename>
This command will also send to stage area
Note: if you add commit (ed) file in .gitignore it will not be ignored utill and unless
you untracked it by command
$ git rm --cached <filename>
Note that this command will not remove the file physically. It will be removed only from
tracking by git. means Git will ignore it
Git Log: Viewing & Changing Commits In Git | Git Tutorials #11
https://www.youtube.com/watch?v=Hxn3OguEMd4&list=PLu0W_9lII9agwhy658ZPA0MTStKUJTWPi&index=11
Saeed Hassan Hisbani@sad MINGW64 ~
$ git clone https://github.com/panada/panada.git mypanda
Cloning into 'mypanda'...
remote: Enumerating objects: 4859, done.
remote: Total 4859 (delta 0), reused 0 (delta 0), pack-reused 4859
Receiving objects: 100% (4859/4859), 1.36 MiB | 240.00 KiB/s, done.
Resolving deltas: 100% (2456/2456), done.
Saeed Hassan Hisbani@sad MINGW64
$ git log
it also show add and removing lines
$ git log -p
$ git log --since=2.months
$ git log --since=2.years
$ git log --since=2.years
$ git log --format = <formattypes>
$ git commit --amend && it will open editor with first log entry
$ git commit --amend -m 'amend direclty'
Unstaging & Unmodifying Files In Git | Git Tutorials #12
https://www.youtube.com/watch?v=m08GSxWO1pQ&list=PLu0W_9lII9agwhy658ZPA0MTStKUJTWPi&index=12
To Discard changes before Stage a file (Note this not in video)
$ git restore <filename>
To restore file according to Last commit (ed)
$ git checkout -- <filename>
we run
$ git checkout -f
- Get link
- X
- Other Apps
Comments
Post a Comment