Commit 20d35ad5 authored by JackV's avatar JackV

Cleanup, type/formatting fixes

parent e17e09b3
Pipeline #461 passed with stage
in 2 minutes and 21 seconds
...@@ -47,7 +47,7 @@ It is composed of: ...@@ -47,7 +47,7 @@ It is composed of:
* One (or more) father sha1s * One (or more) father sha1s
* None or more file diffs * None or more file diffs
Generally a commit represents a 'snapshot' of all the project files A commit can also be seen as a 'snapshot' of all of the project's files
--- ---
...@@ -77,10 +77,12 @@ Generally this means your repo on github/gitlab/gitea/etc. ...@@ -77,10 +77,12 @@ Generally this means your repo on github/gitlab/gitea/etc.
There are 2 types of branches: There are 2 types of branches:
* Local branches (es. **master**) * Local branches (es. **master**)
* Remote branches (es. **origin/master**) * Remote branches (es. **origin/master**)
A local branch can __track__ a remote branch, which means that A local branch can __track__ a remote branch, which means that
* **push**es from the local branch will go to the tracked remote branch * **push**es from the local branch will go to the tracked remote branch
* **pull**s will be merged to the tracking branch * **pull**s will be merged to the tracking branch
By default when you `git clone` git sets up the `master` branch to track `origin/master`
By default when you **`git clone`** git sets up the _master_ branch to track _origin/master_
--- ---
...@@ -97,14 +99,15 @@ By default when you `git clone` git sets up the `master` branch to track `origin ...@@ -97,14 +99,15 @@ By default when you `git clone` git sets up the `master` branch to track `origin
We say that a branch A is fast-forwardable w.r.t. branch B iff We say that a branch A is fast-forwardable w.r.t. branch B iff
there is no bifurcation between A and B. there is no bifurcation between A and B.
Why is this important? Why is this important?
* A merge of a fast-forwardable branch always succeeds (just move B to point to A) * A merge of a fast-forwardable branch always succeeds (just move B to point to A's commit)
* **git pull** and **git push** do not break only on fast forwardable branches (e.g. _master_ and _origin/master_) * **git pull** and **git push** do not break only on fast forwardable branches (e.g. _master_ and _origin/master_)
--- ---
## Forcing a push on a non-ff branch ## Forcing a push on a non-ff branch
If you have a branch that has diverged, you need to use **`git push --force`** If you have a branch that has diverged, you need to use
**`git push --force`**
Note that once you do this, every person that has cloned your repo will need Note that once you do this, every person that has cloned your repo will need
to **`git pull --force`** and probably come to your house with torch and pitchfork. to **`git pull --force`** and probably come to your house with torch and pitchfork.
**tl;dr `git push --force` responsibly** **tl;dr `git push --force` responsibly**
...@@ -124,7 +127,7 @@ to **`git pull --force`** and probably come to your house with torch and pitchfo ...@@ -124,7 +127,7 @@ to **`git pull --force`** and probably come to your house with torch and pitchfo
---- ----
## amending commits ## amending commits
![](assets/chisel.png) ![](assets/trowel.jpg)
--- ---
...@@ -210,7 +213,7 @@ Rebase can also be used to touch-up a commit history ...@@ -210,7 +213,7 @@ Rebase can also be used to touch-up a commit history
**`git rebase -i <end commit>`** **`git rebase -i <end commit>`**
Once run a file will be opened with __$EDITOR__ Once run a file will be opened with __$EDITOR__
Possible operations: Possible operations:
* reword: change the commit message * reword: change the commit message
* edit: change the file just before they were committed * edit: change the file just before they were committed
...@@ -229,14 +232,14 @@ Possible operations: ...@@ -229,14 +232,14 @@ Possible operations:
--- ---
## git filter-branch --index-filter ### `git filter-branch --index-filter`
Allows to apply changes only to the index Allows to apply changes only to the index
(basically only *git* commands are allowed) (basically only *git* commands are allowed)
--- ---
## git filter-branch --tree-filter ### `git filter-branch --tree-filter`
Allows us to run multiple commands on each commit Allows us to run multiple commands on each commit
(it is much slower than index-filter since each individual commit (it is much slower than index-filter since each individual commit
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment