Git simple use for gitee on ubuntu16.04

First Step: Check and install Git

Generally, your ubuntu system has installed Git, use following order to check version of your git   

git --version 

If Git hasn't been installed, you can do as follwoing:

sudo apt-get install git 

OK, you Git has been installed.

Second Step: Establish connection between local repository and Gitee repository

I guess you have created account on Gitee, and produced the repository named 'filestore'. so you should create rsa secret key and add it to Gitee. The detail is as following:

ssh-keygen  -t   rsa   -C    "[email protected]"    #create rsa secret key, here youremail is one registered on Gitee

After you execute the order, just input 'enter' key for following operation. Snapshot as following


then go into your home directory and toward to .ssh directory, id_rsa.pub and id_rsa file will been seen. Open the id_rsa.pub file, and copy its content to Gitee ssh key, snapshot as following:


Third step: clone your Gitee repository to local computer

git clone [email protected]:xxxx/filestore.git

Here you should write your own Gitee repository path, home directroy is your default download directory for Git tool. 

Forth step: add/remove file and push to Gitee repository

1.Create file A, file B in local repository filestore directory, then use add, commit and  push order, detail as following:

git add A, B  

git commit -m 'your description'

git push origin master

2.Remove file A, file B in local repository filestore directory, then use rm, commit and  push order, detail as following:

git rm A, B

git commit -m 'reomving description'

git push origin master

using they can update file A and B to Gitee repository named filestory. 

Fifth step: update your local repository for corresponding to Gitee repository

Just use pull order in your local repository directory. 

git pull origin master

It's easy, enjoy git! 


Reference: Git tutorial 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章