How to install and use GIT on Linux and how to install gitlinux

Source: Internet
Author: User

How to install and use GIT on Linux and how to install gitlinux

GIT unzipping installation and usage on Linux and switch to its directory $ tar xvfj git-1.7.6.tar.bz2 $ cd git-1.7.6 to use the default configuration for installation, if you want to modify the configuration, you can use. /configure -- help to get help $. /configure $ make install 2. The initial configuration GIT is installed in/usr/local/bin by default. After installation, you can verify whether the installation is successful. $ whereis gitgit: /usr/local/bin/git $ git -- versiongit version 1.7.6 $ git -- help first you need to specify the user name and email address $ git config -- global user. name "GIT Admin" $ git config -- global user. emal obugs.net@gmail.com to verify the configuration again Information www.2cto.com $ git config -- listuser. name = GIT Adminuser. email = obugs.net@gmail.comcore.repositoryformatversion = 0core. filemode = truecore. bare = falsecore. logallrefupdates = true in fact, these configurations are stored in the home directory. $ cat ~ In the gitconfig File ~ /. Gitconfig [user] name = GIT Adminemail = obugs.net@gmail.com 3. You can create a GIT project in any directory where the project is locally stored. If the current project is located in the/home/obugs/projects/orangebugs directory, you can define this directory as a GIT project $ cd/home/obugs/projects/orangebugs $ git initInitialized empty Git repository in/home/obugs/projects/orangebugs /. git/creates a file named. git folder, which is the folder that GIT uses to store information and track changes. Www.2cto.com $ ls-altr. gittotal quota 4 git 4096 Aug 13 refsdrwxrwxr-x 4 git 4096 Aug 13 objectsdrwxrwxr-x 2 git 4096 Aug 13 infodrwxrwxr-x 2 git 4096 Aug 13 hooks -rw-r -- 1 git 23 Aug 13 HEAD-rw-r -- 1 git 73 Aug 13 description-rw-r -- 1 git 92 Aug 13 configdrwxrwxr-x 2 git 4096 Aug 13 branchesdrwxrw Xr-x 36 git 4096 Aug 13 .. drwxrwxr-x 7 git 4096 Aug 13. 4. add and submit files to the project. These operations are similar to those of CVS and SVN, such as $ git add *. java *. c $ git commit-m'initial upload of the project 'create mode 100755 Orangebugs. javacreate mode 100755 pwm/ui/DataManager. javacreate mode 100755 pwm/ui/PasswordFrame. javacreate mode 100755 pwm/tools/StrongEncryption. javacreate mode 100755 pwm/tools/PasswordStrength. java .. note: If you have not used git config to specify the user name and email address, the error $ git commit-m' Initial upload of the project *** Please tell me who you are. www.2cto.com Run git config -- global user. email "you@example.com" git config -- global user. name "Your Name" to set your account's default identity. omit -- global to set the identity only in this repository. fatal: empty ident not allowed 5. Modify the file and submit the modified editing file. Some fields are added or deleted. java View the changes compared to the files in the GIT repository $ git diffdiff -- git a/Orangebugs. java B/Orangebugs. javaindex 6166ed1 .. fd82d32 100644-a/Orangebugs. java ++ B/Orangebugs. java @-+ @-public counter = 10 + public counter = 55 if you want to submit the file, make sure that the file is added to the temporary area before submission, the Default Editor of the system is automatically opened when the system is submitted. When you add comments and save them and exit the editor, these comments are submitted to the repository at the same time for www.2cto.com $ git add Orangebugs. java $ git commit [master 80f10a9] Added password strength meter funct Ionality1 files changed, 56 insertions (+), 7 deletions (-) or, simply use git commit-a to merge the preceding two commands into one. 6. View status and view comments. If the local file is not changed compared with the file in the remote GIT repository, $ git status # On branch masternothing to commit (working directory clean) if a local change is made but not submitted, $ git status # On branch master # Changes not staged for commit: # (use "git add ..." To update what will be committed) # (use "git checkout -..." To discard changes in working directory) # modified: Orangebugs. java # no changes added to commit (use "git add" and/or "git commit-a") in addition, you can use the following command to view the file history and previous comments $ git log Orangebugs. javacommit upload: GIT Admin www.2cto.com Date: Sat Aug 13 22:54:57 2011-0700 Added password strength meter functionality commit submit: GIT AdminDate: Sat Aug 13 20:08:02 2011-0700 Initial upload of the project

In linux, the git installation method, installation package, and detailed usage are provided. Thanks for your high score.

Google is everywhere
If you use Ubuntu, you can install sudo apt-get install git on the terminal.
Use arch to create sudo pacman-S git
Various package management should be able to see which one you use
Compile your own code
I can't tell you one or two sentences. go to Google for a tutorial.

In linux and ubuntu, how does one make git record my version?

Use a branch or label, but it seems that the label should be more suitable.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.