git

1、git - 简明指南

https://rogerdudler.github.io/git-guide/index.zh.html

https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-Git-%E5%9F%BA%E7%A1%80

2、gitlab安装后使用外部nginx

参考资料,未验证:

https://zhuanlan.zhihu.com/p/29437004

在配置external_url和指定nginx的port值后即可使用,如果像我们一样使用了自签名的证书,需要设置trans_http_to_https为true;

3、"Every import attempt has failed Blocked import URL:************ Requests to localhost are not allowed. Please try again."

当设置了external_url有误时,可能会在根据模版创建一个项目时出现上面问题;

4、git操作命令中文文档,我是链接

5、Git Clone命令直接使用用户名密码Clone 

git clone https://username:password@git.oschina.net/wdm/familycloud.git
git push https://username:password@git.oschina.net/wdm/familycloud.git

  

6、git pull 提示错误,Your local changes to the following files would be overwritten by merge

a、服务器代码合并本地代码

$ git stash     //暂存当前正在进行的工作。
$ git pull   origin master //拉取服务器的代码
$ git stash pop //合并暂存的代码

b、服务器代码覆盖本地代码

$git reset --hard  //回滚到上一个版本
$git pull origin master 

7、git比较本地仓库和远程仓库的差异

a、更新本地的远程分支

可以认为git pull是git fetch和git merge两个步骤的结合。 

git fetch origin

b、本地与远程的差集 :(显示远程有而本地没有的commit信息)

git log master..origin/master

c、统计文件的改动

# git diff <local branch> <remote>/<remote branch>
git diff --stat master origin/master

e、已经进行push操作,回退push操作

git reset --hard HEAD^

git push -f

8、多个分支时,切换使用的分支后

#创建并切换至<branch name>分支
git checkout -b develop

,pull代码提示“

There is no tracking information for the current branch

9、Cloning a specific tag

git clone --branch <tag> <repo>

10、本地项目关联到码云

  

常用命令svn

svn commit -m "数据类型" list.vue add.vue edit.vue
#回退本地修改到服务器版本
svn revert list.vue

mac下使用svn diff

 

以下截图来源:https://www.bilibili.com/video/av59635745 

在github中搜索项目

in:name in:readme pushed:>2019-02-01 stars:>1000 forks:>1000

git 查看某次commit的修改内容

1、首先,需要通过git log打印所有commit记录

2、找到你想查看的那次commit的commitid。

3、查看修改。

git show commitId

4、查看某次commit中具体某个文件的修改:
git show commitId fileName

  

  

 

原文地址:https://www.cnblogs.com/zhucezmf/p/11215604.html