Git Commands for Quick Reference

Git Commands for Quick Reference

mkdir repos

cd ~/repos

git clone https://emmap1@bitbucket.org/emmap1/bitbucketstationlocations.git 

if you get error ( git config --global core.askpass)
git pull --all

git clone https://emmap1@bitbucket.org/emmap1/bitbucketstationlocations.git 


cd ~/repos/oracle/
git branch dr-db
git checkout dr-db
git status
git add main.tf
git add variables.tf
git add . (to add entire current directory files)
git commit main.tf  -m "message goes here v1"
git commit variables.tf  -m " message goes here v2"
git commit -m  " all commit at once v2" 
cd ~/repos/bitbucketstationlocations/
git status 
To switch to main branch
git checkout main 
git merge dr-db
To delete local dr-db branch
git branch -d dr-db
git status
To push the local repo to central repo
git push origin main


References: https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud

No comments: