热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

vuegit课程_GitEssentials速成课程

vuegit课程介绍这不是Java,而是几个新手开发人员提出了相同的问题,如何使用GIT以及GIT的工作原理,所以就这样了……您曾经在SV

vue git课程

介绍

这不是Java,而是几个新手开发人员提出了相同的问题,如何使用GIT以及GIT的工作原理,所以就这样了……

您曾经在SVN工作吗? 好吧,忘记一切,让我们重新开始

什么是GIT回购?

通常有两个镜像存储库。 您的本地存储库和远程存储库。 是的两个回购。 团队中的每个人都有整个回购的实际副本,因此即使远程服务器死了,您也可以再次设置它,然后将回购推入(破坏)回购服务器。

您的本地存储库由git维护的三棵“树”组成:

  • 包含实际文件的工作目录。 的
  • 作为分期的索引
  • HEAD,指向您所做的最后一次提交。

因此,让我们开始速成课程...

创建一个新的git仓库。

#Start a git repository in the particular path git init

检出存储库

#Create a working copy of a local repository by running the command git clone /path/to/repository #When using a remote server, your command will be git clone [email protected git clone [email protected ]:/path/to/repository

添加并提交

#Shows current branch status and lists files that have changes. #First it lists files in the Stage (to be committed) #And below go the files that are not staged. git status #You can propose changes (add it to the Index) using git add #Or if you want to add everything git add . #Or even git add --all #To actually commit these changes use git commit -m "An awesome commit message :p" #If a file was added to the stage by mistake undo a stage git reset particularFile.extension #Reseting code by deleting all changes. HEAD is the latest local commit git reset --hard HEAD #Same as above but N commits back. git reset --hard HEAD~N #Reset code but keep changes locally. (usefull #Reset code but keep changes locally. (usefull for uncommiting a not pushed mistake) #Use HEAD~ 2 if a merge occured. git reset --soft HEAD~ 1 #Save local uncommitted changes temporarily git stash #Bring saved changes back git stash apply

检查出门时发生了什么事……

#Use to see changes committed. Commit it can be found by git log git show --pretty= "" --name-only [commitID] Pushing changes #Your changes are now in the HEAD of your local working copy. To send those changes to your remote repository in your desired branch, execute git push origin Branching

更新和合并

#You can study repository history using and get commit id if needed #You can study repository history using and get commit id git log

如何使用git bisect发现错误

这东西坏了! 上周工作了! 发生了什么? 我们能否指出破坏它的代码!

是的,我们过去都进行过对话...假设我们有良好提交消息 (这是另一个帖子主题,但继续进行),我们将使用git bisect。

您为git bisect提供了两个点,一个良好的时间点和一个不良的时间点。 假设这些是提交HEAD和134245634bkl2730bc5der。 它将时间一分为二,并在这之间给您提交。 如果代码正确,则将其标记为GOOD,否则将其标记为BAD。 经过一些迭代后,您将进入导致问题的提交。 查看下面的例子

git bisect start HEAD 134245634bkl2730bc5der Bisecting: 4 revisions left to test after this (roughly 2 steps) [3453lj45b3ljhrgo2ug42bbh98112] Revert "Refactored hello() method to pass sonar" #test your code here git bisect bad #or use a script that exits 1 git bisect bad #or use a script that exits Bisecting: 2 revisions left to test after this (roughly 1 step) [x7y435h34r87yhndfdsf0dsfw3452] Added some nice staff I found on the web git bisect good #or use a script that exits 0 git bisect good #or use a script that exits Bisecting: 0 revisions left to test after this (roughly 0 steps) [234fy435h45b09jdfdsf0dsfw3452] Added ability to fly like superman git bisect bad 234fy435h45b09jdfdsf0dsfw3452is the first bad commit commit 234fy435h45b09jdfdsf0dsfw3452 Author: Alexius [email protected Author: Alexius [email protected ] Date: Sat Oct 12 15 : 40 : 46 2019 Added ability to fly like superman bisect run success

