随笔分类 -  Git

摘要:When you accidentally committed some changes to your branch you have various possibilities to “undo” that operation and add some more changes. One is 阅读全文
posted @ 2019-03-26 20:51 Zhentiw 阅读(173) 评论(0) 推荐(0) 编辑
摘要:Did you make a typo in your last commit message? No problem, we can use the git --amend command to change it very easily. Note: This only holds if you 阅读全文
posted @ 2019-03-25 21:34 Zhentiw 阅读(236) 评论(0) 推荐(0) 编辑
摘要:Often you have your feature branch you’ve been working on and once it’s ready, you just want it to merge into master as a single commit. You don’t car 阅读全文
posted @ 2019-03-25 21:30 Zhentiw 阅读(190) 评论(0) 推荐(0) 编辑
摘要:Gosh no, I just added all of these commits to master. They were thought to be peer reviewed first in a dedicated branch! No worries, in this lesson we 阅读全文
posted @ 2019-03-25 20:59 Zhentiw 阅读(203) 评论(0) 推荐(0) 编辑
摘要:For example we have: develop branch hotfix branch release branch 'develop' branch has all the latest commits and features; 'release' branch is far beh 阅读全文
posted @ 2019-01-23 15:44 Zhentiw 阅读(192) 评论(0) 推荐(0) 编辑
摘要:Rename your local foo branch with bar: Remember this will add the new branch when you push, but it won’t delete the old foo remote branch. Add -f --mi 阅读全文
posted @ 2017-04-18 19:06 Zhentiw 阅读(301) 评论(0) 推荐(0) 编辑
摘要:Let's split our changes into separate commits. We'll be able to check over our changes before staging them all from the terminal. Then, we'll see the 阅读全文
posted @ 2017-01-11 22:03 Zhentiw 阅读(142) 评论(0) 推荐(0) 编辑
摘要:Most projects have automatically generated files or folders from the operating system, applications, package managers etc. Usually, we don't want to i 阅读全文
posted @ 2016-08-12 03:13 Zhentiw 阅读(225) 评论(0) 推荐(0) 编辑
摘要:You can set up global "git config" settings that apply to all git projects on your system. In this lesson, we review how the ./gitconfig file works. W 阅读全文
posted @ 2016-08-12 03:03 Zhentiw 阅读(246) 评论(0) 推荐(0) 编辑
摘要:Sometimes you find a bug in your project that has been around for a while without being noticed; it can be hard to track down where that bug was intro 阅读全文
posted @ 2016-08-12 02:52 Zhentiw 阅读(185) 评论(0) 推荐(0) 编辑
摘要:Sometimes its nice to clean up commits before merging them into your main code repo; in this lesson, we go over using git rebase to squash commits tog 阅读全文
posted @ 2016-08-12 02:39 Zhentiw 阅读(207) 评论(0) 推荐(0) 编辑
摘要:When working on a file, we often want to know who made certain changes last; we can use git blame to see details about the last modification of each l 阅读全文
posted @ 2016-08-12 02:20 Zhentiw 阅读(226) 评论(0) 推荐(0) 编辑
摘要:It can be helpful to see the changes between two sets of code; git diff lets us do this by comparing two Git references and outputting the differences 阅读全文
posted @ 2016-08-12 02:14 Zhentiw 阅读(332) 评论(0) 推荐(0) 编辑
摘要:In the last lesson, we learned how to format the git log output; in this lesson we will learn how to filter down to a specific set of commits. By defa 阅读全文
posted @ 2016-08-11 04:57 Zhentiw 阅读(244) 评论(0) 推荐(0) 编辑
摘要:When running the git log command, we can pass in options as arguments toformat the data shown for each commit. In this lesson, we show how to use the  阅读全文
posted @ 2016-08-10 18:10 Zhentiw 阅读(185) 评论(0) 推荐(0) 编辑
摘要:When using a git command that can have a large amount of output (like git log, git diff, or git blame), Git opens the command output in our terminal " 阅读全文
posted @ 2016-08-10 03:16 Zhentiw 阅读(254) 评论(0) 推荐(0) 编辑
摘要:When working on a project, it is much easier to work on features and bugs in isolation of the rest of the project. We can do this with git branches; a 阅读全文
posted @ 2016-08-10 02:54 Zhentiw 阅读(183) 评论(0) 推荐(0) 编辑
摘要:Wouldn't it be nice if everyone ran the tests before committing code? With ghooks, you can automatically add a githook when dependencies are installed 阅读全文
posted @ 2016-04-08 00:54 Zhentiw 阅读(170) 评论(0) 推荐(0) 编辑
摘要:Somtimes, the project might set the commit message guide line, if your commit doesn't meet the requirement, ghook will reject it. If you really not su 阅读全文
posted @ 2016-02-14 01:43 Zhentiw 编辑
摘要:When you want to push your local branch to remote branch, for the first push: git push --set-upstream origin <branch_name> The reason to set 'up-strea 阅读全文
posted @ 2016-02-14 01:34 Zhentiw 编辑

点击右上角即可分享
微信分享提示