git学习记录

1、git官网laravel

http://git-scm.com

2、查看git安装路径git

which git

3、 配置configgithub

git config --global user.name "jihaichuan"
git config --global user.email "jihaichuan@126.com"

4、初始化gitweb

git init

5、添加全部的本地文件vim

git add .

6、 提交文件缓存

git commit -m 'install laravel'

7、 删除缓存区的编辑器自带的文件夹 .idea目录bash

​git rm -r --cached .idea/

8、 新增 “add-web-page” 分支服务器

git branch add-web-page   #新增分支

9、 查看全部分支ssh

git branch

10、 切换 add-web-page 分支编辑器

git checkout add-web-page
git checkout -b add-web-page #新增分支并直接切换到该分支

11、 合并 add-web-page 分支, 首先须要切回到 master 分支上面

git marge add-web-page

12、 删除 add-web-page 分支

git branch -d add-web-page

十3、 配置git快捷命令

git config --global alias.s status
git s #至关于  git status

十4、 删除配置的git快捷命令

git config --global --unset alias.s

十5、 把已有的项目推送到github上面

git remote add origin https://github.com/jihaichuan/xiaocx.org.git
git push -u origin master

十6、把本地项目push到 github 上面

git push

十7、 查看git日志,图像化

git log --graph

十8、 在服务器上面git pull时不须要重复的输入帐号和密码,编辑vim .git/confg在底部新增

[credential]
        helper = store

十9、 更新服务器代码

git pull
git pull origin master

二10、 查看版本直接的不一样

git diff

二11、 恢复到上传提交的版本

git reset --hard 32323432

二12、 生成ssh秘钥

ssh-keygen
cat ~/.ssh/id_rsa
cat ~/.ssh/id_rsa_pub

二十3、 查看git提交的远程地址

git remote -v
相关文章
相关标签/搜索