Install and configure GitHub on Ubuntu, and GitHub easy to use

Source: Internet
Author: User
Tags commit using git

GitHub programming


Brief introduction:

Using Git to manage your code


I. Installation of GitHub on Ubuntu


Commend:

Sudoapt-get Update

Sudoapt-get Install git

Two. Configure your GitHub

Commend:

Set up:

Gitconfig--global user.name= "Your name"


Gitconfig--global user.email= "Your Email"

View:

Gitconfig--list

Modified: (file. Gitconfig is a hidden file)

Gedit~/.gitconfig


Upload the public key "temporarily do not know what use." 】



Three. Basic methods of use of GitHub


1. Initialize Warehouse

Gitinit # #重新初始化Git仓库地址.


2. Upload files to local warehouse

Gitadd <filename>


3. Submit to local Warehouse

Gitcommit-m "< notes for some information >"


4. Submit to the server on the GitHub


Gitremote Add origin "<github address >"

Note: If previous comments have been created origin, delete them first. Type of error: Fatal:remote origin already exists.

Commend:gitremote RM Origin



5. Push the file to the GitHub server

Gitremote-u Origin Master


Note: If all local files are inconsistent with the original files on the GitHub, the error is not uniform.

Type of error: Permissiondenied (publickey). Fatal:could not read from remote respository

Solution:

Comment

Gitclone <githun Warehouse Address >


Local Code update push


1. Automatic Commit Change file

Gitcommit-a

2. Update to remote

Gitpush Origin Master

3. Show Current Branch

Gitbranch


4. Create Branch < Create a named new-feature>


Gitbranch new-feature


5. Commit the update file to the local git

videmo.php


Gitadd demo.php

Gitcommit-a-M "Update message"


6. Merge to remote git server

Gitpush Origin New-feature


7. And when the branch new-feature mature, it can be merged into the master branch


Gitbranch Master


Gitmerge new-feature


Gitpush




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.