git常用操作

一、git的配置文件

在config文件中添加

[user]
    email = kero@qq.com
    name = kero

二、.gitignore

/target/
.mvn/wrapper/maven-wrapper.jar

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/build/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
View Code

三、命令

1.git branch -a 查看远程所有分支

2.git branch 查看本地分支

3.git checkout -b 本地分支名 origin/远程分支名     表示:将远程git仓库里的指定分支拉取到本地(本地不存在的分支)

 

4.git status查看

5.git pull origin 分支名

6.git push origin 分支名

 

 

7.合并fromdevelop分支到develop分支上:首先切换到develop分支,再执行: git merge fromdevelop

 8.git push origin :fromdevelop   //删除远程fromdevelop分支

git push origin test:master         // 提交本地test分支作为远程的master分支

git push origin test:test              // 提交本地test分支作为远程的test分支

git branch -d <BranchName>      // 删除本地分支 

 

9.git add -f  文件  强制把文件加到git追踪管理

 

 

10.永久存储账号和密码

git config --global credential.helper store

 

 

转载于:https://www.cnblogs.com/kesimin/p/9936083.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值