Skip to content

Instantly share code, notes, and snippets.

@anilpai
Last active February 28, 2020 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anilpai/c161f4bc4ae4e84783cbef24ebc184d2 to your computer and use it in GitHub Desktop.
Save anilpai/c161f4bc4ae4e84783cbef24ebc184d2 to your computer and use it in GitHub Desktop.
git_clone_depth=1.
Another option if you want to keep the repo as is with the new commits you have added since the shallow, initial commit is this: Amend this commit with an interactive rebase.
Start an interactive rebase including the first (root) commit with
git rebase --interactive --root
Change the pick of the initial commit(s) to edit and save & close the file.
If you've cloned the repo with greater depth than 1, you may need to do the same for all of those commits. Or, alternatively, execute fixup for all of these during the interactive rebase.
Convert this commit to a regular, unshallow commit with
git commit --amend --no-edit
This will also change the commit ID and add you as co-author to this initial commit.
Don't forget to finish your rebase
git rebase --continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment