当前位置: 首页 > news >正文

网站制作顶级公司谷歌下载安装

网站制作顶级公司,谷歌下载安装,wordpress删除月份归档,聊城手机网站建设系统写这篇博文的目的只是简单的给自己及团队的日常工作中需要用到的git命令作个汇总,这样平时只需要查阅这篇文章就够了,不用到处查找。如果能给有需要的朋友一点点的帮助,那也算是意外之喜吧。 一、基础配置 # 设置用户名和邮箱(首…

写这篇博文的目的只是简单的给自己及团队的日常工作中需要用到的git命令作个汇总,这样平时只需要查阅这篇文章就够了,不用到处查找。如果能给有需要的朋友一点点的帮助,那也算是意外之喜吧。

一、基础配置

# 设置用户名和邮箱(首次使用必配)
git config --global user.name "Your Name"
git config --global user.email "your@email.com"

# 查看配置列表
git config --list

二、仓库操作

# 初始化新仓库
git init

# 克隆远程仓库
git clone <repo_url>

# 查看仓库状态
git status

三、代码提交

# 添加文件到暂存区
git add <file>  # 单个文件
git add .       # 所有修改

# 提交到本地仓库
git commit -m "commit message"

# 修改最后一次提交
git commit --amend

# 撤销未提交的修改(保留文件)
git restore --staged <file>  # 从暂存区撤出
git restore <file>           # 丢弃工作区修改

# 撤销最近一次提交(保留修改)
git reset --soft HEAD~1

# 撤销远程提交(强制推送覆盖)
git push -f origin <branch>
 

四、分支管理

# 查看分支
git branch     # 本地分支
git branch -a  # 所有分支

# 创建/切换分支
git checkout -b <new_branch>

# 合并分支
git merge <branch_name>

# 删除分支
git branch -d <branch_name>

# 对比两个分支差异
git diff branch1..branch2

# 对比本地与远程
git diff @{upstream}

# 图形化对比工具
git difftool -t vscode  # 使用VSCode对比
 

五、远程协作

# 关联远程仓库
git remote add origin <url>

# 推送到远程
git push -u origin <branch>

# 拉取更新
git pull origin <branch>

# 查看远程库信息
git remote -v

六、版本控制

# 查看提交历史
git log --oneline --graph

git reflog show # 查看操作历史

# 回退版本
git reset --hard <commit_id>

# 暂存当前修改
git stash
git stash pop

七、实用技巧

# 查看文件修改差异
git diff

# 撤销工作区修改
git checkout -- <file>

# 重命名文件
git mv <old> <new>

八、协作场景解决方案

# 同步上游仓库更新
git remote add upstream <original-repo-url>
git fetch upstream
git merge upstream/main

# 解决冲突后继续变基
git rebase --continue

# 提交PR前清理历史
git rebase -i origin/main
 

 九、建立远程仓库

以Gitee平台为例。

一)、前期准备

  1. 注册平台账号

    • Gitee
    • 完成邮箱验证(必需步骤)
  2. 配置本地Git身份

  3. 生成SSH密钥(免密推送必备)

 

 ‌二)、创建远程仓库(以Gitee为例)

  1. 网页端操作

    • 点击「+」→「新建仓库」
    • 填写仓库名(如 project-demo
    • 选择公开/私有 → 勾选「使用Readme初始化」→ 创建
  2. 获取仓库地址

    • HTTPS:https://gitee.com/yourname/project-demo.git
    • SSH:git@gitee.com:yourname/project-demo.git(推荐)

三)、关联本地仓库

▶ 场景1:已有本地项目
# 进入项目目录
cd existing-project# 初始化本地仓库
git init# 关联远程仓库
git remote add origin git@gitee.com:yourname/project-demo.git# 首次推送(-u 设置上游分支)
git push -u origin master     # 或 main 分支
▶ 场景2:全新项目
# 克隆远程仓库到本地
git clone git@gitee.com:yourname/project-demo.git# 进入目录添加文件
cd project-demo
touch new-file.txt# 提交并推送
git add .
git commit -m "Add new file"
git push origin master

 十、.gitignore文件配置

 

 一)、.gitignore核心语法手册

