0% found this document useful (0 votes)
15 views

Devops Commands (1)

Uploaded by

santhosh G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Devops Commands (1)

Uploaded by

santhosh G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

GITHUB COMMANDS

ls -la List hidden files


ls - lrta List hidden files with the timestamp
in reverse order

git init Initialize git, create local repository,


worling directory and create .git
folder
git add filename Track the untracked file
git status To check file status
git rm -- cached <file> Remove cache from stagging area to
working directory
git config --global user.name {“your To set username to identify who
name”} made changes.
git commit(save) –m “my first commit” Move file from staging area to local
repo
git commit -am Commit the latest changes without
using add command every time after
time used add command
git log To check log
Git log --oneline Show log in oneline
git remote add origin <github Url> Adding remote system(physical
system) github url
git push –u origin master Push files from git to github
git branch To check no of branches
git branch <dev> Creating new branch
git branch -d <dev> Deleting a branch locally
git checkout <master> Moving from one branch to another
git merge <dev> Merge feature branch with master
branch
git config --global core.editor vim Tools used to resolve merge
conflicts{to solve conflict we must
be in master branch}
git config --global core.compression 2
git config --global diff.tool vimdiff3
diffg <RE,LO,BA> To select which screen is needed
among three
:wqa Write and quit all tabs
git rebase To avoid merge conflicts and used
to upload both files which is correct
and which was created by diff
person for same task.{to perform
rebase we must be in feature
branch }
git cherry-pick <commit-ID> Picking specific commit from one
branch to another
git stash Uncommitted files are stored in
temporary storage
git stash list To view stashed file
git stash apply To recover the stashed file from
temp storage
git fetch download commit from remote repo
to local system.
git pull download and update the commits
from remote repo to local system
git clone <repo https URL> copy whole repo within same
system
git fork Copy whole repo between different
github account
git branch –m <old -name> <new Rename the branch
name>
git reset --hard <commit id> Move the header point to repected
commit (like undo)
git reset --soft <commit id> Move the file from commit area to
staging area(reverse the process of
git)
git bisect To find bug in an commit and solve
git bisect start it
git bisect bad<commit id >
git bisect good<commit id >
ps –ef | grep jenkins To find port number of jenkins
apt-get install docker.io To install docker
docker images Shows all images in a docker
docker pull httpd Pull docker image from dockerhub
to local ec2
docker run –itd --name apache1 –p To create docker container
”8010:80” <image name> {httpd} (itd
 interactive terminal detach mode)
docker ps Shows running container
docker ps -a Shows all container including
stopped one
Docker exec –it <container id> To enter into container
/bin/bash
docker stop <container id> To stop a container
docker start <container id> To start a container
ps –ef | grep <port no> Ist is used to check whether any
container are running on specified
port
docker commit <container id> <any To convert running container to an
image name> image
Docker built –t <image name> <path Used to built image from written
name> docker file {not as previously
default image pull from dockerhub}
docker rm –f <container id> Used to delete a container

You might also like