debian-mirror-gitlab/doc/topics/git/numerous_undo_possibilities_in_git/index.md

525 lines
21 KiB
Markdown
Raw Normal View History

2018-03-27 19:54:05 +05:30
---
2020-10-24 23:57:45 +05:30
stage: Create
group: Source Code
2021-02-22 17:27:13 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2019-09-04 21:01:54 +05:30
type: howto
2018-03-27 19:54:05 +05:30
---
2018-03-17 18:26:18 +05:30
2021-03-11 19:13:27 +05:30
# Numerous undo possibilities in Git **(FREE)**
2018-03-17 18:26:18 +05:30
2021-03-11 19:13:27 +05:30
This tutorial shows you different ways of undoing your work in Git.
We assume you have a basic working knowledge of Git. Check the GitLab
2019-09-04 21:01:54 +05:30
[Git documentation](../index.md) for reference.
2021-03-11 19:13:27 +05:30
We only provide some general information about the commands to get you started.
For more advanced examples, refer to the [Git book](https://git-scm.com/book/en/v2).
2018-03-17 18:26:18 +05:30
2021-03-11 19:13:27 +05:30
A few different techniques exist to undo your changes, based on the stage
of the change in your current development. Remember that
[nothing in Git is really deleted](https://git-scm.com/book/en/v2/Git-Internals-Maintenance-and-Data-Recovery).
Until Git cleans detached commits - commits that cannot be accessed by branch or tag -
you can view them with `git reflog` command, and access them with direct commit ID.
Read more about [redoing the undo](#redoing-the-undo) in the section below.
2018-03-17 18:26:18 +05:30
2020-06-23 00:09:42 +05:30
> For more information about working with Git and GitLab:
>
> - <i class="fa fa-youtube-play youtube" aria-hidden="true"></i>&nbsp;Learn why [North Western Mutual chose GitLab](https://youtu.be/kPNMyxKRRoM) for their Enterprise source code management.
> - Learn how to [get started with Git](https://about.gitlab.com/resources/whitepaper-moving-to-git/).
2019-09-04 21:01:54 +05:30
## Introduction
2021-03-11 19:13:27 +05:30
This guide is organized depending on the [stage of development](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository):
- Where do you want to undo your changes from?
- Were they shared with other developers?
Because Git tracks changes, a created or edited file is in the unstaged state
2018-03-17 18:26:18 +05:30
(if created it is untracked by Git). After you add it to a repository (`git add`) you put
a file into the **staged** state, which is then committed (`git commit`) to your
local repository. After that, file can be shared with other developers (`git push`).
2021-03-11 19:13:27 +05:30
This tutorial covers:
2018-03-17 18:26:18 +05:30
2020-05-24 23:13:21 +05:30
- [Undo local changes](#undo-local-changes) which were not pushed to a remote repository:
2018-03-17 18:26:18 +05:30
2019-09-04 21:01:54 +05:30
- Before you commit, in both unstaged and staged state.
- After you committed.
2018-03-17 18:26:18 +05:30
2020-05-24 23:13:21 +05:30
- Undo changes after they are pushed to a remote repository:
2018-03-17 18:26:18 +05:30
2019-09-04 21:01:54 +05:30
- [Without history modification](#undo-remote-changes-without-changing-history) (preferred way).
- [With history modification](#undo-remote-changes-with-modifying-history) (requires
coordination with team and force pushes).
- [Use cases when modifying history is generally acceptable](#where-modifying-history-is-generally-acceptable).
- [How to modify history](#how-modifying-history-is-done).
- [How to remove sensitive information from repository](#deleting-sensitive-information-from-commits).
2018-03-17 18:26:18 +05:30
### Branching strategy
2021-03-11 19:13:27 +05:30
[Git](https://git-scm.com/) is a de-centralized version control system. Beside regular
2018-03-17 18:26:18 +05:30
versioning of the whole repository, it has possibilities to exchange changes
2019-09-04 21:01:54 +05:30
with other repositories.
To avoid chaos with
2020-04-22 19:07:51 +05:30
[multiple sources of truth](https://git-scm.com/about/distributed), various
2021-03-11 19:13:27 +05:30
development workflows have to be followed. It depends on your internal
2018-03-17 18:26:18 +05:30
workflow how certain changes or commits can be undone or changed.
2019-09-04 21:01:54 +05:30
2021-04-17 20:07:23 +05:30
[GitLab Flow](https://about.gitlab.com/topics/version-control/what-is-gitlab-flow/) provides a good
2018-03-17 18:26:18 +05:30
balance between developers clashing with each other while
2021-03-11 19:13:27 +05:30
developing the same feature and cooperating seamlessly. However, it does not enable
2018-03-17 18:26:18 +05:30
joined development of the same feature by multiple developers by default.
2019-09-04 21:01:54 +05:30
2018-03-17 18:26:18 +05:30
When multiple developers develop the same feature on the same branch, clashing
2021-03-11 19:13:27 +05:30
with every synchronization is unavoidable. However, a proper or chosen Git Workflow
prevents lost or out-of-sync data when the feature is complete.
2019-09-04 21:01:54 +05:30
You can also
2020-04-22 19:07:51 +05:30
read through this blog post on [Git Tips & Tricks](https://about.gitlab.com/blog/2016/12/08/git-tips-and-tricks/)
2021-03-11 19:13:27 +05:30
to learn how to do things in Git.
2018-03-17 18:26:18 +05:30
## Undo local changes
2021-03-11 19:13:27 +05:30
Until you push your changes to any remote repository, they only affect you.
2018-03-17 18:26:18 +05:30
That broadens your options on how to handle undoing them. Still, local changes
can be on various stages and each stage has a different approach on how to tackle them.
### Unstaged local changes (before you commit)
2021-03-11 19:13:27 +05:30
When a change is made, but not added to the staged tree, Git
proposes a solution to discard changes to the file.
2018-03-17 18:26:18 +05:30
Suppose you edited a file to change the content using your favorite editor:
```shell
vim <file>
```
2021-03-11 19:13:27 +05:30
Because you did not `git add <file>` to staging, it should be under unstaged files (or
2018-03-17 18:26:18 +05:30
untracked if file was created). You can confirm that with:
```shell
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: <file>
no changes added to commit (use "git add" and/or "git commit -a")
```
At this point there are 3 options to undo the local changes you have:
2019-09-04 21:01:54 +05:30
- Discard all local changes, but save them for possible re-use [later](#quickly-save-local-changes):
2018-03-17 18:26:18 +05:30
2019-10-12 21:52:04 +05:30
```shell
git stash
```
2018-03-17 18:26:18 +05:30
2019-09-04 21:01:54 +05:30
- Discarding local changes (permanently) to a file:
2018-03-17 18:26:18 +05:30
2019-10-12 21:52:04 +05:30
```shell
git checkout -- <file>
```
2018-03-17 18:26:18 +05:30
2019-09-04 21:01:54 +05:30
- Discard all local changes to all files permanently:
2018-03-17 18:26:18 +05:30
2019-10-12 21:52:04 +05:30
```shell
git reset --hard
```
2018-03-17 18:26:18 +05:30
Before executing `git reset --hard`, keep in mind that there is also a way to
just temporary store the changes without committing them using `git stash`.
This command resets the changes to all files, but it also saves them in case
you would like to apply them at some later time. You can read more about it in
[section below](#quickly-save-local-changes).
### Quickly save local changes
2021-03-11 19:13:27 +05:30
You are working on a feature when a boss drops by with an urgent task. Because your
2018-03-17 18:26:18 +05:30
feature is not complete, but you need to swap to another branch, you can use
2021-03-11 19:13:27 +05:30
`git stash` to:
- Save what you have done.
- Swap to another branch.
- Commit, push, and test.
- Return to the feature branch.
- Run `git stash pop`.
- Resume your work.
2018-03-17 18:26:18 +05:30
2021-03-11 19:13:27 +05:30
The example above shows that discarding all changes is not always a preferred option.
However, Git provides a way to save them for later, while resetting the repository to state without
2018-03-17 18:26:18 +05:30
them. This is achieved by Git stashing command `git stash`, which in fact saves your
current work and runs `git reset --hard`, but it also has various
additional options like:
2021-03-11 19:13:27 +05:30
- `git stash save`, which enables including temporary commit message, which helps you identify changes, among with other options
2018-11-20 20:47:30 +05:30
- `git stash list`, which lists all previously stashed commits (yes, there can be more) that were not `pop`ed
- `git stash pop`, which redoes previously stashed changes and removes them from stashed list
- `git stash apply`, which redoes previously stashed changes, but keeps them on stashed list
2018-03-17 18:26:18 +05:30
### Staged local changes (before you commit)
2021-03-11 19:13:27 +05:30
If you add some files to staging, but you want to remove them from the
current commit while retaining those changes, move them outside
of the staging tree. You can also discard all changes with
2018-03-17 18:26:18 +05:30
`git reset --hard` or think about `git stash` [as described earlier.](#quickly-save-local-changes)
2021-03-11 19:13:27 +05:30
Lets start the example by editing a file with your favorite editor to change the
content and add it to staging:
2018-03-17 18:26:18 +05:30
2020-03-13 15:44:24 +05:30
```shell
2018-03-17 18:26:18 +05:30
vim <file>
git add <file>
```
The file is now added to staging as confirmed by `git status` command:
```shell
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
2019-09-04 21:01:54 +05:30
new file: <file>
2018-03-17 18:26:18 +05:30
```
Now you have 4 options to undo your changes:
2019-09-04 21:01:54 +05:30
- Unstage the file to current commit (HEAD):
2018-03-17 18:26:18 +05:30
2019-10-12 21:52:04 +05:30
```shell
git reset HEAD <file>
```
2018-03-17 18:26:18 +05:30
2019-09-04 21:01:54 +05:30
- Unstage everything - retain changes:
2018-03-17 18:26:18 +05:30
2019-10-12 21:52:04 +05:30
```shell
git reset
```
2018-03-17 18:26:18 +05:30
2019-09-04 21:01:54 +05:30
- Discard all local changes, but save them for [later](#quickly-save-local-changes):
2018-03-17 18:26:18 +05:30
2019-10-12 21:52:04 +05:30
```shell
git stash
```
2018-03-17 18:26:18 +05:30
2019-09-04 21:01:54 +05:30
- Discard everything permanently:
2018-03-17 18:26:18 +05:30
2019-10-12 21:52:04 +05:30
```shell
git reset --hard
```
2018-03-17 18:26:18 +05:30
## Committed local changes
2021-03-11 19:13:27 +05:30
After you commit, your changes are recorded by the version control system.
2018-03-17 18:26:18 +05:30
Because you haven't pushed to your remote repository yet, your changes are
still not public (or shared with other developers). At this point, undoing
2021-03-11 19:13:27 +05:30
things is a lot easier, we have quite some workaround options. After you push
your code, you have fewer options to troubleshoot your work.
2018-03-17 18:26:18 +05:30
### Without modifying history
Through the development process some of the previously committed changes do not
2021-03-11 19:13:27 +05:30
fit anymore in the end solution, or are source of the bugs. After you find the
commit which triggered bug, or identify a faulty commit, you can
2019-09-04 21:01:54 +05:30
revert it with `git revert commit-id`.
This command inverts (swaps) the additions and
2018-03-17 18:26:18 +05:30
deletions in that commit, so that it does not modify history. Retaining history
can be helpful in future to notice that some changes have been tried
unsuccessfully in the past.
2021-03-11 19:13:27 +05:30
In our example we assume there are commits `A`,`B`,`C`,`D`,`E` committed in this order: `A-B-C-D-E`,
2018-03-17 18:26:18 +05:30
and `B` is the commit you want to undo. There are many different ways to identify commit
2021-03-11 19:13:27 +05:30
`B` as bad. One of them is to pass a range to `git bisect` command. The provided range includes
last known good commit (we assume `A`) and first known bad commit where the bug was detected (we assume `E`).
2018-03-17 18:26:18 +05:30
```shell
git bisect A..E
```
2021-03-11 19:13:27 +05:30
Bisect provides us with commit ID of the middle commit to test, and then guide us
through the bisection process. You can read more about it [in official Git Tools](https://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git)
Our example results in commit `B`, which introduced the bug/error. We have
these options to remove all or part of it from our repository:
2018-03-17 18:26:18 +05:30
2019-09-04 21:01:54 +05:30
- Undo (swap additions and deletions) changes introduced by commit `B`:
2018-03-17 18:26:18 +05:30
2019-10-12 21:52:04 +05:30
```shell
git revert commit-B-id
```
2018-03-17 18:26:18 +05:30
2019-09-04 21:01:54 +05:30
- Undo changes on a single file or directory from commit `B`, but retain them in the staged state:
2018-03-17 18:26:18 +05:30
2019-10-12 21:52:04 +05:30
```shell
git checkout commit-B-id <file>
```
2018-03-17 18:26:18 +05:30
2019-09-04 21:01:54 +05:30
- Undo changes on a single file or directory from commit `B`, but retain them in the unstaged state:
2018-03-17 18:26:18 +05:30
2019-10-12 21:52:04 +05:30
```shell
2020-04-08 14:13:33 +05:30
git reset commit-B-id <file>
2019-10-12 21:52:04 +05:30
```
2018-11-20 20:47:30 +05:30
- There is one command we also must not forget: **creating a new branch**
from the point where changes are not applicable or where the development has hit a
2021-03-11 19:13:27 +05:30
dead end. For example you have done commits `A-B-C-D` on your feature branch
2019-09-04 21:01:54 +05:30
and then you figure `C` and `D` are wrong.
At this point you either reset to `B`
2021-03-11 19:13:27 +05:30
and do commit `F` (which causes problems with pushing and if forced pushed also with other developers)
because the branch now looks `A-B-F`, which clashes with what other developers have locally (you will
[change history](#with-history-modification)), or you checkout commit `B` create
2018-11-20 20:47:30 +05:30
a new branch and do commit `F`. In the last case, everyone else can still do their work while you
have your new way to get it right and merge it back in later. Alternatively, with GitLab,
you can [cherry-pick](../../../user/project/merge_requests/cherry_pick_changes.md#cherry-picking-a-commit)
that commit into a new merge request.
2019-10-12 21:52:04 +05:30
![Create a new branch to avoid clashing](img/branching.png)
2018-11-20 20:47:30 +05:30
2019-10-12 21:52:04 +05:30
```shell
git checkout commit-B-id
git checkout -b new-path-of-feature
# Create <commit F>
git commit -a
```
2018-03-17 18:26:18 +05:30
### With history modification
There is one command for history modification and that is `git rebase`. Command
provides interactive mode (`-i` flag) which enables you to:
2019-09-04 21:01:54 +05:30
- **reword** commit messages (there is also `git commit --amend` for editing
last commit message).
- **edit** the commit content (changes introduced by commit) and message.
- **squash** multiple commits into a single one, and have a custom or aggregated
commit message.
2021-03-11 19:13:27 +05:30
- **drop** commits - delete them.
2019-09-04 21:01:54 +05:30
- and few more options.
2018-03-17 18:26:18 +05:30
Let us check few examples. Again there are commits `A-B-C-D` where you want to
delete commit `B`.
- Rebase the range from current commit D to A:
2019-10-12 21:52:04 +05:30
```shell
git rebase -i A
```
2018-03-17 18:26:18 +05:30
- Command opens your favorite editor where you write `drop` in front of commit
`B`, but you leave default `pick` with all other commits. Save and exit the
editor to perform a rebase. Remember: if you want to cancel delete whole
file content before saving and exiting the editor
In case you want to modify something introduced in commit `B`.
- Rebase the range from current commit D to A:
2019-10-12 21:52:04 +05:30
```shell
git rebase -i A
```
2018-03-17 18:26:18 +05:30
- Command opens your favorite text editor where you write `edit` in front of commit
`B`, but leave default `pick` with all other commits. Save and exit the editor to
2019-09-04 21:01:54 +05:30
perform a rebase.
2018-03-17 18:26:18 +05:30
- Now do your edits and commit changes:
2019-10-12 21:52:04 +05:30
```shell
git commit -a
```
2018-03-17 18:26:18 +05:30
2021-03-11 19:13:27 +05:30
You can find some more examples in the section explaining
[how to modify history](#how-modifying-history-is-done).
2018-03-17 18:26:18 +05:30
### Redoing the Undo
Sometimes you realize that the changes you undid were useful and you want them
back. Well because of first paragraph you are in luck. Command `git reflog`
enables you to *recall* detached local commits by referencing or applying them
2020-05-24 23:13:21 +05:30
via commit ID. Although, do not expect to see really old commits in reflog, because
2020-04-22 19:07:51 +05:30
Git regularly [cleans the commits which are *unreachable* by branches or tags](https://git-scm.com/book/en/v2/Git-Internals-Maintenance-and-Data-Recovery).
2018-03-17 18:26:18 +05:30
To view repository history and to track older commits you can use below command:
```shell
$ git reflog show
# Example output:
b673187 HEAD@{4}: merge 6e43d5987921bde189640cc1e37661f7f75c9c0b: Merge made by the 'recursive' strategy.
eb37e74 HEAD@{5}: rebase -i (finish): returning to refs/heads/master
eb37e74 HEAD@{6}: rebase -i (pick): Commit C
97436c6 HEAD@{7}: rebase -i (start): checkout 97436c6eec6396c63856c19b6a96372705b08b1b
...
88f1867 HEAD@{12}: commit: Commit D
97436c6 HEAD@{13}: checkout: moving from 97436c6eec6396c63856c19b6a96372705b08b1b to test
97436c6 HEAD@{14}: checkout: moving from master to 97436c6
05cc326 HEAD@{15}: commit: Commit C
6e43d59 HEAD@{16}: commit: Commit B
```
2020-05-24 23:13:21 +05:30
Output of command shows repository history. In first column there is commit ID,
2018-03-17 18:26:18 +05:30
in following column, number next to `HEAD` indicates how many commits ago something
was made, after that indicator of action that was made (commit, rebase, merge, ...)
and then on end description of that action.
## Undo remote changes without changing history
This topic is roughly same as modifying committed local changes without modifying
history. **It should be the preferred way of undoing changes on any remote repository
or public branch.** Keep in mind that branching is the best solution when you want
2019-09-04 21:01:54 +05:30
to retain the history of faulty development, yet start anew from certain point.
Branching
2018-03-17 18:26:18 +05:30
enables you to include the existing changes in new development (by merging) and
it also provides a clear timeline and development structure.
![Use revert to keep branch flowing](img/revert.png)
2021-04-29 21:17:54 +05:30
If you want to revert changes introduced in certain `commit-id`, you can
2018-03-17 18:26:18 +05:30
revert that `commit-id` (swap additions and deletions) in newly created commit:
You can do this with
```shell
git revert commit-id
```
or creating a new branch:
```shell
git checkout commit-id
git checkout -b new-path-of-feature
```
## Undo remote changes with modifying history
This is useful when you want to *hide* certain things - like secret keys,
2021-03-11 19:13:27 +05:30
passwords, and SSH keys. It is and should not be used to hide mistakes, as
it makes it harder to debug in case there are some other bugs. The main
reason for this is that you loose the real development progress. Keep in
2018-03-17 18:26:18 +05:30
mind that, even with modified history, commits are just detached and can still be
2021-03-11 19:13:27 +05:30
accessed through commit ID - at least until all repositories perform
the automated cleanup of detached commits.
2018-03-17 18:26:18 +05:30
![Modifying history causes problems on remote branch](img/rebase_reset.png)
### Where modifying history is generally acceptable
Modified history breaks the development chain of other developers, as changed
2020-11-24 15:15:51 +05:30
history does not have matching commit IDs. For that reason it should not be
2021-03-11 19:13:27 +05:30
used on any public branch or on branch that might be used by other developers.
2020-04-22 19:07:51 +05:30
When contributing to big open source repositories (for example, [GitLab](https://gitlab.com/gitlab-org/gitlab/blob/master/CONTRIBUTING.md#contribution-acceptance-criteria)
2021-03-11 19:13:27 +05:30
itself), it is acceptable to squash commits into a single one, to present a
2019-12-04 20:38:33 +05:30
nicer history of your contribution.
2019-09-04 21:01:54 +05:30
2018-03-17 18:26:18 +05:30
Keep in mind that this also removes the comments attached to certain commits
in merge requests, so if you need to retain traceability in GitLab, then
modifying history is not acceptable.
2019-09-04 21:01:54 +05:30
2021-03-11 19:13:27 +05:30
A feature branch of a merge request is a public branch and might be used by
2019-07-07 11:18:12 +05:30
other developers, but project process and rules might allow or require
2018-03-17 18:26:18 +05:30
you to use `git rebase` (command that changes history) to reduce number of
displayed commits on target branch after reviews are done (for example
GitLab). There is a `git merge --squash` command which does exactly that
(squashes commits on feature-branch to a single commit on target branch
at merge).
2021-02-22 17:27:13 +05:30
NOTE:
2019-09-04 21:01:54 +05:30
Never modify the commit history of `master` or shared branch.
2018-03-17 18:26:18 +05:30
### How modifying history is done
After you know what you want to modify (how far in history or how which range of
2021-03-11 19:13:27 +05:30
old commits), use `git rebase -i commit-id`. This command displays all the commits from
2020-05-24 23:13:21 +05:30
current version to chosen commit ID and allow modification, squashing, deletion
2018-03-17 18:26:18 +05:30
of that commits.
```shell
$ git rebase -i commit1-id..commit3-id
pick <commit1-id> <commit1-commit-message>
pick <commit2-id> <commit2-commit-message>
pick <commit3-id> <commit3-commit-message>
# Rebase commit1-id..commit3-id onto <commit4-id> (3 command(s))
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
# d, drop = remove commit
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out
```
2021-02-22 17:27:13 +05:30
NOTE:
2021-03-11 19:13:27 +05:30
The comment from the output clearly states that, if
you decide to abort, don't just close your editor (as that
modifies history), but remove all uncommented lines and save.
2018-03-17 18:26:18 +05:30
2021-03-11 19:13:27 +05:30
Use `git rebase` carefully on
shared and remote branches, but rest assured: nothing is broken until
2018-03-17 18:26:18 +05:30
you push back to the remote repository (so you can freely explore the
different outcomes locally).
```shell
# Modify history from commit-id to HEAD (current commit)
git rebase -i commit-id
```
### Deleting sensitive information from commits
Git also enables you to delete sensitive information from your past commits and
it does modify history in the progress. That is why we have included it in this
section and not as a standalone topic. To do so, you should run the
`git filter-branch`, which enables you to rewrite history with
2020-04-22 19:07:51 +05:30
[certain filters](https://git-scm.com/docs/git-filter-branch#_options).
2018-03-17 18:26:18 +05:30
This command uses rebase to modify history and if you want to remove certain
file from history altogether use:
```shell
git filter-branch --tree-filter 'rm filename' HEAD
```
2021-03-11 19:13:27 +05:30
Because `git filter-branch` command might be slow on big repositories, there are
2018-03-17 18:26:18 +05:30
tools that can use some of Git specifics to enable faster execution of common
tasks (which is exactly what removing sensitive information file is about).
2020-04-22 19:07:51 +05:30
An alternative is the open source community-maintained tool [BFG](https://rtyley.github.io/bfg-repo-cleaner/).
2020-04-08 14:13:33 +05:30
Keep in mind that these tools are faster because they do not provide the same
2019-12-21 20:55:43 +05:30
feature set as `git filter-branch` does, but focus on specific use cases.
2018-03-17 18:26:18 +05:30
2021-03-08 18:12:59 +05:30
Refer [Reduce repository size](../../../user/project/repository/reducing_the_repo_size_using_git.md) page to know more about purging files from repository history & GitLab storage.
2018-03-17 18:26:18 +05:30
## Conclusion
2021-03-11 19:13:27 +05:30
Various options exist for undoing your work with any version control system, but
because of the de-centralized nature of Git, these options are multiplied (or limited)
2018-03-17 18:26:18 +05:30
depending on the stage of your process. Git also enables rewriting history, but that
should be avoided as it might cause problems when multiple developers are
contributing to the same codebase.
2019-09-04 21:01:54 +05:30
<!-- ## Troubleshooting
Include any troubleshooting steps that you can foresee. If you know beforehand what issues
one might have when setting this up, or when something is changed, or on upgrading, it's
important to describe those, too. Think of things that may go wrong and include them here.
This is important to minimize requests for support, and to avoid doc comments with
questions that you know someone might ask.
Each scenario can be a third-level heading, e.g. `### Getting error message X`.
If you have none to add when creating a doc, leave this section in place
but commented out to help encourage others to add to it in the future. -->
2018-03-17 18:26:18 +05:30
<!-- Identifiers, in alphabetical order -->