那就是您需要的有关GIT的所有信息!
请享用!

翻译自: https://www.javacodegeeks.com/2019/10/git-essentials-crash-course.html

vue git课程



推荐阅读
  • 本文介绍了如何使用JQuery实现省市二级联动和表单验证。首先,通过change事件监听用户选择的省份,并动态加载对应的城市列表。其次,详细讲解了使用Validation插件进行表单验证的方法,包括内置规则、自定义规则及实时验证功能。 ... [详细]
  • 本文详细介绍了Java编程语言中的核心概念和常见面试问题,包括集合类、数据结构、线程处理、Java虚拟机(JVM)、HTTP协议以及Git操作等方面的内容。通过深入分析每个主题,帮助读者更好地理解Java的关键特性和最佳实践。 ... [详细]
  • Android LED 数字字体的应用与实现
    本文介绍了一种适用于 Android 应用的 LED 数字字体(digital font),并详细描述了其在 UI 设计中的应用场景及其实现方法。这种字体常用于视频、广告倒计时等场景,能够增强视觉效果。 ... [详细]
  • 本文详细介绍了 Apache Jena 库中的 Txn.executeWrite 方法,通过多个实际代码示例展示了其在不同场景下的应用,帮助开发者更好地理解和使用该方法。 ... [详细]
  • Explore a common issue encountered when implementing an OAuth 1.0a API, specifically the inability to encode null objects and how to resolve it. ... [详细]
  • 1:有如下一段程序:packagea.b.c;publicclassTest{privatestaticinti0;publicintgetNext(){return ... [详细]
  • 本文深入探讨 MyBatis 中动态 SQL 的使用方法,包括 if/where、trim 自定义字符串截取规则、choose 分支选择、封装查询和修改条件的 where/set 标签、批量处理的 foreach 标签以及内置参数和 bind 的用法。 ... [详细]
  • 本文详细介绍了Java中org.eclipse.ui.forms.widgets.ExpandableComposite类的addExpansionListener()方法,并提供了多个实际代码示例,帮助开发者更好地理解和使用该方法。这些示例来源于多个知名开源项目,具有很高的参考价值。 ... [详细]
  • RecyclerView初步学习(一)
    RecyclerView初步学习(一)ReCyclerView提供了一种插件式的编程模式,除了提供ViewHolder缓存模式,还可以自定义动画,分割符,布局样式,相比于传统的ListVi ... [详细]
  • 本文详细介绍了如何在 Spring Boot 应用中通过 @PropertySource 注解读取非默认配置文件,包括配置文件的创建、映射类的设计以及确保 Spring 容器能够正确加载这些配置的方法。 ... [详细]
  • 本文详细介绍了Java中org.w3c.dom.Text类的splitText()方法,通过多个代码示例展示了其实际应用。该方法用于将文本节点在指定位置拆分为两个节点,并保持在文档树中。 ... [详细]
  • 在现代网络环境中,两台计算机之间的文件传输需求日益增长。传统的FTP和SSH方式虽然有效,但其配置复杂、步骤繁琐,难以满足快速且安全的传输需求。本文将介绍一种基于Go语言开发的新一代文件传输工具——Croc,它不仅简化了操作流程,还提供了强大的加密和跨平台支持。 ... [详细]
  • 本文详细介绍了 Java 中 org.apache.xmlbeans.SchemaType 类的 getBaseEnumType() 方法,提供了多个代码示例,并解释了其在不同场景下的使用方法。 ... [详细]
  • 本文详细记录了在银河麒麟操作系统和龙芯架构上使用 Qt 5.15.2 进行项目打包时遇到的问题及解决方案,特别关注于 linuxdeployqt 工具的应用。 ... [详细]
  • VSCode与Gitee集成:项目提交的高效实践
    本文介绍如何利用VSCode内置的Git工具将项目提交到Gitee,简化Git命令的使用,提升代码管理效率。同时分享一些常见的踩坑经验和解决方案。 ... [详细]
author-avatar
小丽之家ko
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有