-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Moved files to drop the git prefix git-status.md is now status.md git-timemachine is now timemachine.md * Added content for Remote repositories Remote menu and basic description Embedded a video of adding a remote Github repository (works the same for Gitlab). * Added content for Timemachine Description of time machine, menu and basic usage. Also added details on how to customise timemachine, although the defaults are very good in my opinion.
- Loading branch information
1 parent
1a0f2b1
commit 686916d
Showing
15 changed files
with
103 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
# Changing History | ||
|
||
> #### TODO::work in progress, sorry | ||
The need to change history in Git should be minimal and should limited to fixing errors made in previous commits on your local repository. | ||
|
||
Here are a few simple tools to help you change your local history. | ||
|
||
> If you need to change history on a share repository, then think again, then think about how many people your history re-writing exercise is going to affect, then think about it again! If you really must change a shared git history, get consent from the people you will affect. | ||
> Its much simpler to commit a new change that fixes the error and let others pull that in, or not make that mistake in the first place. | ||
> #### Hint:: Consentual Shared Remote History rewriting | ||
> If you need to change commit history on a share repository then think about how many people it is going to affect. If you really must change a shared git history, get consent from the people you will affect first. | ||
> | ||
> It is much simpler to commit a new change that fixes the omission or error and let others pull that additional change. | ||
|
||
## Amend commit | ||
## Amend commit | ||
|
||
Really useful if you missed a change in the last commit, especially if that commit was recent. This creates a new commit with both the currently staged changes and the change in the previous commit. | ||
This creates a new commit with both the currently staged changes and the change in the previous commit. | ||
|
||
> The previous commit is no longer available through the normal git tools (although its still there as an object in your `.git` directory). | ||
If you forgot to include some changes in the last commit, then this is a way to avoid two commits for the same logical change. | ||
|
||
{% youtube %} | ||
https://youtu.be/2NNrc61RVx4?autoplay=1loop=1 | ||
{% endyoutube %} | ||
|
||
|
||
## Squash commits | ||
## Squash commits | ||
|
||
> Also see interactive rebasing | ||
## Fixing up | ||
## Fixing up |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
# Local commits | ||
|
||
> #### TODO::work in progress, sorry | ||
## Staging | ||
|
||
|
||
## Commit | ||
## Staging | ||
|
||
|
||
## Commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
# Interactive Rebasing | ||
|
||
Magit makes it easy to do interactive rebasing | ||
> #### TODO::work in progress, sorry | ||
Open the git log view with `l l` and select the point in history you want to rebase from | ||
Magit makes it easy to do interactive rebasing | ||
|
||
Open the git log view with `l l` and select the point in history you want to rebase from | ||
|
||
|
||
## Fixing up | ||
|
||
## Fixing up | ||
|
||
## Squashing | ||
|
||
## Squashing | ||
|
||
Open th e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,24 @@ | ||
# Stashing changes | ||
# Working with Remote Repositories | ||
|
||
`SPC g s` opens Magit Status (equivalent to git status) | ||
|
||
`M` shows pop-up to work with remote repositories | ||
|
||
[![Spacemacs Magit - Remotes menu](/images/spacemacs-magit-remotes-menu.png)](/images/spacemacs-magit-remotes-menu.png) | ||
|
||
|
||
## Adding a remote repository | ||
|
||
Open Magit status using `SPC g s`. | ||
|
||
`M` opens the Remotes menu, showing a popup list of actions | ||
|
||
`a` prompts for the remote name, e.g. origin, followed by a prompt for the URL of the repository, e.g. a github / gitlab address. The final prompt asks to set this new remote as the default, saying yes adds this to the `P` push menu. | ||
|
||
{% youtube %} | ||
https://www.youtube.com/embed/AdEOazt1rD0#t=3m50s?autoplay=1loop=1 | ||
{% endyoutube %} | ||
|
||
> #### Hint:: Jump to 3 minutes 50 seconds | ||
> Adding a remote repository starts at 3 minutes and 50 seconds into this video. | ||
> I will add an edited version at some point. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
# Stashing changes | ||
|
||
> #### TODO::work in progress, sorry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Git Status | ||
|
||
`SPC g s` runs Magit status, showing the changes you have in the git project the current buffer belongs too. | ||
|
||
[![Spacemacs Magit Status Exaple](/images/spacemacs-magit-status-example-full.png)](/images/spacemacs-magit-status-example-full.png) | ||
|
||
|
||
|
||
> #### Hint:: Creating a local git repository | ||
> If you open magit status on a file that is not in version control, magit will prompt you to create a git repository. See [creating a local repository](create-a-local-repository.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Git Timemachine | ||
|
||
Easily navigate backwards and forwards throught the commit history of a file under Git Version Control. The buffer shows the file as it was in each change you select. | ||
|
||
> #### Hint:: Positioning the buffer content | ||
> Timemachine seems to work best when you have all the text visible in a buffer or you roughly know where the changes are in the file as you move between commits. | ||
## Using Timemachine | ||
|
||
`SPC g t` opens the Git Timemachine transient state. | ||
|
||
[![Spacemacs Git Timemachine Menu](/images/spacemacs-git-timemachine-menu.png)](/images/spacemacs-git-timemachine-menu.png) | ||
|
||
Use the following keys to navigate through all the commits for the current file | ||
|
||
| Keybinding | Description | | ||
|------------|-------------------------------------------------| | ||
| `c` | Show the most recent commit for the file | | ||
| `g` | Go to nth commit | | ||
| `p` | Show previous commit | | ||
| `n` | Show next commit | | ||
| `t` | Go to revision by selected commit message | | ||
| `w` | Copy the abbreviated hash of the current commit | | ||
| `W` | Copy the full hash of the current commit | | ||
| `q` | Exit Timemachine transient state | | ||
|
||
|
||
> #### INFO:: Magit blame | ||
> According to the git-timemachine website, `b` runs `magit-blame` on the currently visited revision. This keybinding is not part of the git layer in Spacemacs. | ||
> As the minibuffer already shows author information, it seems redundant to add this option. | ||
## Customise Timemachine | ||
|
||
`SPC SPC customize [git-timemachine]`. | ||
|
||
[![Spacemacs Git Timemachine - Customize](/images/spacemacs-git-timemachine-customize.png)](/images/spacemacs-git-timemachine-customize.png) |