Git使用

2019-01-15  本文已影响0人  pluto_S

After download you package
Create a folder for git rep

mkdir Gitrep

let it known who you are

git config --global user.email "pluto@gmail.com"//your email address
git config --global user.name "pluto"//your name

use the following order in the current folder

git init

create your shh key

ssh-keygen -t rsa -C "youremail@example.com"

the find your id_rsa.pub in the c://windows//users//.shh//
add it to you github account
get the repo from exist program

git clone git@github.com:SHH225/SHH.git

push your repo to the github

git add .//add all file
git commit -m "description"
git remote add origin git@github.com:SHH225/SHH.git
git pull --rebase origin master
git push -u origin master
git fetch origin master //从远程的origin仓库的master分支下载代码到本地的origin master

$ git log -p master.. origin/master//比较本地的仓库和远程参考的区别

$ git merge origin/master//把远程下载下来的代码合并到本地仓库,远程的和本地的合并

delete file

git rm -r -n --cached 文件/文件夹名称  //加上 -n 这个参数,执行命令时,是不会删除任何文件,而是展示此命令要删除的文件列表预览。

git rm -r --cached 文件/文件夹名称
git commit -m "提交说明"
git push origin master
上一篇 下一篇

猜你喜欢

热点阅读