Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions on how to update copy of template #66

Open
erikw opened this issue Feb 17, 2022 · 1 comment
Open

Add instructions on how to update copy of template #66

erikw opened this issue Feb 17, 2022 · 1 comment

Comments

@erikw
Copy link
Contributor

erikw commented Feb 17, 2022

It's nice to be up to date with the latest development in this main repo. For example I would like to get recently merged #65 in to my own copy of this repo.

As we create copies from this template repo instead of a fork, it's a bit more tricky to make the update. Are there already some instructions on how this can be done?

I did the following to update my own copy. There are for sure easier and better ways, but it did the job for me now.

In my copy of this repo at the master branch:

git remote add template [email protected]:jstrieb/github-stats.git
git fetch template

# Remove all bot commits to make my git history cleaner. Maybe not necessary?
# Reference: https://stackoverflow.com/a/8058619/265508
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --commit-filter '
    if [ "$GIT_AUTHOR_EMAIL" = "[email protected]:jstrieb/github-stats.git" ];
    then
            skip_commit "$@";
    else
            git commit-tree "$@";
    fi' HEAD

# Squash merge upstream changes in to 1 new commit.
git merge -Xtheirs --squash --allow-unrelated-histories template/master
git commit -m "Update from template"
git push -f origin master

I think we should add some instructions to the README on how people can keep their copies up to date with this repo :). If it involves a few shell commands, ideally they should be directly copy-and-pasteable for ultimate user convenience.

Relevant discussion on SO:
https://stackoverflow.com/questions/56577184/github-pull-changes-from-a-template-repository#56577320

@jstrieb
Copy link
Owner

jstrieb commented May 8, 2022

Hi @erikw! I definitely think this is a good idea! Especially since issue #19 for adding a dark theme has just been merged.

I'll do some research and testing locally, and may add some instructions to the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants