随笔分类 - 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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:For example we have: develop branch hotfix branch release branch 'develop' branch has all the latest commits and features; 'release' branch is far beh
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Most projects have automatically generated files or folders from the operating system, applications, package managers etc. Usually, we don't want to i
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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 "
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文