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