Basic usage of csdn git

Source: Internet
Author: User

Installation

#安装git核心

sudo apt-get install Git-core

#安装git GUI

sudo apt-get install Git-gui

#安装git doc

sudo apt-get install Git-doc

#安装git-SVN

sudo apt-get install GIT-SVN

#安装git-cvs

sudo apt-get install Git-cvs

#安装gitweb

sudo apt-get install Gitweb

#安装git-daemon-run

sudo apt-get install Git-daemon-run

#安装git-email

sudo apt-get install Git-email

#安装git-arch

sudo apt-get install Git-arch

#安装gitk

sudo apt-get install GITK

#在终端上输入 the git test to install

Public key

First check the native public key:
$ CD ~/.ssh
If prompted: No such file or directory indicates that you are using Git for the first time. If you are not using it for the first time, do the following to clean up the original SSH key.

$ mkdir Key_backup
$ CP id_rsa* Key_backup
$ RM id_rsa*
To generate a new key:

$ ssh-keygen-t Rsa-c "your email address"
In the carriage return you will be prompted to enter a password, which will be used when you submit the project, if it is empty, you do not have to enter the project.

You can find an. ssh file in your user folder under your native system disk, where the SSH key that you just generated is stored in the Id_rsa.pub file.

Settings

Based on a pure warehouse test,

Git settings:

# Set the default user name when Git commits,

git config--global user.name "Your name Here"

# Set the default mailbox when Git commits,

git config--global user.email "[Email protected]"


Initial

Initialize to an empty project that contains only empty readme.md files:

Touch readme.md

# A directory must be initialized to create a. Git folder

Git init

#使用 git add * recursively adds all files

git add readme.md

Git commit-m "First commit"

#使用 git remote RM origin can be reset from Origin

git remote add origin [email protected]:only_phantasy/test.git

Git push-u Origin Master

"Push and pull"

git push

Git pull Origin Master

Basic usage of csdn git

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.