Git Study Notes

合集下载

git基本命令

git基本命令
3、引用操作相关命令 命令 简要说明 git check-ref-format 检查引用名称是否符合规范 git for-each-ref 引用迭代器,用于shell编程 git ls-remote 显示远程版本库的引用 git name-rev 将提交ID显示为友好名称 git peek-remote* 过时命令,请使用 git ls-remote git rev-list 显示版本范围 git show-branch 显示分支列表及拓扑关系 git show-ref 显示本地引用 git symbolic-ref 显示或者设置符号引用 git update-ref 更新引用的指向 git verify-tag 校验 GPG 签名的Tag
4、版本库管理相关命令
命令 简要说明 git count-objects 显示松散对象的数量和磁盘占用 git filter-branch 版本库重构 git fsck 对象库完整性检查 git fsck-objects* 同义词,等同于 git fsck git gc 版本库存储优化 git index-pack 从打包文件创建对应的索引文件 git lost-found* 过时,请使用 git fsck –lost-found 命令 git pack-objects 从标准输入读入对象ID,打包到文件 git pack-redundant 查找多余的 pack 文件 git pack-refs 将引用打包到 .git/packed-refs 文件中 git prune 从对象库删除过期对象 git prune-packed 将已经打包的松散对象删除 git relink 为本地版本库中相同的对象建立硬连接 git repack 将版本库未打包的松散对象打包 git show-index 读取包的索引文件,显示打包文件中的内容 git unpack-objects 从打包文件释放文件 git verify-pack 校验对象库打包文件

Git学习文档

Git学习文档

Git学习⽂档#########################################################Study Document for Git#########################################################Git 基础Git ⽂件的三种状态:已提交(committed)、已修改(modified)和已暂存(staged)。

Git ⼯作⽬录的状态:已跟踪和未跟踪。

已提交表⽰数据已经安全的保存在本地数据库中。

已修改表⽰修改了⽂件,但还没保存到数据库中。

已暂存表⽰对⼀个已修改⽂件的当前版本做了标记,使之包含在下次提交的快照中。

基本的 Git ⼯作流程如下:1. 在⼯作⽬录中修改⽂件。

2. 暂存⽂件,将⽂件的快照放⼊暂存区域。

3. 提交更新,找到暂存区域的⽂件,将快照永久性存储到 Git 仓库⽬录。

Git 语法设置 Git 的配置git config --listgit config --global ***git config --global user.email @.comgit helpgit help verbgit verb --help克隆远端仓库git clone url检查当前⽂件状态git status列出当前分⽀和⽂件的状态:已跟踪/未跟踪。

[***@*** deployment]$ git status# On branch master# Untracked files:# (use "git add <file>..." to include in what will be committed)## test.mdnothing added to commit but untracked files present (use "git add" to track)跟踪新⽂件git add file[***@*** deployment]$ git add test.md[***@*** deployment]$ git status# On branch master# Changes to be committed:# (use "git reset HEAD file..." to unstage)## new file: test.md#Changes to be committed: 已暂存状态。

如何自学计算机编程

如何自学计算机编程

如何自学计算机编程如何自学计算机编程如何自学计算机编程1.明确学习目的学习编程对大多数IT业人员来说都是非常有用的。

学编程,做一名编程人员,从个人角度讲,可以解决在软件使用中所遇到的问题,改进现有软件,可以为自己找到一份理想的工作添加重要得砝码,有利于在求职道路上谋得一个好的职位;从国家的角度,可以为中国的软件产业做出应有的贡献,一名优秀的程序员永远是被争夺的对象。

学习编程还能锻炼思维,使我们的逻辑思维更加严密;能够不断享受到创新的乐趣,将一直有机会走在高科技的前沿,因为程序设计本身是一种创造性的工作。

知识经济时代给我们带来了无限的机会,要想真正掌握计算机技术,并在IT行业里干出一番事业来,有所作为,具有一定的编程能力是一个基本条件和要求。

2.打好基础学编程要具备一定的基础,总结之有以下几方面:(1)数学基础从计算机发展和应用的历史来看计算机的数学模型和体系结构等都是有数学家提出的,最早的计算机也是为数值计算而设计的。

因此,要学好计算机就要有一定的数学基础,出学者有高中水平就差不多了。

(2)逻辑思维能力的培养学程序设计要有一定的逻辑思维能力,“逻思力”的培养要长时间的实践锻炼。

要想成为一名优秀的程序员,最重要的是掌握编程思想。

要做到这一点必须在反复的实践、观察、分析、比较、总结中逐渐地积累。

因此在学习编程过程中,我们不必等到什么都完全明白了才去动手实践,只要明白了大概,就要敢于自己动手去体验。

谁都有第一次。

有些问题只有通过实践后才能明白,也只有实践才能把老师和书上的知识变成自己的,高手都是这样成材的。

(3)选择一种合适的入门语言面对各种各样的语言,应按什么样的顺序学呢?程序设计工具不外乎如下几类:1)本地开发应用软件开发的工具有:VisualBasic、Delphi、VC++(C++Builder)等;数据库开发工具有:VisualFoxpro、OracleDeveloper、PowerBuilder等。

git notes 用法

git notes 用法

git notes 用法Git Notes 是 Git 版本控制系统的一个功能,它允许用户向Git 数据库中的对象添加注释信息。

这些注释信息可以用来记录额外的元数据,比如用来记录某个提交的相关信息或者备注。

下面我将从多个角度来介绍 Git Notes 的用法。

1. 添加注释:要向一个对象(比如提交、树、标签等)添加注释,可以使用以下命令:git notes add -m "Your note message" <object>。

其中,`<object>` 可以是提交的 SHA-1 标识、分支名或者其他引用。

2. 显示注释:要显示一个对象的注释内容,可以使用以下命令:git notes show <object>。

这将会显示指定对象的注释内容。

3. 编辑注释:如果需要编辑已存在的注释,可以使用以下命令:git notes edit <object>。

这将会打开文本编辑器,允许你编辑已存在的注释内容。

4. 显示所有注释:要显示所有对象的注释,可以使用以下命令:git notes list.这将列出所有对象的注释信息。

5. 删除注释:要删除一个对象的注释,可以使用以下命令:git notes remove <object>。

这将会删除指定对象的注释。

总之,Git Notes 提供了一种灵活的方式来向 Git 对象添加注释信息,帮助用户更好地管理和理解版本控制系统中的数据。

通过上述介绍,我希望你能对 Git Notes 的用法有一个全面的了解。

git常用命令

git常用命令
合并分支:
直接合并:
git merge 想合并到当前分支的源分支名
git merge —no-commit 分支 //合并但不提交
压合合并:将分支压合成一条commit记录,并合并过来
git merge —squash 某bug分支
git commit -m "修复某bug"
拣选合并:只合并一个提交
git add forgotten_file
git commit --amend
如果没有修改就相当于更改提交说明,上边3个命令得到一个提交.
忽略提交的文件:
所有人都需要忽略的文件要写在.gitignore文件里,而只有自己的个人偏好需要忽略的文件要写在.git/info/exclude文件中
git log —since "5 hours"
—since "3 hours"
—since "1 minute"
—before ="2008-10.01"
git log 27j34j3j..03u43u23 //最老版本..最新版本(不包括起点只包括终点)
git log 34j4j4..HEAD
git tag 1.0 RB_1.0 //基于RB_1.0分支的最新踢脚创建标签
git tag 1.0 ae468d8kt //为某次提交创建标签
检出标签:
git checkout 1.0 //检出标签与检出分支一样操作,但检出标签后用git branch查看本地分支会发现你现在不再任何分支上
查看分支:
git branch //列出本地分支
iss53

