文章出處

Git配置:

在電腦中安裝git,打開git shell,設置名字與email

git config --global user.name  "YourName"
git config --global user.email "YourEmail@gmail.com"

 

Git基本操作:

1. 打開git shell,進入工程目錄。

cd sampleProject

2. 倉庫初始化

git init

3. 添加需要提交的文件到index中

git add sampleFile.txt  //添加sampleFile
git add .               //添加目錄及子目錄下的所有文件

4. 提交index中的文件

git commit -m “introduction to git” //提交index中的文件
//或者
git commit -a                       //添加所有修改的文件到index中,并提交

5. 將修改推送到遠程服務器的master分支

//若遠程還沒有該代碼倉庫,則需在遠程服務器新建一個sampleProject倉庫

//添加推送的目的地址
git remote add origin https://github.com/YourName/sampleProject
git push -u origin master

 


文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜

    大師兄 發表在 痞客邦 留言(0) 人氣()