Merge pull request #1 from 30-seconds/redate
This commit is contained in:
@ -2,20 +2,10 @@
|
||||
|
||||
**30 seconds of code** is powered by the community, so feel free to contribute in any way you can to help us!
|
||||
|
||||
## Tools
|
||||
|
||||
Before you begin contributing, you should install the integration-tools globally on your machine:
|
||||
|
||||
```sh
|
||||
npm install -g @30-seconds/integration-tools
|
||||
```
|
||||
|
||||
This will allow you to use our customized tools for all of our content repositories.
|
||||
|
||||
## How you can help
|
||||
|
||||
- Submit pull requests with new snippets (see guidelines below) or snippet updates (tags, descriptions, explanations, typos, examples, code improvements).
|
||||
- Open issues for things you want to see added, modified, discuss ideas or help out with existing issues.
|
||||
- Open issues for things you want to see added, modified, discuss ideas or help out with existing issues.
|
||||
|
||||
## Ground rules
|
||||
|
||||
@ -23,25 +13,24 @@ Breaking any of these rules will result in your pull request being closed. Pleas
|
||||
|
||||
- **Always be polite and respectful to others** and try to follow the advice of the moderators/collaborators/owners.
|
||||
- **Only modify snippet files**, never modify the generated files in the `snippet_data` directory.
|
||||
- **Use the integration tools commands** to generate new snippets, ensuring they have the correct name and are in the correct location.
|
||||
- **Use the snippet template** to create new snippets, ensure they have the correct name and are in the correct location.
|
||||
- **Follow snippet format exactly**, otherwise your snippets will not be recognized correctly by the tools responsible for publishing them on the website. This includes such things as spacing and empty lines - if you accidentally make a mistake, consult the repository's [snippet template](snippet-template.md).
|
||||
- **Snippets should solve real-world problems**, no matter how simple and should be abstract enough to be applied to different scenarios.
|
||||
|
||||
## Snippet creation
|
||||
|
||||
After installing the integration tools, you can run the following command:
|
||||
In order to create a new snippet, you should follow the steps below:
|
||||
|
||||
```sh
|
||||
create-new-snippet <my-snippet-name>
|
||||
```
|
||||
|
||||
Replace `<my-snippet-name>` with the name of the snippet you are adding.
|
||||
- Crate a copy of the [snippet template](snippet-template.md) in the `snippets` directory.
|
||||
- Change the name of the newly created file to the name of your snippet.
|
||||
- Edit the file, adding your snippet based on the guidelines.
|
||||
|
||||
## Snippet guidelines
|
||||
|
||||
- Snippets must have all their frontmatter sections (title, tags etc.) filled.
|
||||
- Snippet titles must correspond to the filename and follow the language and repository's naming conventions.
|
||||
- Snippet tags must be comma-separated, contain a primary tag as seen on the website as their first tag and an expertise tag (`beginner`, `intermediate` or `advanced`) as their last tag.
|
||||
- Snippets must have their `firstSeen` dates formatted using [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601).
|
||||
- Snippet descriptions must be short and to the point. Explain *what* the snippet does and detail *how* the snippet works and the language features used in it.
|
||||
- Snippet code and examples must be enclosed in appropriate, language-tagged blocks as shown in the snippet template, be short and use modern techniques and features. Also make sure to test your code before submitting.
|
||||
- If your snippet contains arguments with default parameters, explain what happens if they are omitted when calling the function and what the default case is. Specify default parameters for arguments only if necessary.
|
||||
|
||||
16
README.md
16
README.md
@ -1,14 +1,14 @@
|
||||
[](https://30secondsofcode.org/git/p/1)
|
||||
|
||||
# 30 seconds of Git
|
||||
# 30 seconds of code
|
||||
|
||||
> Short Git code snippets for all your development needs
|
||||
> Short git code snippets for all your development needs
|
||||
|
||||
* Visit [our website](https://30secondsofcode.org) to view our snippet collection.
|
||||
* Use the [Search page](https://30secondsofcode.org/search) to find snippets that suit your needs. You can search by name, tag, language or using a snippet's description. Just start typing a term and see what comes up.
|
||||
* Browse the [Git Snippet List](https://30secondsofcode.org/git/p/1) to see all the snippets in this project or click individual tags at the top of the same page to narrow down your search to a specific tag.
|
||||
* Browse the [Git Snippet collection](https://30secondsofcode.org/git/p/1) to see all the snippets in this project or click individual tags at the top of the same page to narrow down your search to a specific tag.
|
||||
* Click on each snippet card to view the whole snippet, including code, explanation and examples.
|
||||
* You can use the button on the right side of a snippet card to copy the code to clipboard.
|
||||
* You can use the button at the bottom of a snippet card to copy the code to clipboard.
|
||||
* If you like the project, give it a star. It means a lot to the people maintaining it.
|
||||
|
||||
## Want to contribute?
|
||||
@ -18,9 +18,9 @@
|
||||
* If you find a problem with a specific snippet, please [open an issue](https://github.com/30-seconds/30-seconds-of-git/issues/new).
|
||||
* If you find a problem with the website, please [report it in the web repository](https://github.com/30-seconds/30-seconds-web/issues/new).
|
||||
|
||||
## Credits & Sponsors
|
||||
## Credits
|
||||
|
||||
* This repository is maintained by the [30-seconds organization on GitHub](https://github.com/30-seconds).
|
||||
* This repository is maintained by the [30 seconds of code organization on GitHub](https://github.com/30-seconds).
|
||||
* All snippets are licensed under the CC0-1.0 License, unless explicitly stated otherwise.
|
||||
* Logos, names and trademarks are not to be used without the explicit consent of the maintainers or owners of the 30 seconds GitHub organization.
|
||||
* Our website is powered by [Netlify](https://www.netlify.com/), [Gatsby](https://www.gatsbyjs.org/) & [GitHub](https://github.com/).
|
||||
* Logos, names and trademarks are not to be used without the explicit consent of the owners of the 30 seconds of code GitHub organization.
|
||||
* Our website is powered by [Netlify](https://www.netlify.com/), [Next.js](https://nextjs.org/) & [GitHub](https://github.com/).
|
||||
|
||||
BIN
logo.png
BIN
logo.png
Binary file not shown.
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 169 KiB |
@ -1,6 +1,7 @@
|
||||
---
|
||||
title: Snippet name
|
||||
tags: branch,intermediate
|
||||
firstSeen: 2021-06-13T05:00:00-04:00
|
||||
---
|
||||
|
||||
Explain briefly what the snippet does.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Add a submodule
|
||||
tags: repository,submodule,advanced
|
||||
firstSeen: 2021-04-08T20:05:15+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Adds a new submodule to the repository.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Apply the latest stash
|
||||
tags: repository,stash,intermediate
|
||||
firstSeen: 2021-04-13T19:36:57+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Applies the latest stash.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Apply a stash
|
||||
tags: repository,stash,intermediate
|
||||
firstSeen: 2021-04-13T19:36:57+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Applies a specific stash.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Autocorrect git commands
|
||||
tags: configuration,intermediate
|
||||
firstSeen: 2021-04-06T20:58:33+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Configures git to autocorrect mistyped commands.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Automatically find the commit that introduced a bug
|
||||
tags: commit,branch,advanced
|
||||
firstSeen: 2021-04-13T20:00:22+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Uses a binary search algorithm and a given script to find which commit in history introduced a bug.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Find branches containing a commit
|
||||
tags: branch,commit,intermediate
|
||||
firstSeen: 2021-04-05T09:47:59+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints all the branches containing a specific commit.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Find branches not containing a commit
|
||||
tags: branch,commit,intermediate
|
||||
firstSeen: 2021-04-05T09:47:59+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints all the branches not containing a specific commit.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Change the remote URL
|
||||
tags: repository,intermediate
|
||||
firstSeen: 2021-04-08T19:42:57+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Changes the URL of the remote repository.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Clone missing submodules
|
||||
tags: repository,submodule,advanced
|
||||
firstSeen: 2021-04-08T20:05:15+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Clones missing submodules and checks out commits.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Clone a repository
|
||||
tags: repository,remote,beginner
|
||||
firstSeen: 2021-04-04T14:04:05+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Clones an existing repository, creating a local copy of it.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Create a commit by a different author
|
||||
tags: commit,intermediate
|
||||
firstSeen: 2021-04-13T20:07:27+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Creates a new commit by the specified author.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Add a commit message template
|
||||
tags: repository,configuration,advanced
|
||||
firstSeen: 2021-04-06T21:35:01+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Sets up a commit message template for the current repository.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Commit without running git hooks
|
||||
tags: commit,intermediate
|
||||
firstSeen: 2021-04-04T20:55:26+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Creates a new commit skipping the pre-commit and commit-msg hooks.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Configure git user information
|
||||
tags: configuration,repository,beginner
|
||||
firstSeen: 2021-04-04T21:25:22+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Configures user information for git.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Copy a file from another branch
|
||||
tags: branch,intermediate
|
||||
firstSeen: 2021-04-06T20:58:25+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Copies a file from another branch to the current branch.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Create a new branch
|
||||
tags: branch,remote,beginner
|
||||
firstSeen: 2021-04-04T14:09:09+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Creates and switches to a new branch, optionally setting up a remote tracking branch.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Create a commit
|
||||
tags: commit,beginner
|
||||
firstSeen: 2021-04-04T14:16:38+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Creates a new commit containing the staged changes.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Create an empty commit
|
||||
tags: commit,beginner
|
||||
firstSeen: 2021-04-04T20:55:26+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Creates an empty commit.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Create a fixup commit
|
||||
tags: commit,advanced
|
||||
firstSeen: 2021-04-08T19:51:24+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Creates a fixup commit that can be autosquashed in the next rebase.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Create a new repository
|
||||
tags: repository,beginner
|
||||
firstSeen: 2021-04-04T14:04:05+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Initializes a new git repository, setting up all the configuration files needed by git.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Get the current branch name
|
||||
tags: branch,beginner
|
||||
firstSeen: 2021-04-04T21:50:46+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints the current branch name.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Delete a branch
|
||||
tags: repository,branch,intermediate
|
||||
firstSeen: 2021-04-04T21:50:29+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Deletes a local branch.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Delete detached branches
|
||||
tags: repository,branch,intermediate
|
||||
firstSeen: 2021-04-08T19:42:01+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Deletes all detached branches.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Delete merged branches
|
||||
tags: repository,branch,advanced
|
||||
firstSeen: 2021-04-08T19:42:01+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Deletes all local merged branches.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Delete a remote branch
|
||||
tags: repository,branch,intermediate
|
||||
firstSeen: 2021-04-08T19:42:01+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Deletes a remote branch.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Delete a stash
|
||||
tags: repository,stash,intermediate
|
||||
firstSeen: 2021-04-13T19:36:57+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Deletes a specific stash.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Delete all stashes
|
||||
tags: repository,stash,intermediate
|
||||
firstSeen: 2021-04-13T19:36:57+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Deletes all stashes.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Delete a submodule
|
||||
tags: repository,submodule,advanced
|
||||
firstSeen: 2021-04-08T20:05:15+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Deletes a submodule from the repository.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View difference between two branches
|
||||
tags: branch,intermediate
|
||||
firstSeen: 2021-04-08T16:30:44+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Displays the difference between two branches.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Discard uncommitted changes
|
||||
tags: branch,intermediate
|
||||
firstSeen: 2021-04-06T11:11:08+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Discards all uncommitted changes to the current branch.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Discard untracked changes
|
||||
tags: branch,intermediate
|
||||
firstSeen: 2021-04-06T11:11:08+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Discards all untracked changes to the current branch.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Edit git configuration file
|
||||
tags: configuration,beginner
|
||||
firstSeen: 2021-04-04T21:25:22+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Opens the git configuration file in the git text editor.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Fetch latest changes from remote
|
||||
tags: repository,beginner
|
||||
firstSeen: 2021-04-08T19:43:13+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Fetches the latest changes from the remote.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Find lost files
|
||||
tags: repository,advanced
|
||||
firstSeen: 2021-04-06T21:35:01+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints a list of lost files and commits.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Update remote branch after rewriting history
|
||||
tags: branch,intermediate
|
||||
firstSeen: 2021-04-06T19:47:19+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Forces an update of the remote branch adter rewriting the history locally.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Perform an interactive rebase
|
||||
tags: branch,advanced
|
||||
firstSeen: 2021-04-08T20:10:35+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Performs an interactive rebase.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Configure line endings
|
||||
tags: repository,configuration,intermediate
|
||||
firstSeen: 2021-04-06T21:35:01+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Configures the line endings for a repository.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: List all git aliases
|
||||
tags: configuration,intermediate
|
||||
firstSeen: 2021-04-04T21:25:22+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints a list of all git aliases.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Lists all stashes
|
||||
tags: repository,stash,intermediate
|
||||
firstSeen: 2021-04-13T19:36:57+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Displays a list of all stashes.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Manually find the commit that introduced a bug
|
||||
tags: commit,branch,advanced
|
||||
firstSeen: 2021-04-13T20:00:22+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Uses a binary search algorithm to manually find which commit in history introduced a bug.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Merge a branch and create a merge commit
|
||||
tags: repository,branch,intermediate
|
||||
firstSeen: 2021-04-04T21:50:11+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Merges a branch into the current branch, creating a merge commit.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Merge a branch
|
||||
tags: repository,branch,beginner
|
||||
firstSeen: 2021-04-04T21:50:11+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Merges a branch into the current branch.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Move commits from master to a new branch
|
||||
tags: branch,repository,intermediate
|
||||
firstSeen: 2021-04-06T21:35:01+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Moves local commits from the `master` branch to a new branch.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Optimize the local repository
|
||||
tags: repository,advanced
|
||||
firstSeen: 2021-04-08T19:42:43+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Optimizes the local repository.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Pick changes from one or more commits
|
||||
tags: commit,branch,intermediate
|
||||
firstSeen: 2021-04-08T16:42:37+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Applies the changes introduced by one or more commits.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Pull all submodules from remote
|
||||
tags: repository,submodule,advanced
|
||||
firstSeen: 2021-04-08T20:05:15+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Pulls all submodules from their respective remotes.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Pull latest changes from remote
|
||||
tags: repository,branch,beginner
|
||||
firstSeen: 2021-04-08T19:42:23+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Pulls the latest changes from the remote tracking branch.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Purge a file from history
|
||||
tags: repository,remote,advanced
|
||||
firstSeen: 2021-04-13T20:20:57+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Completely purges a file from history.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Push local changes to remote
|
||||
tags: repository,branch,beginner
|
||||
firstSeen: 2021-04-08T19:42:23+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Pushes the current branch's changes to the remote.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Rebase onto another branch
|
||||
tags: branch,advanced
|
||||
firstSeen: 2021-04-05T11:19:54+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Rebases the current branch onto another branch.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Remove a file from the last commit
|
||||
tags: commit,intermediate
|
||||
firstSeen: 2021-04-05T11:19:41+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Removes a file from the last commit without changing its message.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Rename a branch
|
||||
tags: branch,intermediate
|
||||
firstSeen: 2021-04-05T09:48:16+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Renames a local branch.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Rename remote branch
|
||||
tags: branch,advanced
|
||||
firstSeen: 2021-04-05T09:48:16+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Renames a branch both locally and on the remote.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Reset master to match remote
|
||||
tags: repository,branch,intermediate
|
||||
firstSeen: 2021-04-06T16:58:58+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Resets the local `master` branch to match the one on the remote.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Restore a deleted file
|
||||
tags: branch,intermediate
|
||||
firstSeen: 2021-04-06T20:58:25+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Restores a file deleted in a specific commit.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Rewind back n commits
|
||||
tags: branch,commit,intermediate
|
||||
firstSeen: 2021-04-05T11:19:21+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Rewinds the current branch by a given number of commits.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Rewind back to a specific commit
|
||||
tags: branch,commit,intermediate
|
||||
firstSeen: 2021-04-05T11:19:21+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Rewinds the current branch by a given number of commits.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Create a stash
|
||||
tags: repository,stash,intermediate
|
||||
firstSeen: 2021-04-13T19:36:57+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Saves the current state of the working directory and index into a new stash.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Configure the git text editor
|
||||
tags: configuration,intermediate
|
||||
firstSeen: 2021-04-04T21:25:22+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Configures the text editor used by git.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View branches sorted by date
|
||||
tags: repository,branch,intermediate
|
||||
firstSeen: 2021-04-06T21:35:01+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints a list of all local branches sorted by date.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Add files to the staging area
|
||||
tags: commit,beginner
|
||||
firstSeen: 2021-04-06T16:39:37+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Adds files to the staging area.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Switch to a branch
|
||||
tags: branch,beginner
|
||||
firstSeen: 2021-04-04T14:09:09+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Switches to an existing branch.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Return to previous branch
|
||||
tags: branch,beginner
|
||||
firstSeen: 2021-04-04T14:13:31+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Switches back to the last branch.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Undo a commit
|
||||
tags: commit,branch,intermediate
|
||||
firstSeen: 2021-04-06T16:54:22+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Undoes a specified commit without rewriting history.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Undo the last commit
|
||||
tags: commit,branch,intermediate
|
||||
firstSeen: 2021-04-06T16:54:22+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Undoes the last commit without rewriting history.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Remove files from the staging area
|
||||
tags: commit,beginner
|
||||
firstSeen: 2021-04-06T19:38:51+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Removes files from the staging area.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Edit the last commit
|
||||
tags: commit,intermediate
|
||||
firstSeen: 2021-04-04T14:36:07+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Updates the last commit's contents without changing its message.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Change the last commit's message
|
||||
tags: commit,intermediate
|
||||
firstSeen: 2021-04-04T14:36:07+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Updates the last commit's message without changing its contents.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View local branches
|
||||
tags: repository,branch,beginner
|
||||
firstSeen: 2021-04-04T14:05:57+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints a list of all local branches.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View a summary of changes between two commits
|
||||
tags: repository,branch,intermediate
|
||||
firstSeen: 2021-04-06T22:21:04+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints a summary of changes between two given commits.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View a visual graph of the repository
|
||||
tags: repository,intermediate
|
||||
firstSeen: 2021-04-06T16:28:49+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints a visual graph of all commits and branches in the repository.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View commits by author
|
||||
tags: repository,commit,intermediate
|
||||
firstSeen: 2021-04-06T11:22:55+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints all commits by the specified author.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View commits that manipulated a specific string
|
||||
tags: commit,intermediate
|
||||
firstSeen: 2021-04-06T16:28:49+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints a list of all commits that manipulated a given string.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View commits in a specific date range
|
||||
tags: repository,commit,intermediate
|
||||
firstSeen: 2021-04-06T16:28:49+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints all commits in the specified date range.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View a short summary of commits without merge commits
|
||||
tags: repository,commit,intermediate
|
||||
firstSeen: 2021-04-06T11:22:55+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints a short summary of all commits excluding merge commits.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View a short summary of commits
|
||||
tags: repository,commit,intermediate
|
||||
firstSeen: 2021-04-06T11:22:55+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints a short summary of all commits.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View differences in changes
|
||||
tags: commit,branch,intermediate
|
||||
firstSeen: 2021-04-08T16:30:44+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Displays differences between staged or unstaged changes and the last commit.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View last commit
|
||||
tags: commit,intermediate
|
||||
firstSeen: 2021-04-06T11:22:55+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints the last commit.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View merged branches
|
||||
tags: repository,branch,intermediate
|
||||
firstSeen: 2021-04-08T19:43:13+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints a list of all merged local branches.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View the remote URL
|
||||
tags: repository,intermediate
|
||||
firstSeen: 2021-04-08T19:42:57+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Displays the URL of the remote repository.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View current status
|
||||
tags: branch,beginner
|
||||
firstSeen: 2021-04-06T20:58:33+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
Prints the current status of the working tree.
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
---
|
||||
title: View "undo" history
|
||||
tags: repository,branch,advanced
|
||||
firstSeen: 2021-04-06T16:35:56+03:00
|
||||
lastUpdated: 2021-04-13T21:10:59+03:00
|
||||
---
|
||||
|
||||
View git's reference logs. This is especially useful for finding references that don't show up in commit history.
|
||||
|
||||
Reference in New Issue
Block a user