GIT使用入门详细教程

GIT使用入门详细教程

GIT使用入门Part 1第一章基本原理git是一个版本控制系统。

官方的解释是:版本控制(Revision control)是一种软件工程技巧,籍以在开发的过程中,确保由不同人所编辑的同一档案都得到更新。

按我的白话文解释就是:一群志同道合的人身处祖国各地,希望来合作开发一个项目,假设这个项目是使用c语言写的(当然用任何语言都可以的)。

那么大家怎么合作呢?用信件?效率太低。

用邮件,不好实现多人沟通。

用googlegroup吧,可开发阶段中的源代码没法科学管理。

用自建的网站吧,需要人力物力财力来支撑阿。

这个时候版本控制系统就派上用场了。

它可以让一个团队里的不同的人在不同地点、不同时间开发和改进同一个项目,并且在大部分的时间里,版本控制系统会聪明的帮你把不同的人在不同地点不同时间修改的代码融合到项目中去。

(当然在一些特殊的情况,还是需要人去决定到底哪些代码需要加入到项目中,这个在后面讨论不迟,先让大家对版本控制有一个好印象,呵呵)知道了版本控制系统的优点之后,下面就要具体实践和体验了。

建议你选用的版本控制系统包括:rcs,cvs,svn,git,Mercurial,Bazzar等等。

当然git,Mercurial和Bazzar都是属于分布式版本控制系统。

下面是一些网友对于这些版本控制系统评论的只言片语:1)svk配合svn可以实现分布式的版本控制。

2) 我是从SVN转到Git下的。

我想Git的优势是速度飞快,谁用谁知道!3) git的确是最快的,bzr慢的要死4) SVN 在windows 下有TortoiseSVN5) git 有Windows 版本,在google code 上的项目。

/p/msysgit/6) 大家可以试试国内提供的git服务。

那么,简单地说,Git 究竟是怎样的一个系统呢?请注意,接下来的内容非常重要,若是理解了Git 的思想和基本的工作原理,用起来就会知其所以然,游刃有余。

在开始学习Git 的时候,请不要尝试把各种概念和其他的版本控制系统诸如Subversion 和Perforce 等相比拟,否则容易混淆每个操作的实际意义。

【前端开发环境】前端使用GIT管理代码仓库需要掌握的几个必备技巧和知识点总结

【前端开发环境】前端使用GIT管理代码仓库需要掌握的几个必备技巧和知识点总结

【前端开发环境】前端使⽤GIT管理代码仓库需要掌握的⼏个必备技巧和知识点总结1. Git的三种状态已提交 committed已暂存 staged已修改 modified2. Git的三个区域1. Git仓库是 Git ⽤来保存项⽬的元数据和对象数据库的地⽅。

这是 Git 中最重要的部分,从其它计算机克隆仓库时,拷贝的就是这⾥的数据。

2. 暂存区域暂存区域是⼀个⽂件,保存了下次将提交的⽂件列表信息,⼀般在 Git 仓库⽬录中。

