Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git cheatsheet

git code .                                //Open vs code
git status                                //Show file status
git status -s                             //show short file status
git add <filename>                        //Add the particular file to staging area
git add .                                  //Add all the file to the staging area
git commit --amend                        //Add these changes to the last commit (will have to use vim editor)
git commit -m "message"                   //Commit the files in the staging area    
git commit -am "message"                  //Will commit without adding the file to the staging area
git checkout --<filename>                 //will restore the file from the last commit
git checkout -f                           //All the files will be replaced with last commit
git checkout -b <branch name> 		   	  //Create a branch
git branch 								//To see the branches
git branch -d <branch name>				//To delete a branch
git branch -v 							//will show the branch and its last commit
git branch --merged 					//will show the branches that are merged
git branch --no-merged 					//will show the branches that are not merged
git merge <branch name>					//while in a branch you can merge another branch
git log                                   //Show all the commits
git log -n                                //n can be replaced by any number "will show last n commits"
git log -p                                //Will show detailed discription of the commits  
git log -p -n                             //use of n is similar as described above  
git log --stat                            //will show short detailing of the commits  
git log --stat -n                         //use of n is similar as described above    
git log --since=n.days                    //commit of last n days/weeks/months "days can be replaced by weeks,months"
git rm --cached <filename>                //will remove to file from the tracking area 
git rm -rf                                //will uninitialized the current repository              
git rm <filename>                         //will delete the file  
git mv <Present filename> <The filename after the change>  //to Rename the file
git clone <URL>                           //Cloning a repository in the current folder
git clone <URL> foldername                //Cloning the repository in the given folder name (Folder will be created by itself) 
git config --global alias. <new name> 'old command'  //while create an alias command for the given command
git remote 						//Show all the name of remote repository
git remote -v 					//Show all the path (fetch/push) of the remote repository
git remote add <name> url			//Add a remote repository
git remote rm <name>				//To remove a remote
git push <remote name> <branch name>	//To push a branch to remote repository
git push <remote name> <branch name>:<branch name you want to have in the remote repository>
git reset HEAD						//To move to a previous commit



More commands can be found on this website
//website https://git-scm.com/docs/git-log
Comment

git cheat sheet

# Download this pdf from Atlassian.com

https://www.atlassian.com/dam/jcr:e7e22f25-bba2-4ef1-a197-53f46b6df4a5/SWTM-2088_Atlassian-Git-Cheatsheet.pdf
Comment

git cheat sheet

git remote add upstream git@bitbucket.org:some-gatekeeper-maintainer/some-project.git
Comment

git commands cheat sheet

What is git cheat sheet?
The git cheat sheet is a concise, easy-to-read document for quickly learning how to use some of the most popular and useful commands in the Git environment. It’s designed for beginners who are new to Git and have little or no prior experience with it.

Most Common GIT Commands
A git command cheat sheet is a document that lists the most commonly used commands and their corresponding syntax.
The following is a list of git commands with syntax:

-git add -A
-git commit -m “commit message”
-git push origin master
-git pull origin master
-git clone {URL of git repository}
Comment

git cheat sheet

git remote -v

origin  git@bitbucket.org:my-user/some-project.git (fetch)
origin  git@bitbucket.org:my-user/some-project.git (push)
Comment

git cheat sheet

git checkout main
git merge upstream/main
Comment

git cheat sheet

git remote -v

origin    git@bitbucket.org:my-user/some-project.git (fetch)
origin    git@bitbucket.org:my-user/some-project.git (push)
upstream  git@bitbucket.org:some-gatekeeper-maintainer/some-project.git (fetch)
upstream  git@bitbucket.org:some-gatekeeper-maintainer/some-project.git (push)
Comment

git cheatsheet

git code .                                //Open vs code
git status                                //Show file status
git status -s                             //show short file status
git add <filename>                        //Add the particular file to staging area
git add .                                  //Add all the file to the staging area
git commit --amend                        //Add these changes to the last commit (will have to use vim editor)
git commit -m "message"                   //Commit the files in the staging area    
git commit -am "message"                  //Will commit without adding the file to the staging area
git checkout --<filename>                 //will restore the file from the last commit
git checkout -f                           //All the files will be replaced with last commit
git checkout -b <branch name> 		   	  //Create a branch
git branch 								//To see the branches
git branch -d <branch name>				//To delete a branch
git branch -v 							//will show the branch and its last commit
git branch --merged 					//will show the branches that are merged
git branch --no-merged 					//will show the branches that are not merged
git merge <branch name>					//while in a branch you can merge another branch
git log                                   //Show all the commits
git log -n                                //n can be replaced by any number "will show last n commits"
git log -p                                //Will show detailed discription of the commits  
git log -p -n                             //use of n is similar as described above  
git log --stat                            //will show short detailing of the commits  
git log --stat -n                         //use of n is similar as described above    
git log --since=n.days                    //commit of last n days/weeks/months "days can be replaced by weeks,months"
git rm --cached <filename>                //will remove to file from the tracking area 
git rm -rf                                //will uninitialized the current repository              
git rm <filename>                         //will delete the file  
git mv <Present filename> <The filename after the change>  //to Rename the file
git clone <URL>                           //Cloning a repository in the current folder
git clone <URL> foldername                //Cloning the repository in the given folder name (Folder will be created by itself) 
git config --global alias. <new name> 'old command'  //while create an alias command for the given command
git remote 						//Show all the name of remote repository
git remote -v 					//Show all the path (fetch/push) of the remote repository
git remote add <name> url			//Add a remote repository
git remote rm <name>				//To remove a remote
git push <remote name> <branch name>	//To push a branch to remote repository
git push <remote name> <branch name>:<branch name you want to have in the remote repository>
git reset HEAD						//To move to a previous commit



More commands can be found on this website
//website https://git-scm.com/docs/git-log

git push
git pull
git branch
git commit -m "message"
git clone
git init
git checkout
git remote add
git status
git diff
git rebase
Comment

PREVIOUS NEXT
Code Example
Shell :: set email git 
Shell :: git untrack 
Shell :: check network interface linux 
Shell :: how to use dotenv in javascript 
Shell :: linux go to home directory 
Shell :: delete ppa repository ubuntu 
Shell :: ubuntu install times new roman font 
Shell :: android studio (not installed) flutter ubuntu 
Shell :: environment variables with react and github pages 
Shell :: remove permission denied file folder linux 
Shell :: how to add a gif to your website 
Shell :: error failed to commit transaction (failed to retrieve some files) 
Shell :: pesquisar commit git 
Shell :: ubuntu terminal network monitor 
Shell :: gitignore node_modules 
Shell :: ubuntu 20 lts install node 10 
Shell :: mac update path permanently 
Shell :: convert master to main 
Shell :: CMake Error: Could not find CMAKE_ROOT !!! 
Shell :: jupyter python downkload 
Shell :: wsl home folder location 
Shell :: powershell on linux 
Shell :: how to install sublime text arch linux 
Shell :: gitignore tracked files 
Shell :: read last line file bash 
Shell :: git change commit id email 
Shell :: net start docker service 
Shell :: grant superuser permission to sudo user ubuntu 
Shell :: terraform script to create s3 bucket 
Shell :: linux shell echo command with varia ble 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =