开源软件名称:git-tips/tips
开源软件地址:https://github.com/git-tips/tips
开源编程语言:
JavaScript
100.0%
开源软件介绍:git-tips
Collection of git-tips , want to add your tips? Checkout contributing.md
English | 中文 | Русский | 한국어 | Tiếng Việt | 日本語 | नेपाली | Polski | فارسی
Tools:
P.S: All these commands are tested on git version 2.7.4 (Apple Git-66) .
- Everyday Git in twenty commands or so
- Show helpful guides that come with Git
- Search change by content
- Show changes over time for specific file
- Remove sensitive data from history, after a push
- Sync with remote, overwrite local changes
- List of all files till a commit
- Git reset first commit
- Reset: preserve uncommitted local changes
- List all the conflicted files
- List of all files changed in a commit
- Unstaged changes since last commit
- Changes staged for commit
- Show both staged and unstaged changes
- List all branches that are already merged into master
- Quickly switch to the previous branch
- Remove branches that have already been merged with master
- List all branches and their upstreams, as well as last commit on branch
- Track upstream branch
- Delete local branch
- Delete remote branch
- Create local tag
- Delete local tag
- Delete remote tag
- Undo local changes with the last content in head
- Revert: Undo a commit by creating a new commit
- Reset: Discard commits, advised for private branch
- Reword the previous commit message
- See commit history for just the current branch
- Amend author.
- Reset author, after author has been changed in the global config.
- Changing a remote's URL
- Get list of all remote references
- Get list of all local and remote branches
- Get only remote branches
- Stage parts of a changed file, instead of the entire file
- Get git bash completion
- What changed since two weeks?
- See all commits made since forking from master
- Pick commits across branches using cherry-pick
- Find out branches containing commit-hash
- Git Aliases
- Saving current state of tracked files without commiting
- Saving current state of unstaged changes to tracked files
- Saving current state including untracked files
- Saving current state with message
- Saving current state of all files (ignored, untracked, and tracked)
- Show list of all saved stashes
- Show the contents of any stash in patch form
- Apply any stash without deleting from the stashed list
- Apply last stashed state and delete it from stashed list
- Delete all stored stashes
- Grab a single file from a stash
- Show all tracked files
- Show all untracked files
- Show all ignored files
- Create new working tree from a repository (git 2.5)
- Create new working tree from HEAD state
- Untrack files without deleting
- Before deleting untracked files/directory, do a dry run to get the list of these files/directories
- Forcefully remove untracked files
- Forcefully remove untracked directory
- Update all the submodules
- Show all commits in the current branch yet to be merged to master
- Rename a branch
- Rebases 'feature' to 'master' and merges it in to master
- Archive the
master branch
- Modify previous commit without modifying the commit message
- Prunes references to remove branches that have been deleted in the remote.
- Delete local branches that has been squash and merged in the remote.
- Retrieve the commit hash of the initial revision.
- Visualize the version tree.
- Visualize the tree including commits that are only referenced from reflogs
- Deploying git tracked subfolder to gh-pages
- Adding a project to repo using subtree
- Get latest changes in your repo for a linked project using subtree
- Export a branch with history to a file.
- Import from a bundle
- Get the name of current branch.
- Ignore one file on commit (e.g. Changelog).
- Stash changes before rebasing
- Fetch pull request by ID to a local branch
- Show the most recent tag on the current branch.
- Show inline word diff.
- Show changes using common diff tools.
- Don’t consider changes for tracked file.
- Undo assume-unchanged.
- Clean the files from
.gitignore .
- Restore deleted file.
- Restore file to a specific commit-hash
- Always rebase instead of merge on pull.
- List all the alias and configs.
- Make git case sensitive.
- Add custom editors.
- Auto correct typos.
- Check if the change was a part of a release.
- Dry run. (any command that supports dry-run flag should do.)
- Marks your commit as a fix of a previous commit.
- Squash fixup commits normal commits.
- Skip staging area during commit.
- Interactive staging.
- List ignored files.
- Status of ignored files.
- Commits in Branch1 that are not in Branch2
- List n last commits
- Reuse recorded resolution, record and reuse previous conflicts resolutions.
- Open all conflicted files in an editor.
- Count unpacked number of objects and their disk consumption.
- Prune all unreachable objects from the object database.
- Instantly browse your working repository in gitweb.
- View the GPG signatures in the commit log
- Remove entry in the global config.
- Checkout a new branch without any history
- Extract file from another branch.
- List only the root and merge commits.
- Change previous two commits with an interactive rebase.
- List all branch is WIP
- Find guilty with binary search
- Bypass pre-commit and commit-msg githooks
- List commits and changes to a specific file (even through renaming)
- Clone a single branch
- Create and switch new branch
- Ignore file mode changes on commits
- Turn off git colored terminal output
- Specific color settings
- Show all local branches ordered by recent commits
- Find lines matching the pattern (regex or string) in tracked files
- Clone a shallow copy of a repository
- Search Commit log across all branches for given text
- Get first commit in a branch (from master)
- Unstaging Staged file
- Force push to Remote Repository
- Adding Remote name
- List all currently configured remotes
- Show the author, time and last revision made to each line of a given file
- Group commits by authors and title
- Forced push but still ensure you don't overwrite other's work
- Show how many lines does an author contribute
- Revert: Reverting an entire merge
- Number of commits in a branch
- Alias: git undo
- Add object notes
- Show all the git-notes
- Apply commit from another repository
- Specific fetch reference
- Find common ancestor of two branches
- List unpushed git commits
- Add everything, but whitespace changes
- Edit [local/global] git config
- blame on certain range
- Show a Git logical variable.
- Preformatted patch file.
- Get the repo name.
- logs between date range
- Exclude author from logs
- Generates a summary of pending changes
- List references in a remote repository
- Backup untracked files.
- List all git aliases
- Show git status short
- Checkout a commit prior to a day ago
- Push the current branch to the same name on the remote repository
- Push a new local branch to remote repository and track
- Change a branch base
- Use SSH instead of HTTPs for remotes
- Update a submodule to the latest commit
- Prevent auto replacing LF with CRLF
Everyday Git in twenty commands or so
Show helpful guides that come with Git
Search change by content
git log -S'<a term in the source>'
Show changes over time for specific file
Remove sensitive data from history, after a push
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch <path-to-your-file>' --prune-empty --tag-name-filter cat -- --all && git push origin --force --all
Sync with remote, overwrite local changes
git fetch origin && git reset --hard origin/master && git clean -f -d
List of all files till a commit
git ls-tree --name-only -r <commit-ish>
Git reset first commit
Reset: preserve uncommitted local changes
git reset --keep <commit>
List all the conflicted files
git diff --name-only --diff-filter=U
List of all files changed in a commit
git diff-tree --no-commit-id --name-only -r <commit-ish>
Unstaged changes since last commit
Changes staged for commit
Alternatives:
Show both staged and unstaged changes
List all branches that are already merged into master
git branch --merged master
Quickly switch to the previous branch
Alternatives:
Remove branches that have already been merged with master
git branch --merged master | grep -v '^\*' | xargs -n 1 git branch -d
Alternatives:
git branch --merged master | grep -v '^\*\| master' | xargs -n 1 git branch -d # will not delete master if master is not checked out
List all branches and their upstreams, as well as last commit on branch
Track upstream branch
git branch -u origin/mybranch
Delete local branch
git branch -d <local_branchname>
Delete remote branch
git push origin --delete <remote_branchname>
Alternatives:
git push origin :<remote_branchname>
git branch -dr <remote/branch>
Create local tag
Delete local tag
Delete remote tag
git push origin :refs/tags/<tag-name>
Undo local changes with the last content in head
git checkout -- <file_name>
Revert: Undo a commit by creating a new commit
Reset: Discard commits, advised for private branch
Reword the previous commit message
See commit history for just the current branch
Amend author.
Reset author, after author has been changed in the global config.
git commit --amend --reset-author --no-edit
Changing a remote's URL
git remote set-url origin <URL>
Get list of all remote references
Alternatives:
Get list of all local and remote branches
Get only remote branches
Stage parts of a changed file, instead of the entire file
Get git bash completion
curl -L http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc
What changed since two weeks?
git log --no-merges --raw --since='2 weeks ago'
Alternatives:
git whatchanged --since='2 weeks ago'
See all commits made since forking from master
git log --no-merges --stat --reverse master..
Pick commits across branches using cherry-pick
git checkout <branch-name> && git cherry-pick <commit-ish>
Find out branches containing commit-hash
git branch -a --contains <commit-ish>
Alternatives:
git branch --contains <commit-ish>
Git Aliases
git config --global alias.<handle> <command>
git config --global alias.st status
Saving current state of tracked files without commiting
Alternatives:
Saving current state of unstaged changes to tracked files
Alternatives:
-
六六分期app的软件客服如何联系?不知道吗?加qq群【895510560】即可!标题:六六分期
阅读:17974|2023-10-27
-
今天小编告诉大家如何处理win10系统火狐flash插件总是崩溃的问题,可能很多用户都不知
阅读:9569|2022-11-06
-
今天小编告诉大家如何对win10系统删除桌面回收站图标进行设置,可能很多用户都不知道
阅读:8129|2022-11-06
-
今天小编告诉大家如何对win10系统电脑设置节能降温的设置方法,想必大家都遇到过需要
阅读:8511|2022-11-06
-
我们在使用xp系统的过程中,经常需要对xp系统无线网络安装向导设置进行设置,可能很多
阅读:8415|2022-11-06
-
今天小编告诉大家如何处理win7系统玩cf老是与主机连接不稳定的问题,可能很多用户都不
阅读:9309|2022-11-06
-
电脑对日常生活的重要性小编就不多说了,可是一旦碰到win7系统设置cf烟雾头的问题,很
阅读:8378|2022-11-06
-
我们在日常使用电脑的时候,有的小伙伴们可能在打开应用的时候会遇见提示应用程序无法
阅读:7810|2022-11-06
-
今天小编告诉大家如何对win7系统打开vcf文件进行设置,可能很多用户都不知道怎么对win
阅读:8364|2022-11-06
-
今天小编告诉大家如何对win10系统s4开启USB调试模式进行设置,可能很多用户都不知道怎
阅读:7362|2022-11-06
|
请发表评论