• Home
  • WordPress
  • web Hosting
    • Free hosting
    • Cheap Hosting
    • comparison cloud , vps, shared, wordpress
    • managed wordpress hosting
    • managed cloud hosting
  • page Speed
  • Deals
  • Services
  • About

RAaz Kumar .com

wordpress tutorials seo hosting etc


git commands

why git –

for managing code
– tracking history
– maintaing and managing source code (java, .net application)
– any text file can also be tracked

vendors – code hosting platforms (github, gitlab, bitbucket)

repository – The code of of our project is stored in the repository

 

working area —- it’s your project folder

staging/index —- git add filename ( you need to satge the changes befor comitting those changes)

local repo —– git commit -m “created file”

Remote Repo —– git push
username: becomedevops
password: token

git clone https://github.com/BecomeDevops/tryfail.git
863 ls
864 ls -lrt
865 cd tryfail
866 ls
867 touch test
868 git status
869 git add .
870 git status
871 git branch
872 git commit -m “created test file”
873 git status
874 git branch
875 git status
876 ls
877 git push
878 git status
879 ls
880 vi log
881 git add .
882 git status
883 git status
884 git rm –cached log
885 git status
886 ls
887 git clean -n
888 git clean -f
889 git status
890 ls
891 ls
892 git status
893 touch index
894 vi ndex
895 git status
896 ls
897 git add .
898 git status
899 git commit -m “index files”
900 git log –oneline –all
901 git log –oneline –all –graph
902 LS
903 ls
904 git reset –soft HEAD~1 – this will undo the commit in local repository but its available in staging area and working directory
905 GIT STATUS
906 git status
907 git log –oneline –all –graph
908 ls
909 touch ec2
910 ls
911 git status
912 git rm –cached index ndex
913 git status
914 git add .
915 git status
916 git commit -m “added ec2, index, ndex”
917 git status
918 git log –oneline –graph –all
919 git reset –hard HEAD~1 -> this will undo the commit from local repo, staging area and working fdirectory
920 git log –oneline –graph –all

sample git with example

git add .

files will be added to staging are

git commit -m “COMMIT msg”

files will be added to local repository

git push

files will be moved to remote repository

To create a branch

git branch branchname

to checkout the code to the branch
#
git checkout branch_name

————————–

git checkout -b branchname

—————————
mkdir azure
cd azure
————————-
to initialize git repository from local

git init
touch file2 fil3
git add .

git commit -m “SOME message”

git remote add origin https://github.com/BecomeDevops/azure.git

git push

what is git

—-> git is a version control system

track history
work together
it is centralized

why git

—-> using git we can record changes and keep the track of files

benefits over git

free
open source
scalable
efficeint

we can revert back to previous file or previous version of the project

version control can track not only source code but also track any plain text file

time machine for your project
——————————————–

commited

modified

staged —

working dir, staging area(index), git dir (repository)

uncommited changes are present in our working directory

staging area – files in this state have been modified and added to be staged in next commit

using the command line
—————————
—————————

install git on windows, linux

configure git
initialize a new git project

code hosting provider

create an account

push our git project to a code
hosting provider

commit changes from index

——————————
install git
configure git
git help

initialize a new git repository

push you code to cod hosting provider
——————————
Every day git commands

by deafulat git has a master/main branch
usually in git a branch is created towork on a new feature

once the feature is deeloped, it is merged backto mastera and the bRANCH IS DELETED

commit
——–

A commit is also names by SHA1 hash
Every commit object has a pointer to the parent commit object
from a given commit, you can traverse back by looking at the parent pointer to view the history of the commit

if a commit has multiple parent commits, then the multiple parent commit has been created by merging two branches

Head — Head is a pointer, which always points to latest commit in the branch, whenever you make a commit, head is updated with the latest commit.

The heads of the branches are stored in
.git/refs/heads/ directory

ls -l .git/refs/heads/

cat .git/refs/heads/master

 

 

 

Branch

__________
every branch is referenced by HEAD, which points to latest commit in the branch. whenever you make a commit, HEAD is updated with the latest commit
———————————

 

git reset —->

managing history

exploring the past

fixing mistakes

git workflows
– finding your workflow

cli – most of the time
gui will implement some common scenarios

four areas of git
——————–
——————–
stash area
working area
index/staging – before commit

Repository
—————————
working area — edit files
add files
—————–
ls -a
ls .git/

git objects
———–
commit tree blob

commit – immutable

they can be created/deleted cannot modified

commit – snapshot of working area

each commmit to its parent commit

each commit is a snapshot

commits are slice of project history

commits are linked together to form a history

commit can belong to multiple branches

HEAD and the current commit

Head points to current branch and that branch points to current commit

deleting branch will delete its commits

workking area -> index(staging) -> repsitory
git status

ls .git/ –> index(transition area)

git status
———-
git diff -comparing working are and index

compare index with repository — git diff –cached

how does this command move information across the four areas

how does this command change the repository

git workflows commands

