Git Topics
- Initializing a Git Repository
- Creating a New Branch
- Initializing a Local Git Repository
- Adding and Committing Changes
- Adding Files to Staging Area
- Committing Changes to Local Repository
- Creating and Managing Branches
- Switching to a Newly Created Branch
- Creating and Renaming Branches
- Connecting to Remote Repositories
- Adding a Remote Repository
- Pushing Changes to Remote Repositories
- Git Configuration
- Setting User Information
- Global Configuration Options
- Advanced Git Commands
- Viewing Commit History
- Inspecting Changes with
git show - Resolving Conflicts
Git Commands
Creating a New Branch
To switch to a newly created branch:
git checkout -b <branch-name>BashInitializing a Local Git Repository
Create a new project directory:
mkdir newproject
cd newprojectBashCreate a new file (README.md in this example):
echo "# create new file #" >> README.mdBashInitialize Git in the local repository:
git initBashAdding and Committing Changes
Add the file to the staging area:
git add README.mdBashCommit changes to the local repository:
git commit -m "first commit"BashCreating and Pushing to Main Branch
Create the main branch:
git branch -M mainBashConnect to a remote repository and push changes:
git remote add origin <remote-url>
git push -u origin mainBashPractice Task
Jenkins and Selenium Setup
Jenkins Status Check
To check Jenkins status:
sudo service jenkins statusBashSelenium Installation
Locate Selenium:
locate seleniumBashInstall Selenium:
sudo apt install mlocate
sudo apt-get update
sudo pip install seleniumBashGit Configuration
Setting Git User Information
Configure Git with your username and email:
git config --global user.name "temp"
git config --global user.email "[email protected]"BashAdditional Git Commands
- Initialize a Git repository:
git initBashCheck repository status:
git statusBashView commit history:
git logBashPush changes to a remote repository:
git push -u origin masterBashAuthor: TCF Editorial
Copyright The Cloudflare.
You may also read:

