56 ‐ DevOps ‐ Basic Git Commands and Converting Folder to Repo - SanjeevOCI/Ocidocs GitHub Wiki

56_Devops_1

56_Devops_2

git --version
git init

56_Devops_3

Now this folder has become a GIT repository. The files cannot be edited.

ls -lrhta

56_Devops_4

git status

56_Devops_5

git add .
git status

56_Devops_6

git commit -m "Script to create instance through terraform"

56_Devops_7

git config --global user.email "[email protected]"
git config --global user.name "Sanjeev"
git commit -m "Script to create instance through terraform"

56_Devops_8

git status

56_Devops_9

vi Bastion_server_1.tf

56_Devops_10

56_Devops_11

git status

56_Devops_12

git add Bastion_server_1.tf
git status

56_Devops_13

git commit -m "Script to create instance through terraform"
git status

56_Devops_14

git log --graph --oneline --all

56_Devops_15

Creating a Remote Repository in Oracle Cloud and connect with local

56_Devops_20

56_Devops_21

56_Devops_22

56_Devops_23

56_Devops_24

56_Devops_25

56_Devops_26

56_Devops_27

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

56_Devops_28

vi config

56_Devops_29

56_Devops_30

cat config

56_Devops_31

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]'

56_Devops_32

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

56_Devops_33

56_Devops_34

56_Devops_35

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

56_Devops_36

56_Devops_37

56_Devops_38

56_Devops_39

56_Devops_40

56_Devops_41

56_Devops_42

56_Devops_43

56_Devops_44

56_Devops_45

The above config file will use the id_rsa file to connect to the Remote repository

56_Devops_46

56_Devops_47

56_Devops_48

56_Devops_49

56_Devops_50