#gittutorial #git #github #githubtutorial #beginners
Lec-01 This is first lecture on Git in this series.in this lecture,i describe all the concept related to git,why we need git,what is distributed management system,what is source code management,how DCVS is different from CVCS.This tutorial will let you know all about Version Control System & Version Control Tools like Git advantages of git ,#command ,What is Git Three Stages
Git & GitHub:
what is Git?
Git is a version control system that helps you keep track of changes made to your code over time.
It allows you to collaborate with others on a project, keep track of different versions of your code, and easily revert to previous versions if needed.
what is GitHub?
GitHub is a website that allows you to store your code online and collaborate with others. It uses Git as its version control system, so you can keep track of changes made to your code over time, work with others on the same codebase, and easily share your code with the world.
Why it is important?
Tracking the changes and updates. We can see who made which changes. Git also provides when and why a change was made.
Allowing them to work collaboratively. Software development projects usually require many people to work together. Git provides developers with a systematic way of doing that. Thus, the developers focus on the project instead of extensive communication sessions between the other developers.
Git Three Stages
Let us see the basic workflow of Git.
Step 1 − You modify a file from the working directory.
Step 2 − You add these files to the staging area.
Step 3 − You perform commit operation that moves the files from the staging area. After push operation, it stores the changes permanently to the Git repository.
Image preview
Git Command
Repository meaning is a simple folder
so firstly you install git
You can check the current version of git with git --version command.
git --version
git init
git version 2.34.1
The Git config the command is super helpful. Especially when you are using Git for the first time, or you have a new Git installation. This command will set up your identity - Name and Email address. And this information will be used with every commit.
git config --global user.name "Dev_Safia"
git config --global user.email "[email protected]"
git config list the command will show all Git config properties
git config --list
user.name=Dev Safia
[email protected]
mkdir git_tut_devops_batch
cd git_tut_devops_batch/
mkdir project{1..3}
project1 project2 project3
cd project1/
This is probably the first command you use to start a new project in Git. This command will create a blank new repository, and then you can store your source code inside this repo.
git init
ls -a
. .. .git
vim safia.txt
one thing is very important your repo is not blank otherwise it is not added and committed.
Git status is one of the important git commands.
Mainly git status shows
Your current branch.
List of files that are committed or pending changes.
git status
git add the command will be used to add new files to the staging area.
git add safia.txt (it will add a single file to your staging area)
git add * ( this option will add all the modified and new files to the staging area)
the git commit will add your changes to your local repository.
git commit -m "commit this file"
delete this file
rm -rf safia.txt
git status
and again restore the file in this case one thing is proven when you delete something then you retrieved again this thing with the help of the git restore command
Note: one question in my mind I delete without staging the file and then can retrieve the file so the answer is no u can't
git restore safia.txt
git log the command helps you to see all previous commit messages.
git log
git log --all
View only one line changes. It helps to have a quick look at previous commits.
git log --one line
You can view all differences of changes of each commit with -p option
git log -p
step 1: And now you create a repo in GitHub
Safia blog
step 2: and then create your local same as
mkdir safia_blog
step 3: and again go to your GitHub and copy the HTTPS code
git clone https://github.com/Safiakhatoon767/sa...
ls
safia_blog
cd safia_blog/
If you like this video please like, share & subscribe to my channel to see more such videos.
🔹 SOCIAL NETWORKS - Connect With DevSafia!
-------------------------------
Github 👩💻
https://github.com/Safiakhatoon767
Linkdln 🔗
/ safia-khatoon-devops
Gmail📩
[email protected]
NOTES : https://safiakhatoon.hashnode.dev/git...
-------------------------------
---------------------------------------------------------