Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

useful git commands

#git initialization ==>
git init // initialize the folder to git

#git stagging commands  ==>
//stagges every thing
git add --all 

//stagges every thing as well
git add -A 

//stagges every thing as well 
git add . **best practice**

// stagges only the directory file
git add to/the/directry.exemple 

// stagges every thing with the extension .js
git add * .js  

// show changes of files and files which are stagged
git status 

// to rollback from the stagging 
git reset

// to rollback from the stagging with deleted files
git reset --hard

#git commiting commands ==>
//to commit changes (comments are highly recommended) 
git commit -m 'comment as you want'

// to rollback from commit
git reset HEAD~

//to get back to a commit 
git checkout {hash-code} 
(to check the hash code type git log --oneline) 
Exp: git checkout 59f733b

// to get a single file
git checkout {hash-code} to/the/directry.extension
(to check the hash code type git log --oneline) 
Exp: git checkout 59f733b script.js

#git branching ==>
// info of branches 
git branch

//creat new branch
git branch {name}
Exp: git branch secondry

//to switch branc
git checkout {branch name}
Exp: git checkout secondry

//merge the branch where you are with other one
git merge {branch name} -m 'comment'


#git remote version controlling ==>
//to add origin to the git
git remote add origin {link}

//to clone a repository
git clone origin {branch name}

//push changes 
git push origin {branch name}

//pull a branch
git pull origin {branch name}
Comment

PREVIOUS NEXT
Code Example
Shell :: ts-node not found 
Shell :: color logging python 
Shell :: linux path environment variable 
Shell :: composer change version 
Shell :: Unable to find a valid SQLite command 
Shell :: install choco windows 10 
Shell :: conda install numba 
Shell :: Replace git master with another branch 
Shell :: ionic publish 
Shell :: file descriptor bash 
Shell :: how to run makefile in windows 
Shell :: problem detected port 80 in use by unable to open process with pid 4 
Shell :: how to setup dockers on aws 
Shell :: docker: Error response from daemon: pull access denied for 
Shell :: run flake8 
Shell :: button click event powershell 
Shell :: git diff show only files 
Shell :: npm websocket 
Shell :: sublime linux 
Shell :: install virtualbox on ubuntu 
Shell :: copy all files from a folder to another ubuntu 
Shell :: command not found: yarn 
Shell :: find home dir for user 
Shell :: how to make a shell in c for beginners 
Shell :: chown specific user linux 
Shell :: bash for each line of file 
Shell :: add to a github repo 
Shell :: openssh client ubuntu 
Shell :: how toinstall npm on manjaro 
Shell :: multiple kubeconfig in one file 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =