Skip to main content

how to Git the GitHub ?

 

type of source code management?

local repo

remote repo

architecture of scm?

distributed  architecture ( all users will have a local repo in their local pc  and one as centrala  repo othe n cloud (github,GitLab, bitbucket )


how to install git in Linux ?

redhat/cent os /aws linx

yum install git -y

ubuntu :

apt-get install git -y


how to configure the git profile?

git config --global user.name "coss"

git config --global user.email "[email protected]"


how to create a git repository for a regular folder ?

git init <--

it will create .git folder to track create/modify activity in the folder


stages of git repo ?

3 stages 

working area

stage area

local repository DB

Git Status Terminology :

untrack files : ( working area)

to be committed (  staging area )


how to check stages?

git status 


how to add files from wthe orking area to staging area?

git add  . or git add file1


how to commit (save) to git repo db ?

git commit -m "first"


how to check git repo commits and who did,when ?

git  log <--


how to check commits files in the repo ?

git show commit-id<--

create repository in git hub  

login to GitHub , create a repository , give  name " go-pro1" select public  , create 


how to add the github repository urlURL into local git ? 


(on local git)

git remote add variable-name https://github.com/4linux/DevOpsLab-HelloWorld.git

how to push the latest version local db git commits to the GitHub repo "go-pro1"

git push -u origin master <--


how to see the remote repository URL url added to git?

git remote -v  <--

how to delete the remote repository URL from git?

git remote rm origin


why tag?

friendly name for commit id 


how assign a tag to commit -d ?

git tag -a login  -m "login page" commit-id

syntax : git -d tagname , Example : git -d login <--


what revert in git ? 

to undo from commit

git revert commit-id <--


is it possible to restore or undo the stage?

yes,

git restore --staged file 


is it possible to undo a commit 

git revert last-commit-id 

  give message for commit "sorry" :wq


what is fork in github ?

its a like clone from other github to my hub acccount but not git 


what pull ?

pull latest contents from remote do update into wd and commit

git pull url 


what is clone ?

git clone remote url 

it will copy exact all remote repository to local new repo with the same name 


what is branch ?

seperate workspace to perform seperate task for each feature or practice 

ex:

  master:(project)

        home page -- commit 

            login  --- commit 

               patch -- commit 


how to create branch?

git branch bname

git branch<== to check list

git checkout bname <-- switch to another branch

note: when u create branch from master , it will create with all contents/commit of master


how to delete a branch?

git branch -d bname <--


how to merge one branch to another branch?

master : git merge login


how to create regular common commands as scripts to execute all at a time?

vi push.sh

git add .

git commit -m "message"

git push -u origin master 

:wq 

./push.sh


Comments

Popular posts from this blog

My Life as Information security engineer Chapter 1: Tools

  Hi folks, here I am going to share the tools list that I am using in my daily life cycle. NMAP  Nmap (“Network Mapper”) is a free and open-source (license) utility for network discovery and security auditing. Basically, I will use it to discover the open ports and closed ports where I did Port Mapping in firewalls. We can use this in the local network as well as in the WAN network. Also with help of the NSE script, we do multiple things like vulnerability check, exploitation, etc., Ref: http://www.piratesshield.com/2017/11/nmap-network-mapper-securtiy-scanner.html CURL and WGET curl   is a tool to transfer data from or to a server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or FILE). Normally using this tool to analyze the website headers when my web security device blocking some dynamic content websites and to create the Application signature in IPS. Wget   using to download files directly instead of opening and surfing the brow

AquaSec Container Security Solution ( DevSecOps ) - A quickView

  What is AquaSec?      The Aqua Platform is the leading Cloud Native Application Protection Platform (CNAPP) and provides prevention, detection, and response automation across the entire application lifecycle to secure the supply chain, secure cloud infrastructure, and secure running workloads wherever they are deployed.    Solutions : Cloud Native Security Platform CSPM Cloud Security Container Security Kubernetes Security Serverless Security Cloud VM Security Dynamic Threat Analysis (DTA) Container Vulnerability Scanning Aquasec offers a 14days trial to learn the container security / Automated DevSecOps. Use this link to get free trail  Sign In | Aqua (aquasec.com)   How to start with AquaSec? Once login into the portal click the nine dots in the left-side top > Aqua Hub  Then click the "Integrations" The Integration page has a lot of options to connect your container Platform Choosing your platform provides the required key to integrate. (follow the OEM documents ) The

Learn DevOps like a pro techie - PART 1

       Usually, all DevOps trainers advise you to set up the LAB environment on cloud platforms (AWS, Azure, GCP, etc). But if you understand the technologies you can set it up easily on your super PC.   PC REQUIREMENTS : (WARNING!) Processor      :  > = i3 (10th or 11th Gen)  RAM              :  8GB (minimum) Storage          :  SSD preferred TIPS: If you using win11 or win10 and performance is very slow means use the below script. Windows 11 only:  https://github.com/builtbybel/ThisIsWin11 Windows 10 only:  https://github.com/builtbybel/bloatbox The LAB mainly depends on the docker platform. So First, start learning the basics of Docker. Docker Basics:  https://www.tutorialspoint.com/docker/index.htm KNOWLEDGE REQUIRED - Linux Knowledge (5/10) (installation of apps, editing scripts, user privileges, and troubleshooting)  - Web Development (3/10) -  Google Search and Stackoverflow (9/10)....... he he he......... UTILITY TOOLS AND PRE-REQUISITES   - Install Window Terminal Preview