In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
How to download, install and configure git, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail, people with this need can come to learn, I hope you can gain something.
First: the introduction of git
Git (pronounced / g roomt /.) Is an open source distributed version control system that can effectively and quickly handle version management of bai projects from very small to very large. Git is an open source version control software developed by Linus Torvalds to help manage Linux kernel development.
Second: download and install git
The download section can be downloaded from the official website. Here you download git-1.7.7.4.tar.gz.
[root@localhost ~] # tar zxvf git-1.7.7.4.tar.gz [root@localhost ~] # cd git-1.7.7.4 [root@localhost git-1.7.7.4] #. / configure [root@localhost git-1.7.7.4] # make & & make install
After installation, check the default installation directory of the above without .configure.
[root@localhost ~] # which git / / this path is in PATH, so there is no need to add it.
/ usr/local/bin/git
In this way, git is successfully installed.
Third: the basic configuration of git (here root login)
[root@localhost /] # mkdir-p / git/project [root@localhost /] # cd / git/project/ [root@localhost project] # git config-global user.name 'ethnicitybeta' [root@localhost project] # git config-global user.email' ethnicitybeta@126.com'
The configuration of Global is actually written to the git configuration file in the user's home directory
[root@localhost project] # cat ~ / .gitconfig [user]
Name = ethnicitybeta
Emal = ethnicitybeta@126.com
Email =
[root@localhost project] # vim main.c / / create a test file
Hello ethnicitybeta!!!
[root@localhost project] # git init / / initialization of git
Initialized empty Git repository in / git/project/.git/
[root@localhost project] # ls-al
Total 32
Drwxr-xr-x 3 root root 4096 Nov 27 03:38.
Drwxr-xr-x 3 root root 4096 Nov 27 03:11..
Drwxr-xr-x 7 root root 4096 Nov 27 03:38 .git
-rw-r-r- 1 root root 23 Nov 27 03:37 main.c
The next section is the local setting relative to the global setting.
[root@localhost project] # git config user.name 'ethniciy' [root@localhost project] # git config user.email' ethnicity@126.com' [root@localhost project] # cat .git / config [core]
Repositoryformatversion = 0
Filemode = true
Bare = false
Logallrefupdates = true
[user]
Email = ethnicity@126.com
Name = ethnicity
Fourth: a git instance
[root@localhost project] # vim main.c / / create a test file
Hello ethnicitybeta!!!
Initialization of [root@localhost project] # git init / / git [root@localhost project] # git add. / / add to git [root @ localhost project] # ll .git / / the index that appears under git is Staging area.
Total 72
-rw-r-r- 1 root root 23 Nov 27 03:38 HEAD
Drwxr-xr-x 2 root root 4096 Nov 27 03:38 branches
-rw-r-r- 1 root root 143 Nov 27 03:41 config
-rw-r-r- 1 root root 73 Nov 27 03:38 description
Drwxr-xr-x 2 root root 4096 Nov 27 03:38 hooks
-rw-r-r- 1 root root 104 Nov 27 03:43 index
Drwxr-xr-x 2 root root 4096 Nov 27 03:38 info
Drwxr-xr-x 5 root root 4096 Nov 27 03:43 objects
[root@localhost project] # git commit-m '1st commit' / / submit to generate the first commit [master (root-commit) 96f025b] 1st commit
1 files changed, 1 insertions (+), 0 deletions (-)
Create mode 100644 main.c
[root@localhost project] # rm-rf main.c / / simulate the loss of a file [root@localhost project] # git checkout-f HEAD / / retrieve the missing file [root@localhost project] # ls
Main.c
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.