首页 > 技术文章 > git使用教程

han-guang-xue 2019-09-06 15:22 原文

 

---------------git命令-----------------------
git add 文件;            将文件添加到仓库
git commit -m 文件s;        提交文件,如果该文件没有add,默认提交所有修改的文件(不确定)
git commit -m '注释';    后面不跟文件名,默认提交add的所有文件
git diff '文件';            查看文件之前和已经提交文件的不同处
git diff HEAD -- 文件;    查看工作区和版本库里面最新版本的区别
git log --pretty=oneline;查看日志文件
git reset --hard HEAD^;    版本回退 
git reflog                记录操作的每一次数据
git checkout -- 文件;    撤销暂存区中新增内容,最近一次add或是commit之前的内容
git rm 文件;                删除文件--需要commit
git pull;                从远程仓库拉到本地
git push;                从本地更新到服务器

git log | reflog        查看当前版本之后的日志| 查看当前版本 前后所有日志
git reset --hard HEAD^^^   当前版本后退三个版本
git rm --cached "文件路径"   删除add多余的文件, git status 可见
git rm --f "文件路径"      彻底删除多余的文件, git status 不会显示
git config --global user.name ""        //修改本地账户
git config --global user.email "@qq.com"
git  log a.jsp
git reset   fcd2093  a.jsp 回退某个版本

git branch -a //查看某个分支
$ git checkout -b +分支名字  //切换分支名字 

账号hgx_xs 密码 hgx_xs123

---------------PostgreSQL命令-----------------------
su - postgres //登录postgres数据库命令
sudo -u postgres psql --version //查看版本的命令
pg_dump -V || psql -V //查看版本
service postgresql-10 status
/bin/systemctl start postgresql-10.service
pg_dump -h 192.168.1.23 -U postgres YCXDB >/dataH/YCXDB.sql 导出数据配置
pg_dump -h 192.168.1.23 -U postgres --inserts --if-exists -c YCXDB >/dataH/YCXDB.sql

psql -d ycxdb -h 47.111.162.176 -p 5432 -U ycx -f YCXDB.sql;导入sql配置

pg_dump -h 47.111.162.176 -U postgres --inserts --if-exists -c ycx3dot0 >/YCXDB.sql

修改表中字段 / 向表中添加字段
ALTER TABLE public."EVENT-4444444444444444" RENAME COLUMN phashid TO "PHashId";
ALTER TABLE public."EVENT-4444444444444444" ADD "EHashId" varchar NULL;

---------------liunx命令-----------------------
find /usr -name "*.ini"
scp -r UtilImages/ root@47.111.162.176:/usr/data/   远程传输

curl ipecho.net/plain //获取外网ip地址

chmod +x GetHostIP.sh 给脚本设置权限

----------------tomcat---------------------
ps -f |grep tomcat   //查找服务器进程命令

https://www.cnblogs.com/zwwhnly/p/11175503.html

systemctl status tomcat

firewall-cmd --state

service firewalld stop


----------------vscode---------------------

 

 

推荐阅读