In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article analyzes "how to analyze git in Linux system". The content is detailed and easy to understand. Friends who are interested in "how to analyze git in the Linux system" can follow the editor's idea to read it slowly and deeply. I hope it will be helpful to you after reading. Let's follow the editor to learn more about how to analyze git in Linux system.
Git is an open source distributed version control system for agile and efficient handling of any small or large project.
About git: git is an open source distributed version control system that can effectively and quickly handle project version management from very small to very large. Git is an open source version control software developed by Linus Torvalds to help manage Linux kernel development.
The biggest difference between distributed and centralized is that developers can submit it locally, and each developer copies a complete Git repository on the local machine through git clone.
Introduction to git in Linux system: first, initialize 1. First, install git software. The installation environment is a CVM under centos 7.x. Use the command:
# yum install git2, set user name and mailbox (required):
# git config-- global user.name "Your Name" # git config-- global user.email "email@example.com" 3. Create a version library, select an appropriate place, and create an empty directory:
# mkdir learngit # create a learngit folder in the server # cd learngit # enter the learngit folder # pwd # display the result of the current work path: (use root user rights)
/ root/learngit4, initialize this directory to a warehouse that git can manage, using the command:
# git init Initialized empty Git repository in / root/learngit/.git/ has successfully initialized the git repository and is empty. The path is in the / root/learngit/, directory where git can manage the repository.
5. Add files to the git repository
# vi read.txt # create a text file # I "hello, world" # Edit the contents of the file #: X # Save and exit the first step: use the command git add to tell git to add the file to the repository:
# git add read.txt step 2 use the command git commit to tell git to submit the file to the repository:
# git commit-m "wrote a read file" description: the git commit command, followed by a description of this submission, is a description of the changes submitted, making it easy to find the updated version in the future.
After the successful execution of the git commit command, it will tell you that 1 file has been changed and 1 line of content has been inserted (read.txt has 1 line).
Why does Git need add,commit to add files in a total of two steps? Because commit can submit many files at a time, you can add different files multiple times, such as:
# git add file1.txt # git add file2.txt file3.txt # git commit-m "add 3 files." Update the contents of the file 1. Continue to update the contents of the file
# vi read.txt # hello world # add hello on the second line, world #: X2 to view the current status of the file
# git status
As you can see, the file has been modified, but it has not been submitted.
3. To view the changes, use the command:
# git diff read.txt
You can see the changes, adding a line of content.
4. Submit the version again
# status of git add read.txt: git status
Submit:
# git commit-m "add hello world"
On how to analyze git in the Linux system is shared here, I hope that the above content can make you improve. If you want to learn more knowledge, please pay more attention to the editor's updates. Thank you for following the website!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.