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