Git and GitHub
Leveraging Git and GitHub for Efficient Version Control and Collaboration
HARE KRISHNA
This month, I embarked on the DevOps beginner roadmap, commencing with fundamental core concepts that are ubiquitous in the tech field. Regardless of your domain within tech, Git and GitHub are indispensable tools. In this blog, I will provide concise yet valuable details that will be beneficial to you.
let's get started!!
Git
Git is a version control application that helps you manage your projects with ease.
version control
GitHub
GitHub is a platform where users can store their projects. It offers various features, including manual code changes and the ability to fork a project to your repository.
Repository
Git Configuration
First of all, you need to download the git link
you can verify git by (write command in command line interface)
git --version
now just configure your name and email detail
#git config --global user.name your_name
git config --global user.name titanpimpale
#git config --global user.email your_mail
git config --global user.name rohitdpimpale4@gmail.comm
Hand on
Here you will able to change code on GitHub using git
for this, you require a repository on your account
git clone <link>
cd <repository_name>
echo print("hare krishna") >file.py
git add file.py #git add . (it adds everything at once)
git commit -m "added hare krishna"
git push origin main
I face many problems in the starting phase
When pushing changes to a Git repository, use the command "git push origin main". If you are unsure of your branch name, run "git branch" to check. If you encounter an error, run "git rebase --abort" to start fresh.
once it is authorised git and GitHub then you will able to see changes in GitHub
Good Commit Practice Tips
In a large organization, it is important to have good practices for committing code.
Commit in Chuck don't commit Altogher
Define the message and body very detail it is very good practice
It should contain how why, and what you have made a changes
Branching
Branching enhances workflow and structure
branching means creating your own session without disturbing the main and then merging into the main after changes
Two types
Git flow
GitHub flow
Pull Request
step to create a Pull request
creating for fork
suggest the owner of project changes you have done including via pull request
simple process
Resources
DevOps road map beginner (I'm following this)
Git and GitHub for professional
Conclusion
Provide a hands-on project to explain basic Git commands. Additionally, discuss Git and GitHub strategies, offer tips, and recommend useful resources. Connect with me on LinkedIn or Twitter for further interaction.