热门标签 | 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课程



推荐阅读
  • 本文介绍了Redis的基础数据结构string的应用场景,并以面试的形式进行问答讲解,帮助读者更好地理解和应用Redis。同时,描述了一位面试者的心理状态和面试官的行为。 ... [详细]
  • 一、路由首先需要配置路由,就是点击good组件进入goodDetail组件配置路由如下{path:goodDetail,component:goodDetail}同时在good组件中写入如下点击事件,路由中加入 ... [详细]
  • Java容器中的compareto方法排序原理解析
    本文从源码解析Java容器中的compareto方法的排序原理,讲解了在使用数组存储数据时的限制以及存储效率的问题。同时提到了Redis的五大数据结构和list、set等知识点,回忆了作者大学时代的Java学习经历。文章以作者做的思维导图作为目录,展示了整个讲解过程。 ... [详细]
  • 本文介绍了在mac环境下使用nginx配置nodejs代理服务器的步骤,包括安装nginx、创建目录和文件、配置代理的域名和日志记录等。 ... [详细]
  • 树莓派语音控制的配置方法和步骤
    本文介绍了在树莓派上实现语音控制的配置方法和步骤。首先感谢博主Eoman的帮助,文章参考了他的内容。树莓派的配置需要通过sudo raspi-config进行,然后使用Eoman的控制方法,即安装wiringPi库并编写控制引脚的脚本。具体的安装步骤和脚本编写方法在文章中详细介绍。 ... [详细]
  • 本文介绍了GregorianCalendar类的基本信息,包括它是Calendar的子类,提供了世界上大多数国家使用的标准日历系统。默认情况下,它对应格里高利日历创立时的日期,但可以通过调用setGregorianChange()方法来更改起始日期。同时,文中还提到了GregorianCalendar类为每个日历字段使用的默认值。 ... [详细]
  • 本文介绍了一个React Native新手在尝试将数据发布到服务器时遇到的问题,以及他的React Native代码和服务器端代码。他使用fetch方法将数据发送到服务器,但无法在服务器端读取/获取发布的数据。 ... [详细]
  • CentOS7.8下编译muduo库找不到Boost库报错的解决方法
    本文介绍了在CentOS7.8下编译muduo库时出现找不到Boost库报错的问题,并提供了解决方法。文章详细介绍了从Github上下载muduo和muduo-tutorial源代码的步骤,并指导如何编译muduo库。最后,作者提供了陈硕老师的Github链接和muduo库的简介。 ... [详细]
  • node.jsurlsearchparamsAPI哎哎哎 ... [详细]
  • 从批量eml文件中提取附件的Python代码实现方法
    本文介绍了使用Python代码从批量eml文件中提取附件的实现方法,包括获取eml附件信息、递归文件夹下所有文件、创建目的文件夹等步骤。通过该方法可以方便地提取eml文件中的附件,并保存到指定的文件夹中。 ... [详细]
  • 初始化初始化本地空版本库,仓库,英文名repositorymkdirtest&&cdtestgitinit克隆项目到本地gitclone远程同 ... [详细]
  • php设置数组大小_【大厂必备】2020超经典PHP面试题
    结合我自己这段时间的面试情况,面对的一些php面试题列举出来,基本上结合自己的看法回答的,不妥的地方请大家指出去,与大家一起 ... [详细]
  • 先记住几个专用名词,如下:Workspace:工作区IndexStage:暂存区Repository:仓库区(或本地仓库)Remote:远程仓库一、新建代码库#在当前目录新建一个G ... [详细]
  • 使用npmi编译vue项目出现无法下载github.com中的对应的包源文件报错信息如下:npmERR!fatal:unabletoaccess'https:github ... [详细]
  • 1jdk去网站下载,然后拷贝到linux上;或直接wgethttp:download.oracle.comotn-pubjavajdk8u181-b1 ... [详细]
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社区 版权所有