DevOps session 13: Automate git SETUP using bash scripting.

Image
  Bash scripting: A Bash Shell Script is a plain text file containing a set of various commands that we usually type in the command line. It is used to automate repetitive tasks on Linux filesystem. It might include a set of commands, or a single command. For example ,to install GIT we need to update the packages, then install git and check if installation is done using Linux commands. We can write all the command in a .sh file and we can execute the file to do all the steps mentioned above. Lets start with example from hello-world. 1.Open terminal and check the root of the bash using below command. CMD: which bash you can see path like  /usr/bin/bash or /bin/bash . 2.Create a hello-world.sh file and paste the below lines. CMD: nano hello-world.sh You can see editor ,add below lines #!/bin/bash # declare MSG variable MSG="Hello World" # print variable on a screen echo $MSG To save the file use CTRL+X, then CTRL+Y and press ENTER 3. To execute the file we need to ad...

DevOps session 8: Create GitHub account & Setup repo

 




Create GitHub account: 

1.Open GitHub site(https://github.com) in chrome and click on signup.




2.Privide email id


3.Create new password



4.set ne username which is should be unique and then click on continue.


5. You will receive a code to the mail id you provided above. Provide the code and click on create account.


6. Once code is validated. GitHub will ask some questions. Answer and submit.

You are successfully created the GitHub account. Now you can see a customized dashboard page.

GIT local repo setup:

1. Create a Folder with your project (eg: GitDemo)

2. open command prompt and navigate to project folder created above.

3. Use git init command to initialize local repo.(all changes you are working will be saved in .git file)

4. First time when you want to get the GitHub code ,we have to use git clone command. 

example : I want to get the fresh code on the new system. then I need to follow above steps and then I need to use git clone command.



Copy the https link provide from code repo. and then provide the below command in cmd.

syntax : git clone https://github.com/NAVEENINTEL/ruby-selenium.git

You can observe ,all the code from GitHub will be copied to your local system.

5. Now you can make updates to the code. All the changes will be available to your local repo. Your central repo will not be updated with latest code with out pushing the code.


Will continue....

Comments

Popular posts from this blog

DevOps session 10: Git basic commands for daily use

DevOps session 7: Source Code Management/ Version control systems (GIT) || Setup Git on ubuntu

DevOps session 11: Git branching & best practices