1. Install the GIT client
sudo apt-get install git
2. Setting up user names and messages
git config--global user.name "XXXX"
git config--global user.email "[Email protected]"
3. Initialize to an empty project that contains only empty readme.md files:
Touch readme.md
Git init
git add readme.md
Git commit-m "First commit"
git remote add origin [email protected]:sssss/feathersync.git
Git push-u Origin Master
4. The above will report no permissions, mainly without generating a public key
Ssh-keygen-c ' [email protected] '-t RSA
5. The public key is generated by default in the following directory
/home/zhigang/.ssh/id_rsa.pub
6. The contents of the public key file generated above are all pasted into the public key content of the CSDN Code project, and the name is arbitrarily set
7. First submission of all project documents
git Add.
Use git show to see some of the status of your project
Use git branch-a to see all of the branches
Use git branch-r to see the remote branch situation
Git commit-m "First commit all project files."
8. Push to the remote branch
Git push Origin Master:master
Git pull < remote host name > < remote branch name >:< local branch name >
origin specifies which remote you want to push to
If you omit the < remote branch name >,git you think you want to push to remote repository under the same name as local branch branch
So, you can write it in simple:
Git push Origin masteR
9. The previous update was rejected,
Git pull < remote host name > < remote branch name >:< local branch name >
Git pull Origin Master:master
To pull the master branch of the Orgin repository onto the local master branch, omit the < local branch name >
Can be simply written as:
Git pull Origin Master
Pull annotations may need to be provided during pull, and after pull is successful, you can use the following command to submit the
Git push Origin masteR
Ubuntu installs git and uses the GIT server provided by CSDN to manage project code