———————–

git diff –cached
——————

checkout

removing files in git

how to remove files for index/staging

git rm filename
git rm –cached filename
this will undo from the staging but not from
the working directory
——————–
git reset

reset does different things in different contexts

commands that move branches

commit
merge
rebase
pull – gets new commits from repo
————————-

HEAD -> MASTER

head can point to the master
git reset –hard

reset – moves the to a specific commit

git reset –hard (copies commit from repo to working area and index)

git reset –mixed ( copies commits from repo to the index)

git reset –soft(moves the branches)

reset moves the current branch and optionally copies data from the repository to the other areas

git reset –hard fbe356
git moves the current branch to the previous commit
———————–
i want to undo index

git rm –cached
–> git reset HEAD –>
git reset –hard HEAD

stashing data
solving conflicts
working with paths
commiting parts of a file

stash—– git stash

the data is stash doesnt change unless you do want to

git stash –include-untracked

git stash list- store some stuff

each element gets labelelled

stash@{0}
git stash apply

from stash to working dir

git add

git stash list

git stash clear
git stash list

—————–
merge conflicts

git branch one
git checkout one

git checkout master
git merge one

git status

ls .git
cat .git/MERGE_HEAD
git show commitid
git merger origin/master

Related topics:

  1. git branches merge fetch pull conflicts
  2. push notification add to android sdk (draft) one signal /firebase
  3. linux commands pdf (files & Directories, zip & unzip process, search etc)
  4. Top 10 zip / tar commands to compress & extract files in linux
  5. Top 10 most used Cat commands with examples (create, view, append files)

tutorials

  • Vivek Bindra Videos Transcription (business strategy)
  • git commands
    • git branches merge fetch pull conflicts
  • new relic php agent install in 3 steps
  • new relic mysql install integration - 2 ways fix problems
  • new relic installation linux (infrastructure agent , php, mysql , nginx)
  • xampp tutorials 2021 installation errors fix wordpress phpmyadmin mysql apache
  • Redis performance metrics & tuning for nginx apache ubuntu & debian
  • Devops course Syllabus topics PDF AWS, Azure, cisco, redhat
  • CCNA Syllabus pdf (CCNA / CCNP vs devops vs mcsa /MCSE)
  • how to create a website free of cost on google
  • what is vpn vs proxy vs tor, http vs https, http2, tcp vs udp, kali linux sql source code injection
  • nginx server tutorials (installation, configuration, performance tuning, security)
  • MySQL Tutorial (create,connect database, update tables, export etc) Documentation & TIPS
  • AUdio Editing Background Noise removal (Audacity, Adobe Premiere Addition, Camtasia Filmora Windows Obs)
  • Android Studio tutorials syllabus Topics Course details #AndroidApplicationDevelopment
  • [INTRO] Ethical hacking / cyber Security / Penetration testing Tutorial -{updates frequently}
  • redis install ubuntu 20.04 with wordpress php redis mysql configuration
  • ubuntu tutorials installation download issues etc
  • Php tutorials
  • HTML & CSS Tutorials
  • Core Java Tutorial Free online
  • Linux sysadmin tutorials linux system administrator
  • apache server tutorial (install,config, performance tuning, security, error handling)

 

 

wordpress Pagespeed optimization

Digitalocean free $100 Credit

Cloudways Review pricing promo codes

Siteground cpu limits Pricing

Shared Hosting

Managed wordpress Hosting

Managed Hosting Cloud server

VPS Hosting

Cloud Hosting – Unmanaged

Google cloud Pricing

Aws Pricing

Azure pricing

nginx server tutorials

apache server tutorials

linux sysadmin tutorials

mysql Commands list pdf

LEMP Install Ubuntu

Mysql Performance Tuning

Nginx Performance tuning

Linux Performance tuning

Php -fpm performance tuning

Redis Performance tuning

linux server security

nginx security best practices

wordpress security plugins

 

 

wordpress

 

Top 5  WP Google Analytics Plugins

WP Backup Plugins

Wp Comment Plugins

Top wordpress Security Plugins

WP Seo Plugins

WP Caching Plugins

Best Adsense Plugins for WordPress

Wp social Sharing Plugins

autoshare social media plugins

WP speed Optimization Plugins

Speedup WordPress google Score

More Wp tuts

Server Admin Cloud

 

Installing Nginx LEMP On ubuntu

Installing apache Lamp ubuntu

nginx fastcgi cache enable

php – fpm install  & Configuration

Opcache install & Configure

php -fpm pool manager explained

Mysql Install & Configuration

Redis Object cache install & configure

 

Nginx as Reverse Proxy and Load balancer

Load Balance / auto scaling in google cloud

Linux Commands PDF

Mysql Commands Pdf

Letsencrypt tutorial

mysqldump export & import 

Pagespeed Module install & configure

nginx.conf best file

mysql.conf best file

upgrade ubuntu

© 2023 - All Rights Reserved Disclaimer & Privacy Policy