Git installation, simple commands and cloud registration code

Git installation, simple commands and cloud registration code

Download: https://git-scm.com/downloads

Installation: Go to the official website, select the corresponding version, all the way to Next (Windows version)

Cloud registration code

URL: https://gitee.com/

Registration: Go to the official website, click on the upper right corner of registration options, fill in the registration page name, personal space name, phone number or select the E-mail (No personal use of registered phone number, email registration unavailable for comment), you can fill in login password Register

Create a remote repository: Click the "+" sign and select New warehouse, add warehouse name, path and warehouse reports, select the option to create your first create a remote repository code in the upper left corner cloud personal home page interface

Warehouse Related Concepts:

  • Warehouse Name : The name of the warehouse, a warehouse for naming
  • Attribution : attribution warehouse account, can be a personal account / organization / enterprise, created after the success of the default account for the warehouse owner (administrator)
  • Path : git repository access path from 用户个性地址+仓库路径名称the composition. Users will access the repository through this path after creating a warehouse.
  • Warehouse Introduction : Introduction warehouse
  • Whether open source : Set whether public warehouse storage, warehouse publicly visible to everyone, private warehouse warehouse only visible to members.
  • Select Language : Warehouse main programming language used to develop
  • Add .gitignore : default template provided by git ignore files submitted by setting .gitignorewill default to ignore the specified directory / file to the repository
  • Add open-source licenses : the warehouse if the warehouse is open, you can add a warehouse set up open-source protocol, as the current project warehouse and warehouse licensing constraints derived from the project, the open source licenses determine whether the open-source project for business-friendly.
  • The README : README document warehouse project typically contains notices that software description or use.
  • ** *** Use the template file to initialize the warehouse **: use Issueor Pull Requestfile templates initialization warehouse

After the warehouse is created, cloud code page will pop up the following page:

Remote repository configuration

  1. After the code cloud registration is completed, select the hard disk to create a folder (remember the folder path)

  2. Open the newly created folder, right-click to select Git Bash Here, the pop-up window Git Configuration

  3. Git global configuration:

  4. Creating a local repository (Git Configuration window to enter commands git init):

  5. Create a new file in a new folder, add the specified files to a remote repository:

  6. The contents of the local repository to the remote repository:

    Execute the command: git push -u origin master

Git commands

git init to create a local repository

git add. current folder and all content is added to the staging area

git add add the specified file test.txt

git commit "first submission" -m remarks information, first submitted

git push -u origin master the contents of the local repository added submit uploaded to a remote repository

git push -u origin master -f to force the contents of the local repository submit uploaded to a remote repository (Enterprise prohibited)

Guess you like

Origin www.cnblogs.com/lifangzheng/p/11128057.html