"Go" GitHub use

Source: Internet
Author: User

1. Set git global User Configuration
# git config--global user.name "xxx"
# git config--global user.email [email protected]

2. Create a new local project working tree
# mkdir New-project
# CD New-project
# git Init
# Touch README
# git Add README
# git commit-m ' first commit '
To define a remote server alias origin
# git remote add origin [email protected]:xxx/new-project.git
Local and remote merge, local default branch is master
# Git push Origin Master

You can see it on the GitHub website, Http://github.com/xxx/new-project.

3. Update files
# VI README
Automatic commit Change file
# git Commit-a
Update to remote
# Git push Origin Master

4. Create and Merge Branches
#git Branch shows that the current branch is master
Create a branch #git branch new-feature
# git checkout new-feature switch to new branch
# VI page_cache.inc.php
# git Add page_cache.inc.php
Commit to local git
# git commit-a-M "added initial version of page cache"
Merging to a remote server
# Git push Origin new-feature

If the New-feature branch matures, it feels necessary to merge into Master
#git Checkout Master
#git Merge New-feature
#git Branch
#git push
The New-feature code is also incorporated in master

Log on to GitHub again to see the branching options under "Switch Branches":

Reproduced the http://blog.csdn.net/richardysteven/article/details/5956854 content.

"Go" GitHub use

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.