Getting Started with Git

Source: Internet
Author: User

Getting Started with Git
********************
Linux kernel code and many well-known projects are using Git for source code control
Understanding the theory and basic usage of git can help you get more learning resources

///////////////////////////////////////////
To install Git:
Many Linux systems bring git, and if not, you need to install them yourself.
Method:
# apt-get Install git
# apt-get Install Git-doc git-svn git-email Git-gui gitk
//////////////////////////////////////////////////////////
To view a git document:
1. View the help document for the specified command directly with the Man command
2. Installing Git-doc will install Git's text format and HTML-formatted documents
View commands as text: # git help <sub-command>
3. Query the documentation for the git-checkout command: #git help Git-checkout
If you want to see the HTML format: # git help-w git-checkout
///////////////////////////////////////////////////////
Source code submission and acquisition:
1. Create a working directory of Open source projects: # mkdir-p/demo/helloworld-git
2. Enter the working directory: # Cd/demo/helloworld-git
3. Execute: # git init (output: Initialized empty git repository in/demo/helloworld-git/.git/)
4.# Ls-al
5. Submit the file to the local repository:
# Cd/demo/helloworld-git
# echo "HelloWorld" > Helloworld.txt
# git Add helloworld-master
# git log
6. Create a local branch: Git branch
# git Branch
# git Branch New-branch
# git branch-d new-branch
7. Switch local branch:
# git checkout New-branch
8. Create an open source project on GitHub
9. Upload the source code to Github:git push
10. Download source code from github: Git clone

Getting Started with Git

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.