Other Git Tips...

Misc. git quips & links

Github Pages - Project Pages

To host static files from your repo, simply commit a /docs folder in the master branch. You can also use a special gh-pages branch. Then configure the appropriate settings in the Github repo. This is especially helpful if you want to share a view (HTML page, etc.) with the rest of the team for that project.

Source: https://help.github.com/en/articles/configuring-a-publishing-source-for-github-pages

Counting Contributions

To ensure your commits are tracked on Github, check that they satisfy the following requirements:

  • The author of the commits has the same user.name & user.email as the Github account

    • git config --global user.name "Your Name"

    • git config --global user.email you@example.com

  • Commits will eventually be merged into master

    • Commits not on/merged into master unfortunately earn no credit

Source: https://help.github.com/en/articles/why-are-my-contributions-not-showing-up-on-my-profile

Orphan Branch

Sometimes you want to start a branch with no history. For example, we may have messed up our first commit and we want to simply restart master. We can do this by switching branches, deleting master, and then creating a new orphan branch called master.

$ git checkout -b temp
$ git branch -d master
$ git checkout --orphan master
$ git branch -d temp

Last updated

Was this helpful?