56 ‐ DevOps ‐ Basic Git Commands and Converting Folder to Repo - SanjeevOCI/Ocidocs GitHub Wiki
git --version
git init
Now this folder has become a GIT repository. The files cannot be edited.
ls -lrhta
git status
git add .
git status
git commit -m "Script to create instance through terraform"
git config --global user.email "[email protected]"
git config --global user.name "Sanjeev"
git commit -m "Script to create instance through terraform"
git status
vi Bastion_server_1.tf
git status
git add Bastion_server_1.tf
git status
git commit -m "Script to create instance through terraform"
git status
git log --graph --oneline --all
Creating a Remote Repository in Oracle Cloud and connect with local
Copy the format for the host entry and create a config file in local
Host devops.scmservice.*.oci.oraclecloud.com
User [email protected]@sanjeevthakur76
IdentityFile <PathToYourSSHPrivateKey>
mkdir .ssh
vi config
cat config
Go to .ssh folder and create Private & Public Key
cd .ssh
ssh-keygen -t rsa -f $HOME/Test_Folder/.ssh/id-rsa -C '[email protected]'
ssh-keygen -f ~/Test_Folder/.ssh/id-rsa.pub -e -m pkcs8
Copy the public key using ALT-CTRL and use it to generate the API key as shown below
Now, we can use the above generated API Key to access the Remote Repository in Oracle Cloud from the local folder.
Go to the Devops Project --> Code Repository
The above config file will use the id_rsa file to connect to the Remote repository