DevOps/Cloud By GK
  • DevOps/Cloud Introduction
  • 🚩AWS
    • Create AWS Account
    • Launch EC2 Instance
  • 🚩Linux
    • User Managment
      • Adding the User to Sudo group
      • visudo
    • Directory / File Management
      • Vi
      • Changing Permissions (chmod)
      • Filtering IO/File
    • Memory Management
    • Process Management
    • Network Management
    • Service Management
    • Environmental Variables
      • $PATH
    • Utilities
    • SHELL PROGRAMMING
      • Hello World
      • Variables
      • Command Line arguments
      • Conditional Statements
      • Array
      • Loops
      • Functions
      • AWK
      • sed
      • Example Useful Scripts
      • Basic -> Advanced
  • 🚩git
    • Introduction
    • Creating GitHub Account
    • Installation
      • Git Bash In Windows
      • Git In VS Code
      • Git In Eclipse
      • Git CLI in Linux
  • Creating Git Remote Repository
  • Git Commands L -> R
  • Git Commands L <- R
  • Git Branch Commands
  • Using SSH (Password Less)
  • 🚩maven
    • Introduction
    • Installation
    • POM.xml
    • Goals
  • 🚩SonarQube
    • Introduction
    • Sonar Cloud
    • Creating Project In SonarCloud
    • Installing Sonar-Scanner
    • Triggering Scan
  • 🚩Nexus
    • Introduction
    • Installation of Nexus
    • Creating Repository
    • Uploading Artifacts to Repository
  • 🚩Jenkins
    • Introduction
    • Installation of Jenkins
    • First Job In Jenkins
    • Git + Jenkins
      • WebHook
    • Maven + Jenkins
    • Sonar-Scanner + Jenkins
    • Nexus + Jenkins
Powered by GitBook
On this page
  • Initialize Git
  • git add
  • git status
  • git commit
  • git remote add origin
  • git push
  • git log

Git Commands L -> R

Type the following command to create a new directory for your repository:

mkdir my-new-repo

Change into the new directory:

cd my-new-repo

Initialize Git

git init

Now that your local repository has been created, you can add files, make changes, and commit them using Git. Once you have made some changes and committed them, you can push the changes to a remote repository.

git add

Add files to the staging area using the "git add" command. For example, to add all files in the current directory to the staging area, type:

git add .

git status

Display a summary of the current state of your repository, including any changes that have been made but not yet committed, any changes that have been staged for commit, and any untracked files.

git status

git commit

After making changes to your files and staging them with git add, you can commit your changes using the following command:

git commit -m "Updated file1.txt and file2.txt"

git remote add origin

command to add a remote repository named "origin"

git remote add origin <remote-repository-URL>git

git push

Push the changes to the remote repository using the "git push" command

git push origin main

git log

This command will display a list of all the commits in your repository, starting with the most recent commit

git log

PreviousCreating Git Remote RepositoryNextGit Commands L <- R

Last updated 2 years ago