1. What is GIT?
Git is a distributed version control/software configuration management software originally developed by Linux kernel developer Linus Torvalds for better Designed to manage Linux kernel development.
Advantages of Git compared to CVS/SVN:
- Support for offline development, offline Repository
- Powerful branching, suitable for collaboration with multiple independent developers
- Speed Blocks
2. What is GITHUB?
GitHub is a shared web hosting service for storing software code and content items that are controlled using Git.
3.Using git and github on a Linux virtual machine
3.1 Registering a github account
This step is relatively simple and need not be described.
3.2 Virtual Machine Installation git Client
I am using the CentOS virtual machine, the installation command is as follows:
yum install git git-gui
3.3 Generate a key pair so that the project can be pushed onto github
[root@CentOS tuzhutuzhu]# ssh-keygen -t rsa -C "*****@**.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):< Br>
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa .pub.
The key fingerprint is:
63:68:68:ad:23:0f:8f:85:4a:cc:67:60:47:9e:7a: Fa [email protected]
The key's randomart image is:
+--[ RSA 2048]----+
|
|
|
|
|
. |
|
o .o . |
|
o +o + S |
|
+ +o o . . |
|
=+++ |
|
..=B . |
|
..oEo |
+-----------------+
[root@CentOS tuzhutuzhu]#
3.4 will .ssh/id_rsa Copy .oub to GitHub
3.5 Test if you can connect to GitHub
[root@CentOS tuzhutuzhu]# ssh [email protected]
The authenticity of host 'github. Com (192.30.252.131)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df :a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.252.131' (RSA) to the List of known hosts.
Enter passphrase for key '/root/.ssh/id_rsa':
Permission denied (publickey).
[root@CentOS tuzhutuzhu]#
3.6 Setting Git Global User Configuration
# git config --global user.name "Firstname Lastname"
# git config --global user.email "your_email @youremail.com"
Here the user is called his or her actual name (custom), and Login User Name
3.7 Git Create a Repository
Create Complete:
3.8 Create a local new project repository. This step can be Follow the prompts on the web page after GitHub is created in the above diagram
# mkdir new-project(*1)
# cd new-project
# git init< Br>
# touch README
# git add README
# git commit -m 'first commit'
Defining the remote server alias origin
# git remote add origin [email protected]:***/new-project.git(*2)
Local and remote merge, local default branch is master
# git push origin Master
(*1) The repository name here must be the same as the repository name created in GitHub in 3.7
(*2) where *** is the username of GitHub
When performing a push operation, the following error may occur:
[root@CentOS vmware]# git push -u origin master
error: The requested URL returned error: 403 While accessing< Br>
fatal: HTTP request failed
This is because GitHub seems to only support ssh to access the repository. The solution is as follows:
1).vim .git/config
2). Set the url of the [remote "origin" section to the following format:
url = ssh://[email protected]/tuzhutuzhu/vmware.git
fetch = +refs/heads/*:refs/remotes/origin/*
Execute the push operation again, the result As follows:
[root@CentOS vmware]# git push -u origin master
Enter passphrase for key '/root/.ssh/id_rsa':
Counting objects: 7, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (7 /7), 548 bytes, done.
Total 7 (delta 0), reused 0 (delta 0)
To ssh://[email protected]/tuzhutuzhu/vmware.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
[root@CentOS vmware]#
This will upload the file to GitHub.
A system, we can not have only one user, so we need to create other users. This is especially true a
What is a process? A process is a running instance of an already launched executable. The process ha
The companys network environment is a bit complicated, and the damn secure policy requires
After reinstalling Win7, I have never tried to install Linux again, occasionally playing, an
Several Linux commands for understanding the performance of Linux systems
Ubuntu configuration SSH password-free login
Linux/centos solves Tomcat memory overflow
Inter-process communication in the Linux environment: pipelines and well-known pipelines
Create a user with a password under Linux
Project Management Software Redmine+Ruby+Passenger+Nginx Installation
How the linux route command works
Linux background running and closing, view background tasks
Win7 64-bit system installation software prompts to disable this installation solution
Windows8 system positioning setting method
Hello there! My computer mouse does not work how to touch
Win8 Google browser always webpage crashes how to do
Windows8 microphone has no sound
Windows 7 boot animation error solution
Win7 system WindowsUpdate can not update prompt error code 0x80070005 how to do
Win7 system rar file can not open how to solve?
Windows Vista set up broadband connection tutorial
Win10 first wave update called Threshold wave 2 tentative scheduled release in October