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 "coss@gmail.com"


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

KARMA - Search for leaked Emails and Passwords

Hi Everyone, In this article we going to introduce the tool is KARMA.Its used to collect pwned Email address and passwords from pwndb. The tool is written in python3. So, you must need Python3 inside your machine . INSTALL sudo apt install tor python3 python3-pip git clone https :// github . com / decoxviii / karma . git ; cd karma sudo -H pip3 install -r requirements.txt python3 bin/karma.py --help TEST All the tests were done in  Debian/Ubuntu . Search emails with the password:  123456789 python3 bin/karma.py search '123456789' --password -o test1 Search emails with the local-part:  johndoe python3 bin/karma.py search 'johndoe' --local-part -o test2 Search emails with the domain:  hotmail . com python3 bin/karma.py search ' hotmail . com ' --domain -o test3 Search email password:  johndoe@unknown.com python3 bin/karma.py target 'johndoe@unknown.com' -o test4 DEMO VIDEO