有时候也被称作`‘索引’',不过⼀般说法还是叫暂存区域。

3. ⼯作⽬录⼯作⽬录是对项⽬的某个版本独⽴提取出来的内容。

这些从 Git 仓库的压缩数据库中提取出来的⽂件,放在磁盘上供你使⽤或修改。

3. 基本的 Git ⼯作流程1. 在⼯作⽬录修改⽂件2. 暂存⽂件,将⽂件的快照放⼊暂存区3. 提交更新,找到暂存去⽂件,将快照永久性存储到 Git 仓库⽬录。

3.1 ⽤户信息[!NOTE]当安装完 Git 应该做的第⼀件事就是设置你的⽤户名称与邮件地址。

这样做很重要,因为每⼀个 Git 的提交都会使⽤这些信息,并且它会写⼊到你的每⼀次提交中,不可更改。

git config --global "huyaocode"git config --global user.email johndoe@3.2 加⼊暂存区git add ⽂件名或路径3.3 忽略⽂件创建⼀个.gitignore⽂件,可描述需要忽略的⽂件。

参考# no .a files*.a# but do track lib.a, even though you're ignoring .a files above!lib.a# 只忽略当前⽂件夹下已 TODO 为名的⽂件/TODO# 忽略当前⽬录下 build 这个⽂件夹build/# ignore doc/notes.txt, but not doc/server/arch.txtdoc/*.txt# ignore all .pdf files in the doc/ directorydoc/**/*.pdf3.4 状态修改git status -s将每个修改状态以⼀⾏展⽰,也可以⽤git status多⾏展⽰。

常用git命令以及idea中git的用法总结

常用git命令以及idea中git的用法总结

常⽤git命令以及idea中git的⽤法总结前⾔最近本⼈将⼀些代码放到了github上,顺便总结了⼀下git的⽤法;经过了各种百度,最终形成了以下这篇⽂章。

个⼈感觉追求效率的话,只看最后⼀条git常⽤命令即可。

前⾯的似乎有⽤,⼜似乎没⽤......Git使⽤⽅法简介Git 是⼀个开源的分布式版本控制系统,⽤于敏捷⾼效地处理任何或⼩或⼤的项⽬。

Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发⽽开发的⼀个开放源码的版本控制软件。

Git 与常⽤的版本控制⼯具 CVS, Subversion 等不同,它采⽤了分布式版本库的⽅式,不必服务器端软件⽀持。

安装Git⼯作流程⼀般⼯作流程如下:1.克隆 Git 资源作为⼯作⽬录。

2.在克隆的资源上添加或修改⽂件。

3.如果其他⼈修改了,你可以更新资源。

4.在提交前查看修改。

5.提交修改。

6.在修改完成后,如果发现错误,可以撤回提交并再次修改并提交。

下图展⽰了 Git 的⼯作流程:Git ⼯作区、暂存区和版本库⼯作区:就是你在电脑⾥能看到的⽬录。

暂存区:英⽂叫stage, 或index。

⼀般存放在 ".git⽬录下" 下的index⽂件(.git/index)中,所以我们把暂存区有时也叫作索引(index)。

版本库:⼯作区有⼀个隐藏⽬录.git,这个不算⼯作区,⽽是Git的版本库。

下⾯这个图展⽰了⼯作区、版本库中的暂存区和版本库之间的关系:图中左侧为⼯作区,右侧为版本库。

在版本库中标记为 "index" 的区域是暂存区(stage, index),标记为 "master" 的是 master 分⽀所代表的⽬录树。

图中我们可以看出此时 "HEAD" 实际是指向 master 分⽀的⼀个"游标"。

所以图⽰的命令中出现 HEAD 的地⽅可以⽤ master 来替换。

Git ReleaseNotes

Git ReleaseNotes

Git Release Notes (Git-1.7.4-preview20110204)Last update: 4 February 2011IntroductionThese release notes describe issues specific to the Git for Windows release.General release notes covering the history of the core git commands are included in the subdirectory doc/git/html of the installation directory. Look for files starting with RelNotes.See / for further details about Git including ports to other operating systems. Git for Windows is hosted at /.Known issues∙Some commands are not yet supported on Windows and excluded from the installation;namely: git archimport, git cvsexportcommit, git cvsimport, git cvsserver, git instaweb, git shell.∙The Logitec QuickCam software can cause spurious crashes. See "Why does make often crash creating a sh.exe.stackdump file when I try to compile my source code?" on theMinGW Wiki (/wiki/Environment_issues)∙The Quick Launch icon will only be installed for the user running setup (typically the Administrator). This is a technical restriction and will not change.∙curl uses $HOME/_netrc instead of $HOME/.netrc.∙If you want to specify a different location for --upload-pack, you have to start the absolute path with two slashes. Otherwise MSys will mangle the path.∙git and bash have serious problems with non-ASCII file names (Issue 80, 159).∙If configured to use plink, you will have to connect with putty first and accept the host key.∙As merge tools are executed using the MSys bash, options starting with "/" need to be handled specially: MSys would interpret that as a POSIX path, so you need to double the slash (Issue 226). Example: instead of "/base", say "//base". Also, extra care has to be paid to pass Windows programs Windows paths, as they have no clue about MSys style POSIX paths -- You can use something like $(cmd //c echo "$POSIXPATH").Changes since Git-1.7.3.2-preview20101025New Features∙Comes with Git 1.7.4 plus patches.∙Includes antiword to enable viewing diffs of .doc files∙Includes poppler to enable viewing diffs of .pdf files∙Removes cygwin paths from the bash shell PATHBugfixes∙Please refer to the release notes for official Git 1.7.4Changes since Git-1.7.3.1-preview20101002New Features∙Comes with Git 1.7.3.2 plus patches.Changes since Git-1.7.2.3-preview20100911New Features∙Comes with Git 1.7.3.1 plus patches.∙Updated to Vim 7.3, file-5.04 and InnoSetup 5.3.11Bugfixes∙Issue 528 (remove uninstaller from Start Menu) was fixed∙Issue 527 (failing to find the certificate authority bundle) was fixed∙Issue 524 (remove broken and unused sdl-config file) was fixed∙Issue 523 (crash pushing to WebDAV remote) was fixedChanges since Git-1.7.1-preview20100612New Features∙Comes with Git 1.7.2.3 plus patches.Bugfixes∙Issue 519 (build problem with compat/regex/regexec.c) was fixed∙Issue 430 (size of panes not preserved in git-gui) was fixed∙Issue 411 (git init failing to work with CIFS paths) was fixed∙Issue 501 (failing to clone repo from root dir using relative path) was fixedChanges since Git-1.7.0.2-preview20100309New Features∙Comes with Git 1.7.1 plus patches.Bugfixes∙Issue 27 (git-send-mail not working properly) was fixed again∙Issue 433 (error while running git svn fetch) was fixed∙Issue 427 (Gitk reports error: "couldn't compile regular expression pattern: invalid repetition count(s)") was fixed∙Issue 192 (output truncated) was fixed again∙Issue 365 (Out of memory? mmap failed) was fixed∙Issue 387 (gitk reports "error: couldn't execute "git:" file name too long") was fixed∙Issue 409 (checkout of large files to network drive fails on XP) was fixed∙Issue 428 (The return value of git.cmd is not the same as git.exe) was fixed∙Issue 444 (Git Bash Here returns a "File not found error" in Windows 7 Professional - 64 bits) was fixed∙Issue 445 (git help does nothing) was fixed∙Issue 450 ("git --bare init" shouldn't set the directory to hidden.) was fixed∙Issue 456 (git script fails with error code 1) was fixed∙Issue 469 (error launch wordpad in last netinstall) was fixed∙Issue 474 (git update-index --index-info silently does nothing) was fixed∙Issue 482 (Add documentation to avoid "fatal: $HOME not set" error) was fixed∙Issue 489 (git.cmd issues warning if %COMSPEC% has spaces in it) was fixed∙Issue 436 ("mkdir : No such file or directory" error while using git-svn to fetch or rebase) was fixed∙Issue 440 (Uninstall does not remove cheetah.) was fixed∙Issue 441 (Git-1.7.0.2-preview20100309.exe installer fails with unwritable msys-1.0.dll when ssh-agent is running) was fixedChanges since Git-1.6.5.1-preview20091022New Features∙Comes with official Git 1.7.0.2.∙Comes with Git-Cheetah (on 32-bit Windows only, for now).∙Comes with connect.exe, a SOCKS proxy.∙Tons of improvements in the installer, thanks to Sebastian Schuberth.∙On Vista, if possible, symlinks are used for the built-ins.∙Features Hany's dos2unix tool, thanks to Sebastian Schuberth.∙Updated Tcl/Tk to version 8.5.8 (thanks Pat Thoyts!).∙By default, only .git/ is hidden, to work around a bug in Eclipse (thanks to Erik Faye-Lund). Bugfixes∙Fixed threaded grep (thanks to Heiko Voigt).∙git gui was fixed for all kinds of worktree-related failures (thanks Pat Thoyts).∙git gui now fully supports themed widgets (thanks Pat Thoyts and Heiko Voigt).∙Git no longer complains about an unset RUNTIME_PREFIX (thanks Johannes Sixt).∙git gui can Explore Working Copy on Windows again (thanks Markus Heidelberg).∙git gui can create shortcuts again (fixes issue 425, thanks Heiko Voigt).∙When "git checkout" cannot overwrite files because they are in use, it will offer to try again, giving the user a chance to release the file (thanks Heiko Voigt).∙Ctrl+W will close gitk (thanks Jens Lehmann).∙git gui no longer binds Ctrl+C, which caused problems when trying to use said shortcut for the clipboard operation "Copy" (fixes issue 423, thanks Pat Thoyts).∙gitk does not give up when the command line length limit is reached (issue 387).∙The exit code is fixed when Git.cmd is called from cmd.exe (thanks Alexey Borzenkov).∙When launched via the (non-Cheetah) shell extension, the window icon is now correct (thanks Sebastian Schuberth).∙Uses a TrueType font for the console, to be able to render UTF-8 correctly.∙Clarified the installer's line ending options (issue 370).∙Substantially speeded up startup time from cmd unless NO_FSTAB_THREAD is set (thanks Johannes Sixt).∙Update msys-1.0.dll yet again, to handle quoted parameters better (thanks Heiko Voigt).∙Updated cURL to a version that supports SSPI.∙Updated tar to handle the pax headers generated by git archive.∙Updated sed to a version that can handle the filter-branch examples.∙.git* files can be associated with the default text editor (issue 397).Changes since Git-1.6.4-preview20090729New Features∙Comes with official git 1.6.5.1.∙Thanks to Johan 't Hart, files and directories starting with a single dot (such as '.git') will now be marked hidden (you can disable this setting with core.hideDotFiles=false in your config) (Issue 288).∙Thanks to Thorvald Natvig, Git on Windows can simulate symbolic links by using reparse points when available. For technical reasons, this only works for symbolic links pointing to files, not directories.∙ A lot of work has been put into making it possible to compile Git's source code (the part written in C, of course, not the scripts) with Microsoft Visual Studio. This work is ongoing. ∙Thanks to Sebastian Schuberth, we only offer the (Tortoise)Plink option in the installer if the presence of Plink was detected and at least one Putty session was found..∙Thanks to Sebastian Schuberth, the installer has a nicer icon now.∙Some more work by Sebastian Schuberth was done on better integration of Plink (Issues 305 & 319).Bugfixes∙Thanks to Sebastian Schuberth, git svn picks up the SSH setting specified with the installer (Issue 305).Changes since Git-1.6.3.2-preview20090608New Features∙Comes with official git 1.6.4.∙Supports https:// URLs, thanks to Erik Faye-Lund.∙Supports send-email, thanks to Erik Faye-Lund (Issue 27).∙Updated Tcl/Tk to version 8.5.7, thanks to Pat Thoyts.Bugfixes∙The home directory is now discovered properly (Issues 108 & 259).∙IPv6 is supported now, thanks to Martin Martin Storsjö (Issue 182).Changes since Git-1.6.3-preview20090507New Features∙Comes with official git 1.6.3.2.∙Uses TortoisePlink instead of Plink if available.Bugfixes∙Plink errors out rather than hanging when the user needs to accept a host key first (Issue96).∙The user home directory is inferred from $HOMEDRIVE\$HOMEPATH instead of $HOME (Issue 108).∙The environment setting $CYGWIN=tty is ignored (Issues 138, 248 and 251).∙The "ls" command shows non-ASCII filenames correctly now (Issue 188).∙Adds more syntax files for vi (Issue 250).∙$HOME/.bashrc is included last from /etc/profile, allowing .bashrc to override all settings in /etc/profile (Issue 255).∙Completion is case-insensitive again (Issue 256).∙The "start" command can handle arguments with spaces now (Issue 258).∙For some Git commands (such as "git commit"), vi no longer "restores" the cursor position. Changes since Git-1.6.2.2-preview20090408New Features∙Comes with official git 1.6.3.∙Thanks to Marius Storm-Olsen, Git has a substantially faster readdir() implementation now. ∙Marius Storm-Olsen also contributed a patch to include nedmalloc, again speeding up Git noticably.∙Compiled with GCC 4.4.0Bugfixes∙Portable Git contains a README.portable.∙Portable Git now actually includes the builtins.∙Portable Git includes git-cmd.bat and git-bash.bat.∙Portable Git is now shipped as a .7z; it still is a self-extracting archive if you rename it to .exe.∙Git includes the Perl Encode module now.∙Git now includes the filter-branch tool.∙There is a workaround for a Windows 7 regression triggering a crash in the progress reporting (e.g. during a clone). This fixes issues 236 and 247.∙gitk tries not to crash when it is closed while reading references (Issue 125, thanks Pat Thoyts).∙In some setups, hard-linking is not as reliable as it should be, so we have a workaround which avoids hard links in some situations (Issues 222 and 229).∙git-svn sets core.autocrlf to false now, hopefully shutting up most of the git-svn reports. Changes since Git-1.6.2.1-preview20090322New Features∙Comes with official git 1.6.2.2.∙Upgraded Tcl/Tk to 8.5.5.∙TortoiseMerge is supported by mergetool now.∙Uses pthreads (faster garbage collection on multi-core machines).∙The test suite passes!Bugfixes∙Renaming was made more robust (due to Explorer or some virus scanners, files could not be renamed at the first try, so we have to try multiple times).∙Johannes Sixt made lots of changes to the test-suite to identify properly which tests should pass, and which ones cannot pass due to limitations of the platform.∙Support PAGERs with spaces in their filename.∙Quite a few changes were undone which we needed in the olden days of msysGit.∙Fall back to / when HOME cannot be set to the real home directory due to locale issues (works around Issue 108 for the moment).Changes since Git-1.6.2-preview20090308New Features∙Comes with official git 1.6.2.1.∙ A portable application is shipped in addition to the installer (Issue 195).∙Comes with a Windows-specific mmap() implementation (Issue 198).Bugfixes∙ANSI control characters are no longer shown verbatim (Issue 124).∙Temporary files are created respecting core.autocrlf (Issue 177).∙The Git Bash prompt is colorful again (Issue 199).∙Fixed crash when hardlinking during a clone failed (Issue 204).∙An infinite loop was fixed in git-gui (Issue 205).∙The ssh protocol is always used with plink.exe (Issue 209).∙More vim files are shipped now, so that syntax highlighting works.Changes since Git-1.6.1-preview20081225New Features∙Comes with official git 1.6.2.∙Comes with upgraded vim 7.2.∙Compiled with GCC 4.3.3.∙The user can choose the preferred CR/LF behavior in the installer now.∙Peter Kodl contributed support for hardlinks on Windows.∙The bash prompt shows information about the current repository.Bugfixes∙If supported by the file system, pack files can grow larger than 2gb.∙Comes with updated msys-1.0.dll (should fix some Vista issues).∙Assorted fixes to support the new libexec/git-core/ layout better.∙Read-only files can be properly replaced now.∙git-svn is included again (original caveats still apply).∙Obsolete programs from previous installations are cleaned up.Changes since Git-1.6.0.2-preview20080923New Features∙Comes with official git 1.6.1.∙Avoid useless console windows.∙Installer remembers how to handle PATH.Changes since Git-1.6.0.2-preview20080921Bugfixes∙ssh works again.∙'git add -p' works again.∙Various programs that aborted with 'Assertion failed: argv0_path' are fixed. Changes since Git-1.5.6.1-preview20080701Removed Features∙git svn is excluded from the end-user installer (see Known Issues).New Features∙Comes with official git 1.6.0.2.Bugfixes∙No Windows-specific bugfixes.Changes since Git-1.5.6-preview20080622New Features∙Comes with official git 1.5.6.1.Bugfixes∙Includes fixed msys-1.0.dll that supports Vista and Windows Server 2008 (Issue 122). ∙cmd wrappers do no longer switch off echo.Changes since Git-1.5.5-preview20080413New Features∙Comes with official git 1.5.6.∙Installer supports configuring a user provided plink (PuTTY).Bugfixes∙Comes with tweaked msys-1.0.dll to solve some command line mangling issues.∙cmd wrapper does no longer close the command window.∙Programs in the system PATH, for example editors, can be launched from Git without specifying their full path.∙"git stash apply stash@{1}" works.∙Comes with basic ANSI control code emulation for the Windows console to avoid wrapping of pull/merge's diffstats.∙Git correctly passes port numbers to PuTTY's plinkChanges since Git-1.5.4-preview20080202New Features∙Comes with official git 1.5.5.∙core.autocrlf is enabled (true) by default. This means git converts to Windows line endings (CRLF) during checkout and converts to Unix line endings (LF) during commit. This is the right choice for cross-platform projects. If the conversion is not reversible, git warns the user.The installer warns about the new default before the installation starts.∙The user does no longer have to "accept" the GPL but only needs to press "continue".∙Installer deletes shell scripts that have been replaced by builtins. Upgrading should be safer. ∙Supports "git svn". Note that the performance might be below your expectation.Bugfixes∙Newer ssh fixes connection failures (issue 74).∙Comes with MSys-1.0.11-20071204. This should solve some "fork: resource unavailable"issues.∙All DLLs are rebased to avoid problems with "fork" on Vista.Changes since Git-1.5.3.6-preview20071126New Features∙Comes with official git 1.5.4.∙Some commands that are not yet suppoted on Windows are no longer included (see Known Issues above).∙Release notes are displayed in separate window.∙Includes qsort replacement to improve performance on Windows 2000.Bugfixes∙Fixes invalid error message that setup.ini cannot be deleted on uninstall.∙Setup tries harder to finish the installation and reports more detailed errors.∙Vim's syntax highlighting is suitable for dark background.Changes since Git-1.5.3.5-preview20071114New Features∙Git is included in version 1.5.3.6.∙Setup displays release notes.Bugfixes∙pull/fetch/push in git-gui works. Note, there is no way for ssh to ask for a passphrase or for confirmation if you connect to an unknown host. So, you must have ssh set up to workwithout passphrase. Either you have a key without passphrase, or you started ssh-agent.You may also consider using PuTTY by pointing GIT_SSH to plink.exe and handle your ssh。

我是个好学生,英文作文

我是个好学生,英文作文

我是个好学生,英文作文I am a diligent and dedicated student who takes my education seriously. From a young age, I have been instilled with the importance of learning and the value of academic achievement. As I have grown older, this passion for knowledge has only intensified, and I strive to excel in all of my studies.One of the key characteristics that defines me as a good student is my strong work ethic. I understand that success in the classroom does not come easily, and I am willing to put in the time and effort required to achieve my goals. This means dedicating myself to my coursework, completing all assignments to the best of my ability, and actively participating in class discussions and activities.I am always eager to learn and am constantly seeking out new information and perspectives. I am not satisfied with simply memorizing facts and regurgitating them on exams. Instead, I strive to truly understand the material, to think critically about it, and to make connections between different concepts and ideas. This curiosity and intellectual curiosity drive me to delve deeper into thesubjects I study, to ask questions, and to explore new areas of knowledge.Another key aspect of my identity as a good student is my strong organizational skills. I am meticulous in my approach to studying and completing assignments, and I have developed effective strategies for managing my time and prioritizing my responsibilities. I maintain detailed notes, create comprehensive study guides, and ensure that I am well-prepared for all of my classes and assessments.In addition to my academic pursuits, I am also actively involved in extracurricular activities that complement and enrich my educational experience. I believe that a well-rounded education is essential for personal growth and development, and I have sought out opportunities to explore my interests and passions beyond the classroom.For example, I am an active member of my school's debate team, where I have honed my critical thinking and public speaking skills. I also volunteer regularly at a local community center, where I have the opportunity to give back to my community and to learn about the diverse perspectives and experiences of others.These extracurricular activities not only provide me with valuable practical experience, but they also help me to develop important softskills such as teamwork, communication, and leadership. I believe that these skills are just as important as academic achievement in preparing me for success in the future, and I am committed to continuing to develop and refine them.One of the things that I am most proud of as a good student is my ability to maintain a positive and resilient attitude in the face of challenges and setbacks. I understand that academic success is not always a straightforward path, and that there will be times when I face obstacles or encounter difficulties. However, I have developed effective strategies for coping with stress and overcoming obstacles, and I am always willing to seek out support and guidance from my teachers, peers, and mentors.For example, when I struggled with a particularly challenging course last semester, I did not simply give up or resign myself to failure. Instead, I sought out extra help from my professor, attended tutoring sessions, and worked tirelessly to improve my understanding of the material. Through my persistence and dedication, I was ultimately able to not only pass the course, but to excel in it.This resilience and determination are key characteristics that I believe define me as a good student. I am not deterred by setbacks or challenges, but rather, I am motivated to overcome them and to continue striving for excellence. This mindset has served me wellthroughout my academic career, and I am confident that it will continue to do so as I move forward.In conclusion, I am a good student because I am deeply committed to my education, I am intellectually curious and engaged, I have strong organizational and time management skills, I am actively involved in extracurricular activities, and I have a resilient and positive attitude in the face of challenges. I am proud of the progress I have made and the successes I have achieved, and I am excited to continue on this journey of lifelong learning and growth.。

git使用简介

git使用简介

git clone --bare git:///schacon/grit.git
git clone --bare . ../grit.git # 如果当前在一个项目的工作目录
git clone --bare ~/space/notes ~/gitroot/space.git
git push origin serverfix:remoteserverfix # 提取我的 serverfix分支 并更新到远程仓库的remoteserverfix分支
git push origin :serverfix # 删除远程分支 serverfix(在这里提取空白然后把它变成[远程分支])
3 patch文件的结构
1 Git 操作指南
1.1 序
Git是分布式版本控制系统,与集中化的版本控制系统相比有以下好处:
每个客户端都是服务器代码仓库的完整镜像,在服务器发生故障时都可以从任一个客户端的代码仓库进行恢复。
可以离线提交。客户端本身就是一个代码仓库,所有操作都是在本地代码仓库进行,在本地仓库也存有项目的历史更新摘要,等到了有网络的时候再上传到远程的镜像仓库。
目录
1 Git 操作指南
1.1 序
1.2 本地仓库操作
1.3 远程仓库操作
1.4 比较不同(git diff)
1.5 抓取(git pull, git fetch)
1.6 推送(git push)
灵活的patch处理
可以push到多个远端仓库
提交、审核、接受、发布的流程控制可随需而定
本地分支成本小,灵活
本指南使用的git版本为 git version 1.6.3.3 。

Git忽略规则.gitignore梳理

Git忽略规则.gitignore梳理

Git忽略规则.gitignore梳理对于经常使⽤Git的朋友来说,.gitignore配置⼀定不会陌⽣。

废话不说多了,接下来就来说说这个.gitignore的使⽤。

⾸先要强调⼀点,这个⽂件的完整⽂件名就是".gitignore",注意最前⾯有个“.”。

⼀般来说每个Git项⽬中都需要⼀个“.gitignore”⽂件,这个⽂件的作⽤就是告诉Git哪些⽂件不需要添加到版本管理中。

实际项⽬中,很多⽂件都是不需要版本管理的,⽐如Python的.pyc⽂件和⼀些包含密码的配置⽂件等等。

这个⽂件的内容是⼀些规则,Git会根据这些规则来判断是否将⽂件添加到版本控制中。

下⾯我们看看常⽤的规则:1)/mtk/ 过滤整个⽂件夹2)*.zip 过滤所有.zip⽂件3)/mtk/do.c 过滤某个具体⽂件很简单吧,被过滤掉的⽂件就不会出现在git仓库中(gitlab或github)了,当然本地库中还有,只是push的时候不会上传。

需要注意的是,gitignore还可以指定要将哪些⽂件添加到版本管理中:1)!*.zip2)!/mtk/one.txt唯⼀的区别就是规则开头多了⼀个感叹号,Git会将满⾜这类规则的⽂件添加到版本管理中。

为什么要有两种规则呢?想象⼀个场景:假如我们只需要管理/mtk/⽬录中的one.txt⽂件,这个⽬录中的其他⽂件都不需要管理,那么我们就需要使⽤:1)/mtk/2)!/mtk/one.txt假设我们只有过滤规则,⽽没有添加规则,那么我们就需要把/mtk/⽬录下除了one.txt以外的所有⽂件都写出来!最后需要强调的⼀点是,如果你不慎在创建.gitignore⽂件之前就push了项⽬,那么即使你在.gitignore⽂件中写⼊新的过滤规则,这些规则也不会起作⽤,Git仍然会对所有⽂件进⾏版本管理。

简单来说,出现这种问题的原因就是Git已经开始管理这些⽂件了,所以你⽆法再通过过滤规则过滤它们。

git学习心得

git学习心得

git学习心得Git is a distributed version control system that allows developers to efficiently manage and collaborate on projects. In my experience, learning Git has been instrumental in improving my programming skills and streamlining my workflow. In this article, I will share my insights and lessons learned from studying Git.1. Understanding the BasicsBefore delving into the more advanced features of Git, it is crucial to grasp the fundamental concepts. Git operates by creating snapshots of a project's entire codebase at different points in time, allowing for easy tracking of changes. It also has a distributed architecture, meaning that multiple developers can work on the same project independently and then merge their changes seamlessly.2. Setting Up GitTo start using Git, you need to install it on your local machine. Once installed, you should configure your Git username and email, which will be associated with your commits. This information is essential for tracking and attributing code changes accurately. Additionally, it is highly recommended to initialize a Git repository for each new project to enable version control.3. Git WorkflowGit follows a branching model that allows developers to work on different features or bug fixes simultaneously. The main branch, typically named "master" or "main," represents the stable version of the project.Developers create new branches from the main branch, make changes, and merge them back into the main branch once they are complete. This workflow ensures that changes are thoroughly tested before being integrated into the main codebase.4. Committing and BranchingThe core of Git revolves around committing changes and creating branches. Commits are snapshots of the project's state at a specific point in time. By creating descriptive and concise commit messages, you can easily track the purpose and details of each commit. Branches, on the other hand, are created to work on new features or bug fixes independently. Regularly committing changes and creating branches helps maintain a clear and organized project history.5. Collaboration with GitGit greatly facilitates collaboration among developers. It allows multiple team members to work on the same project simultaneously without conflicts. Through tools like GitHub or GitLab, developers can push their local repos to a remote server and merge their changes. Features such as pull requests enable code review and ensure that changes are thoroughly examined before being merged into the main branch. Collaboration using Git fosters teamwork and enhances overall project quality.6. Resolving Merge ConflictsAt times, when merging branches or applying changes, conflicts may arise. Merge conflicts occur when Git cannot automatically merge the changes due to conflicting modifications in the same code lines. Resolvingthese conflicts requires carefully reviewing the conflicting sections, identifying the differences, and manually choosing the correct version. Although merge conflicts can be challenging, Git provides powerful tools to help resolve them effectively.7. Branch ManagementMaintaining a well-organized branch structure is crucial for a smooth workflow. Over time, a project may accumulate numerous branches, making it difficult to keep track. Deleting merged branches and using meaningful and consistent naming conventions for branches are essential practices in branch management. Additionally, utilizing tags to mark important milestones or releases simplifies navigation within the repository.8. Git CommandsGit offers a wide range of commands that can be used to perform various operations. While it is not necessary to memorize every command, understanding commonly used ones is beneficial. Some essential commands include git clone for cloning a repository, git add for staging changes, git commit for creating commits, git push for pushing changes to a remote repository, and git pull for syncing a local repo with the remote one.In conclusion, learning Git has been a transformative experience for me as a developer. Its powerful version control capabilities, collaborative features, and efficient workflow management have significantly improved my productivity and code quality. By understanding the basics, following best practices, and utilizing Git commands effectively, developers can harness the full potential of Git and take their projects to new heights.。

Git忽略提交规则.gitignore文件

Git忽略提交规则.gitignore文件

Git忽略提交规则.gitignore⽂件在使⽤Git的过程中,我们喜欢有的⽂件⽐如⽇志,临时⽂件,编译的中间⽂件等不要提交到代码仓库,这时就要设置相应的忽略规则,来忽略这些⽂件的提交。

简单来说⼀个场景:在你使⽤git add .的时候,遇到了把你不想提交的⽂件也添加到了缓存中去的情况,⽐如项⽬的本地配置信息,如果你上传到Git中去其他⼈pull下来的时候就会和他本地的配置有冲突,所以这样的个性化配置⽂件我们⼀般不把它推送到git服务器中,但是⼜为了偷懒每次添加缓存的时候都想⽤git add .⽽不是⼿动⼀个⼀个⽂件添加,该怎么办呢?很简单,git为我们提供了⼀个.gitignore⽂件只要在这个⽂件中申明那些⽂件你不希望添加到git中去,这样当你使⽤git add .的时候这些⽂件就会被⾃动忽略掉。

有三种⽅法可以实现忽略Git中不想提交的⽂件:1)在Git项⽬中定义.gitignore⽂件对于经常使⽤Git的朋友来说,.gitignore配置⼀定不会陌⽣。

这种⽅式通过在项⽬的某个⽂件夹下定义.gitignore⽂件,在该⽂件中定义相应的忽略规则,来管理当前⽂件夹下的⽂件的Git提交⾏为。

.gitignore ⽂件是可以提交到公有仓库中,这就为该项⽬下的所有开发者都共享⼀套定义好的忽略规则。

在.gitingore ⽂件中,遵循相应的语法,在每⼀⾏指定⼀个忽略规则。

如:\*.log\*.temp/vendor2)在Git项⽬的设置中指定排除⽂件这种⽅式只是临时指定该项⽬的⾏为,需要编辑当前项⽬下的 .git/info/exclude⽂件,然后将需要忽略提交的⽂件写⼊其中。

需要注意的是,这种⽅式指定的忽略⽂件的根⽬录是项⽬根⽬录。

3)定义Git全局的 .gitignore ⽂件除了可以在项⽬中定义 .gitignore ⽂件外,还可以设置全局的git .gitignore⽂件来管理所有Git项⽬的⾏为。

Linux操作Git远程仓库与本地仓库同步的教程

Linux操作Git远程仓库与本地仓库同步的教程

Linux操作Git远程仓库与本地仓库同步的教程创建本地仓库并同步到远程git是⾮常强⼤的版本管理⼯具。

接下来的时间⾥,我就和⼤家絮叨絮叨git的⼊门:如何在本地创建⼀个git仓库,并把⾃⼰的本地代码同步到远程。

此教程是在mac上操作的,如果您的系统是Linux,那么操作⽅法相同;如果您的系统是windows,那么,只需要把git的bash窗⼝调出来,以后的过程也都与Linux相同。

⼀、⾸先,您需要安装git,此步就忽略了,⾃⾏安装即可。

⼆、假设你⽬前还没有创建⼀个⼯作⽬录,那么,先创建⼀个⽬录吧,就叫StudyGit。

三、现在的StudyGit⽬录还只是⼀个本地⽬录,和git没有任何关联,那么,我们怎么样才能把这个⽬录和git关联起来呢?只需要进⼊StudyGit⽬录,运⾏如下命令:复制代码代码如下:yanyaozhen@macbookpro:~/Coding/Practice/StudyGit$ git initInitialized empty Git repository in /Users/yanyaozhen/Coding/Practice/StudyGit/.git/提⽰已经说明我们初始化了⼀个空的本地git仓库。

如果你查看StudyGit下的所有⽂件时,会发现⼀个.git 的隐藏⽂件,这个⽂件⾮常重要,版本的控制就靠它了。

同时,如果你要部署应⽤程序到⽣产环境时,切记不要把该⽬录部署到服务器,因为这可是⿊客的最爱啊!四、接下来我们来看⼀个基本可以说是⽤的最频繁的⼀个命令:复制代码代码如下:yanyaozhen@macbookpro:~/Coding/Practice/StudyGit$ git statusOn branch masterInitial commitnothing to commit (create/copy files and use "git add" to track)没错,就是"git status"。

git忽略想要提交的文件

git忽略想要提交的文件

git忽略想要提交的⽂件再使⽤webstrom的时候总会出现.idea⽂件,每次提交git的时候都会提交上去,所以找了下解决⽅法:在项⽬中有些配置⽂件不需要提交,但是有同学在后⾯开发中发现在.igonore⽂件中⽆论如何都⽆法忽略某些⽂件的提交。

原因在这⾥:下⾯是我试的⼏种⽅法1、⽅法已经维护起来的⽂件,即使加上了gitignore,也⽆济于事。

----那么如何解决呢?⽅式如下 git update-index --assume-unchanged 要忽略的⽂件夹/⽂件夹下⽂件名⽐如我要忽略项⽬下.idea⽂件夹下所有xml⽂件,idea下都是xml⽂件(我⽤的webstorm): git update-index --assume-unchanged .idea/*.xml如果要重新恢复提交,使⽤如下命令: git update-index --assume-unchanged .idea/*.xml这样每次提交就不会提交idea下的⽂件了。

2、设置webstrom 第⼀步:找到setting =》Editor =》File Types 第⼆步:编辑,在后⾯添加 *.iml;*.idea;*.gitignore;*.sh;*.classpath;*.project;*.settings;target;logs; 或者添加*.hprof;*.idea;*.iml;*.pyc;*.pyo;*.rbc;*.yarb;*~;.DS_Store;.git;.hg;.svn;CVS;__pycache__;_svn;vssver.scc;vssver2.scc; 总之需要忽略什么⽂件就 *.⽂件后缀名;注意两个⽂件之间⽤ ; 分号分隔3、创建 .gitignore ⾸先找到你的项⽬⽬录 创建 .gitignore ⽂件 然后把不想提交的⽂件的⽂件名输⼊进去 特殊操作: # 此为注释 – 将被 Git 忽略 *.a # 忽略所有 .a 结尾的⽂件 !lib.a # 但 lib.a 除外 /TODO # 仅仅忽略项⽬根⽬录下的 TODO ⽂件,不包括 subdir/TODO build/ # 忽略 build/ ⽬录下的所有⽂件 doc/*.txt # 会忽略 doc/notes.txt 但不包括 doc/server/arch.txt/vendor/node_modules/public/storageHomestead.yamlHomestead.json.env.idea 有时候会遇到创建了.gitignore ⽂件,发现忽略的⽂件依然存在: 原因是:再git库中已经存在了这个⽂件,之前提交过该⽂件,⽽.gitinore只对还没提交过的⽂件有效; 解决办法:需要删除该⽂件,并更新,然后查看⽂件状态(git status),⽂件不在显⽰,再提提交就没有.idea⽂件了。

git添加根目录(转)

git添加根目录(转)

git添加根⽬录(转)git和 svn不同,仅仅跟踪⽂件的变动,不跟踪⽬录。

所以,⼀个空⽬录,如果⾥⾯没有⽂件,即便git add这个⽬录,另外在别处check out的时候,是没有这个空⽬录的。

只跟踪⽂件变化,不跟踪⽬录,这么设计是有原因的。

但这会带来⼀些⼩⿇烦。

有时候,确实需要在代码仓库中保留某个空⽬录。

⽐如测试时需要⽤到的空⽬录。

下⾯来看看如何解决。

其实这⾥有两种情况:⼀、⽬录是空的这种情况下只需要在⽬录下创建.gitkeep⽂件,然后在项⽬的.gitignore中设置不忽略.gitkeep.gitkeep 是⼀个约定俗成的⽂件名并不会带有特殊规则⼆、⽬录中已经存在⽂件那就需要⾸先在根⽬录中设置!.gitignore,然后在⽬标⽬录也创建⼀个.gitignore⽂件,并在⽂件中设置1 2*!.gitignore⼩结好了,这样就可以在项⽬中提交空⽬录了,希望对⼤家的学习或者⼯作能有所帮助,如果有疑问⼤家可以留⾔交流。

在git中如果想忽略掉某个⽂件,不让这个⽂件提交到版本库中,可以使⽤修改根⽬录中 .gitignore ⽂件的⽅法(如⽆,则需⾃⼰⼿⼯建⽴此⽂件)。

这个⽂件每⼀⾏保存了⼀个匹配的规则例如:1 2 3 4 5 6 7# 此为注释 – 将被 Git 忽略*.a # 忽略所有 .a 结尾的⽂件!lib.a # 但 lib.a 除外/TODO # 仅仅忽略项⽬根⽬录下的 TODO ⽂件,不包括 subdir/TODO build/ # 忽略 build/ ⽬录下的所有⽂件doc/*.txt # 会忽略 doc/notes.txt 但不包括 doc/server/arch.txt规则很简单,不做过多解释,但是有时候在项⽬开发过程中,突然⼼⾎来潮想把某些⽬录或⽂件加⼊忽略规则,按照上述⽅法定义后发现并未⽣效,原因是.gitignore只能忽略那些原来没有被track的⽂件,如果某些⽂件已经被纳⼊了版本管理中,则修改.gitignore是⽆效的。

githubc语言笔记

githubc语言笔记

在GitHub上创建C语言笔记的步骤如下:创建一个GitHub账号:首先,您需要在GitHub上创建一个账号。

访问GitHub的官方网站并按照页面上的指示进行注册。

创建新的仓库:登录到您的GitHub账号后,点击屏幕右上角的“+”图标,然后选择“New repository”来创建一个新的仓库。

给仓库起一个合适的名字,例如“C-language-notes”,并添加相关的描述。

初始化仓库:在创建仓库的页面上,您可以选择初始化仓库为特定的项目。

由于我们要存储C语言的笔记,可以选择添加一个.gitignore文件并选择“C”作为项目类型。

这样做可以忽略不必要的文件,如编译生成的目标文件等。

复制仓库地址:创建完仓库后,您会看到一个包含仓库地址的页面。

复制这个地址,因为我们稍后将使用它。

在本地创建笔记:在您的计算机上创建一个文件夹,用于存储C语言的笔记。

您可以使用任何文本编辑器来编写笔记,如Notepad++、Sublime Text、VS Code等。

将您的笔记保存为.txt 或.md格式的文件。

将笔记添加到Git仓库:打开命令行终端(如Git Bash、Terminal等),导航到存储笔记的文件夹。

运行以下命令来初始化Git仓库并将笔记添加到仓库:bashgit initgit add .git commit -m "Initial commit"将本地仓库与远程仓库关联:运行以下命令,将本地仓库与您在GitHub上创建的远程仓库关联起来:bashgit remote add origin <your_github_repository_url>将<your_github_repository_url>替换为您在步骤4中复制的GitHub仓库地址。

8. 将笔记推送到GitHub:运行以下命令将您的笔记推送到GitHub上的远程仓库:bashgit push -u origin master这将在GitHub上创建一个名为“master”的分支,并将您的笔记推送到该分支。

gitk详解

gitk详解

gitk详解前⾔:gitk是git图形化的界⾯软件版本,对仓库的管理更为直观,不需要在命令⾏中进⾏繁琐的控制,将各种信息合理的组织在不同的软件窗⼝中,让⼀些很繁琐的操作可以在图像软件中只需要⼀键获得。

合理的结合命令⾏和图形⼯具可以⼤⼤提⾼软件开发和分⽀管理的效率。

介绍:这是⼀个⼩仓库的gitk界⾯:其中各个窗⼝包含了仓库的所有信息提交显⽰窗⼝:包含了提交信息与分⽀信息,当切换不同的commit时,底层的SHA1 ID区域会显⽰当前commit ID。

SHA1 ID:当选择commit时,该commit的ID会在这⾥显⽰。

Row:当前⾏数/总⾏数。

每个commit ⼀⾏。

选中⼀个commit。

Create tag:基于选中的commit创建⼀个tag。

Copy commit summary:拷贝提交的信息,包括7位commit ID,message和提交⽇期。

Write commit to file:将该commit的详细信息写到⼀个⽂件,包括提交信息和提交内容。

Create new branch:基于该commit创建分⽀。

Cherry-pick this commit:将该commit应⽤到当前HEAD分⽀。

Reset ${BRANCH} branchs to here:将当前分⽀重置到当前commit。

Mark this commit:标记当前commit,标记后,右键其他commit时跟marked 相关的菜单可⽤,只能有⼀个Marked的commit。

Revert thiscommit:回退到当前commit。

Revert和Reset是不⼀样的,Revert会⽣成⼀个新的commit,但Reset不会。

如果我们已经选中⼀个commit,并且MARK了,右键其他commit就会出现灰⾊的菜单都可⽤了:Diff this->selected:当前commit与选中的commit的diff。

Git规范化提交

Git规范化提交

Git规范化提交一、前言在开发团队协作中,“开发规范” 是经常被讨论的话题。

当然,除了代码上的规范,还有一个很重要的规范就是“提交规范”。

规范化提交的目的:•提交统一的、有规则的信息;而不是混乱的、看不懂是什么意思的信息•可以提供更加明朗的历史信息,便于后续快速定位问题、代码回滚等的操作•可以自动化生成changelog二、huskyhusky是一个 Git-Hooks 工具. 那么 hooks 是什么呢?“hooks” 直译是“钩子”,它并不仅是 react,甚至不仅是前端界的专用术语,而是整个行业所熟知的用语。

通常指:系统运行到某一时期时,会调用被注册到该时机的回调函数。

规范化提交第一步就是要在git commit之前先做一次Lint校验,限制不规范代码的提交,那husky这个工具就能做到。

husky继承了Git下所有的钩子,在触发pre-commit钩子的时候,阻止不合法的 commit、push 等等。

2.1 初始化 git 目录如果没有先初始化 git,需要重新装husky。

git init -y2.2 安装 husky# pnpm 安装pnpm add husky -D-w# or npm 安装npm install husky -D2.3 添加 husky 脚本在package.json文件 scripts 中手动添加"prepare": "husky install"或者直接执行命令添加npm set-script prepare "husky install"prepare 脚本会在npm install(不带参数)之后自动执行。

也就是说当我们执行npm install安装完项目依赖后会执行 husky install命令,该命令会创建.husky/目录并指定该目录为git hooks所在的目录。

2.4 执行 npm run prepare执行之后会发现项目根目录多了个.husky的目录及文件。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

git mv
Step 3: Undo your stuff
git revert <commit> git commit -m "undo last commit and re-commit" –amend git rm <file> git rm --cached <file> git reset <file> git checkout <version> <file>
Who is using Git?
Git Linux Kernel Perl Gnome Qt Ruby on Rails Android PostgreSQL Wine Fedora Debian …. and you?
Study Notes
Step 0: Environment setting and help Step 1: Init project Step 2: Change and modify file Step 3: Undo your stuff Step 4: View log Step 5: Tagging Step 6: Branching Step 7: Work with remotes Step 8: Advanced Git
from
Step 2: Change and modify file(3)
git status git add <file> git diff git diff --cached git commit -m "edit commit“ git commit -a -m "auto commit“
git init git add * git commit -m "init comment“ git clone /path/to/.git
Step 2: Change and modify file(1)
from
Step 2: Change and modify file(2)
Git Study Notes
@angusli
What’s Git?
Git is distributed version control system focused on speed, effectivity and real-world usability on large projects. Its highlights include:
git rebase git rebase --continue/skip/abort
Step 7: Work with remotes
git remote git remote -v git remote add <origin-name> /path/to/.git git remote show <origin-name> git pull git fetch git fetch <origin-name> git merge <origin-name>/master
Git resources
/ / /~zrusin/git/git-cheat-sheet-large.png /pub/software/scm/git/docs/ /~blynn/gitmagic/ /questions/315911/git-forbeginners-the-definitive-practical-guide
– Distributed development – Strong support for non-linear development – Efficient handling of large projects – Cryptographic authentication of history – Toolkit design
End
Step 5: Tagging
git tag git tag -l "a*“ git tag <tag-name> git tag -a <tag-name> -m “comment” git show <tag-name> git tag <rev-hash> git push origin <tag-name> git push --tags
பைடு நூலகம்
Step 6: Branching
git branch git branch -v git branch <bname> git checkout <bname> git checkout -b <bname> git merge <bname> git add <conflict-file> git commit git branch --merged/--no-merged
Step 4: View log
git log -1 git log -p git log -p -2 git log --stat git log --shortstat git log --pretty=oneline git log --pretty="%h %cn: %s“ git log --pretty="%h %cn: %s" --graph git log --since/after/until/before=2.weeks/”2010-10-20”
git remote rename <origin-name> <name-name> git remote rm <origin-name>
Step 8: Advanced Git
Submodules Git servers Hosted Git Distributed Git Git internals
Step 0: Env setting and help
git config --list git config --global git config --global user.email <ready to go!>
git help <verb>
Step 1: Init project
相关文档
最新文档