Submit an existing item to github/pull from GitHub to local

Source: Internet
Author: User

I've written an article on GitHub's usual commands, but these days, I've found that I don't know what to do with GitHub, and it's really annoying to be able to use the interface.

Add an existing item to GitHub

New repository can be created directly on the GitHub website or using the Windows GitHub tools.

Go to the GitHub repository project

Use Git bash to open a project in GitHub Windows tools and use the CD command to enter the existing project root directory

Touch README.MD//New description file git init//generate local git management in the current project directory and create a hidden. Git directory git Add. Add all the files in the current directory to the index git commit-m "first commit"//submit to the local source repository and attach the commit comment git remote add Origin Add to remote project, alias Origingit push-u Origin master//push local repository to GitHub alias to Origin remote project, confirm commit

Submit complete, view repository.

Update code

Cd/d/tvcloudgit Add. Git commit-m "update test"//Detect file changes and attach commit comments Git push-u origin master//commit modify to Project mainline

GitHub Common Commands

Git push origin master//push local repository to GitHub Git pull Origin master//from GitHub pull to local source repository git config--list//view configuration information git status View project status information Git branch//View Project branch git checkout-b host//Add a branch called host git Checkout master//switch to trunk git merge host//merge branch host to trunk GI T branch-d Host//Delete branch host

Submit an existing item to github/pull from GitHub to local

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: 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.