Getting Started with DevOps: Setting Up Git and GitHub Integration
Task 1: Set Your User Name and Email Address
Before we dive into repositories and version control, let's start by configuring Git with your user information. Open your terminal or Git Bash and run the following commands, replacing "Your Name" and "your.email@example.com" with your actual name and email address:
git config --global user.name "vishalmamav20"
git config --global user.email "manavvishal78@gmail.com"
This information will be associated with your commits, making it easy for others to identify your contributions.
Task 2: Creating and Connecting to the "Batch4" Repository on GitHub
Create a Repository on GitHub:
Log in to your GitHub account and click on the "+" icon at the top right corner of the page.
Select "New repository."
Name your repository "Batch4" and add an optional description.
Choose whether you want to make the repository public or private.
Click on "Create repository" to complete the process.
Connect Your Local Repository to GitHub:
Assuming you already have a local project, navigate to its root directory in your terminal or command prompt.
- Initialize the repository:
git init
- Link your local repository to the one you created on GitHub:
git remote add origin <GitHub_Repository_URL>
Replace <GitHub_Repository_URL>
with the URL of your GitHub repository. You can find the URL on your GitHub repository page, under the "Code" button.
Task 3: Creating a New File and Pushing to GitHub
Let's create a new file named "Command.txt" inside the "Batch4/Git" directory and add some content to it.
Create the file:
touch command.txt
Add the file to the staging area:
git add command.txt
- Commit your changes:
git commit -m "adding command.txt "
- Push your local commits to GitHub:
git push origin main
Congratulations! You've successfully pushed your local repository to the "Batch4" repository on GitHub. Your "commant.txt" file and its content are now available in your remote repository.
Stay tuned for more DevOps adventures and deeper dives into version control, branching, and more. ๐