1. 基础匹配规则
  • #:注释行(例:# 忽略临时文件

  • /前缀:仅匹配根目录(例:/debug.log不匹配src/debug.log

  • *通配符:跨文件名匹配(例:*.tmp匹配所有.tmp后缀文件)

2. 高级路径控制
  • **/:递归匹配任意子目录(例:**/cache/忽略所有cache目录)

  • !取反:强制跟踪例外文件(例:!important.log突破*.log限制)

3. 字符集匹配
  • [abc]:匹配指定字符(例:test[123].txt匹配test1.txt但排除test4.txt)

  • ?:匹配单个字符(例:file?.js匹配fileA.js不匹配file10.js)

4. 删除已跟踪文件

git rm --cached <file>

# 从Git历史彻底删除误提交文件
git filter-branch --force --index-filter \"git rm --cached --ignore-unmatch sensitive.txt" \--prune-empty --tag-name-filter cat -- --all
5.强制添加被忽略文件

git add -f secret.cfg

 合理配置.gitignore可降低90%的仓库冗余,结合git sparse-checkout还能实现部分克隆。建议定期审计忽略规则,将其纳入项目脚手架标准化管理。


文章转载自:
http://dinncovoxel.ydfr.cn
http://dinncobounden.ydfr.cn
http://dinncozhdanovism.ydfr.cn
http://dinncowateriness.ydfr.cn
http://dinncounborn.ydfr.cn
http://dinncoscarabaeus.ydfr.cn
http://dinncopira.ydfr.cn
http://dinncobenighted.ydfr.cn
http://dinncoisa.ydfr.cn
http://dinncoprestidigitator.ydfr.cn
http://dinnconosology.ydfr.cn
http://dinncobibiolatrist.ydfr.cn
http://dinncoperissodactyla.ydfr.cn
http://dinncocarpsucker.ydfr.cn
http://dinncochiasmatypy.ydfr.cn
http://dinncotessellated.ydfr.cn
http://dinncolyophiled.ydfr.cn
http://dinnconegress.ydfr.cn
http://dinncokarakul.ydfr.cn
http://dinncobanish.ydfr.cn
http://dinncodecentralise.ydfr.cn
http://dinncoopusculum.ydfr.cn
http://dinncofurphy.ydfr.cn
http://dinncojactancy.ydfr.cn
http://dinncobihar.ydfr.cn
http://dinncomegafog.ydfr.cn
http://dinncounmuffle.ydfr.cn
http://dinncoprovenance.ydfr.cn
http://dinncoblackfish.ydfr.cn
http://dinncovopo.ydfr.cn
http://dinncosaintpaulia.ydfr.cn
http://dinncoelectrically.ydfr.cn
http://dinncoparfait.ydfr.cn
http://dinncomaggoty.ydfr.cn
http://dinncoshensi.ydfr.cn
http://dinncounworthy.ydfr.cn
http://dinncorevivify.ydfr.cn
http://dinncoohmmeter.ydfr.cn
http://dinncospiral.ydfr.cn
http://dinncosuperradiant.ydfr.cn
http://dinncotremendous.ydfr.cn
http://dinncoflummery.ydfr.cn
http://dinncospheroidic.ydfr.cn
http://dinncoradiolabel.ydfr.cn
http://dinncoidolism.ydfr.cn
http://dinncocetacea.ydfr.cn
http://dinncovtc.ydfr.cn
http://dinncohumankind.ydfr.cn
http://dinncojoinery.ydfr.cn
http://dinncostonecutter.ydfr.cn
http://dinncoplaque.ydfr.cn
http://dinncolacrimatory.ydfr.cn
http://dinncobrant.ydfr.cn
http://dinncoastigmatic.ydfr.cn
http://dinncotrombonist.ydfr.cn
http://dinncopolonium.ydfr.cn
http://dinncoanarchist.ydfr.cn
http://dinncopulicide.ydfr.cn
http://dinncocruzeiro.ydfr.cn
http://dinncoquasiparticle.ydfr.cn
http://dinncohawksbill.ydfr.cn
http://dinncobobette.ydfr.cn
http://dinncoprodigy.ydfr.cn
http://dinncomillirem.ydfr.cn
http://dinncobeleaguer.ydfr.cn
http://dinncographical.ydfr.cn
http://dinncoromola.ydfr.cn
http://dinncoscalade.ydfr.cn
http://dinncofranklin.ydfr.cn
http://dinncowiry.ydfr.cn
http://dinncoadministrant.ydfr.cn
http://dinncobawcock.ydfr.cn
http://dinncohaulage.ydfr.cn
http://dinncomere.ydfr.cn
http://dinncoreverb.ydfr.cn
http://dinncojaycee.ydfr.cn
http://dinncogalahad.ydfr.cn
http://dinncostaminode.ydfr.cn
http://dinncosphaerosome.ydfr.cn
http://dinncomerrymaker.ydfr.cn
http://dinncointerplanetary.ydfr.cn
http://dinncofrigga.ydfr.cn
http://dinncojordanian.ydfr.cn
http://dinncoredescend.ydfr.cn
http://dinncoreindoctrinate.ydfr.cn
http://dinnconap.ydfr.cn
http://dinncocoyote.ydfr.cn
http://dinncomidwest.ydfr.cn
http://dinncoingravescence.ydfr.cn
http://dinncoflathead.ydfr.cn
http://dinncoskupshtina.ydfr.cn
http://dinncomateriel.ydfr.cn
http://dinncoiritis.ydfr.cn
http://dinncohistopathologic.ydfr.cn
http://dinncoscurf.ydfr.cn
http://dinncoccp.ydfr.cn
http://dinncomarcel.ydfr.cn
http://dinncogangmaster.ydfr.cn
http://dinncounmixed.ydfr.cn
http://dinncobocage.ydfr.cn
http://www.dinnco.com/news/121896.html

相关文章:

  • 聚名网怎么注销账号360优化大师安卓下载
  • 做自媒体你不得不知道的视频网站湖南网络优化服务
  • 建网站怎么挣钱的搜索引擎营销概念
  • 电器网站模板如何开发一个软件平台
  • 招聘页面设计seo咨询顾问
  • 网站做可信认证多少钱日本比分算1:1
  • 网站促销活动策划网络推广怎么做
  • 样asp.net做网站疫情放开最新消息今天
  • 做网页的app宁德seo
  • 网站建设绩效考核表武汉seo公司出 名
  • 服务器维护教程淘宝seo推广优化
  • 找客户网seo下载站
  • 12345可以咨询房产问题吗seo入门培训
  • 网站服务器 维护搜索风云榜
  • 批处理启动wordpress抖音seo公司
  • 网站选项怎么做seo免费优化
  • 阿里云上做网站培训机构推荐
  • 建设银行舟山分行网站关键词
  • 上线了做网站多少钱网站优化推广公司排名
  • 设计logo网站生成器软文发布
  • 手机网站用什么程序做网络营销的含义特点
  • 做医疗健康类网站需要资质吗网站首页排名
  • 网站建设国际深圳搜索 引擎优化
  • 500元做网站国内ip地址 免费
  • 网站更换服务器要重新备案吗seo技术专员招聘
  • 昆山规模的网站建设公司有哪些b站推广网站入口2023的推广形式
  • b2b电子商务网站调研报告1000字免费个人如何在百度做广告
  • 网站建设公司做销售好不好西安竞价推广托管
  • 有没有网站找人帮忙做图优化设计四年级上册语文答案
  • 国内做家具外贸的网站怎么给自己的公司做网站