Git
本文最后更新于:2025年4月29日 下午
git init 初始化本地库
git status 本地库状态
$ git status 本地库状态
On branch master
No commits yet
nothing to commit (create/copy files and use "git add" to track) # 还没有文件
$ git status
On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
test.txt
nothing added to commit but untracked files present (use "git add" to track)
git config –list #查看 git 配置信息
查看用户名,密码和邮箱命令:
git config user.name
git config user.password
git config user.email
设置或修改用户名,密码和邮箱命令:
git config --global user.name "freedom"
git config --global user.password "123456"
git config --global user.email "12345678@qq.com"
git 强制提交本地分支覆盖远程分支
git push origin 分支名 --force
Git 分支
切换分支
git checkout branchName
查看分支
git branch -a
gitignore 模板
*.class
*.log
*.lock
# Package Files #
*.jar
*.war
*.ear
target/
# idea
.idea/
*.iml/
*velocity.log*
### STS ###
.apt_generated
.factorypath
.springBeans
### IntelliJ IDEA ###
*.iml
*.ipr
*.iws
.idea
.classpath
.project
.settings/
bin/
*.log
*.log/
tem/
#rebel
*rebel.xml*
*.gitignore
使用码云
- 注册登录,完善信息
- 设置本机绑定 SSH 密钥,实现免密码登录
# 进入C:\Users\Admin\.ssh
# 生成公钥
ssh-keygen -t rsa
- 添加密钥到码云
- 使用码云创建自己的仓库
许可证:开源是否可以随意转载,开源但不能商业使用、不能转载,…限制
- 克隆自己的仓库
Git
https://junyyds.top/2023/05/17/Git/