Create a Git repository on the server (Ubuntu)

Source: Internet
Author: User
1 install Git tool: sudoapt-getinstallgitgit-core2 create Git repository :( 1) mkdirFishMe (2) cdFishMe (3) gitinit function: Initialize Git repository, create. git directory ,. the git directory is the Git repository. (4) vim. add git/config: [receive]

1 install the Git tool:

Sudo apt-get install git-core

2. Create a Git Repository:

(1) mkdir FishMe

(2) cd FishMe

(3) git init

Function: Initialize the Git repository and create the. git directory. The. git directory is the Git repository.

(4) vim. git/config

Add:

[Receive]

DenyCurrentBranch = ignore

Function: allows the client to push (upload code to the. git repository) code.

(5) Add a file to the FishMe directory.

(6) git add

Function: add all files under the FishMe directory to The. git repository.

(7) git commit-m "comment"

Function: Submit

Note:

(1) openssh-server software must be installed on the Git server.

(2) The git directory is the Git repository.

(3) The Directory of the git directory is called the working directory.

(4) Ignore the command to add files or directories to the Git Repository: echo "file or directory">. gitignore

(5) use the Git repository to generate the working directory command: git clone. git repository working directory.

Related Article

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.