Tag: repo

How to edit a file directly from the GitHub repository UI – #004

Suppose you have a file that you want to edit in a repo. Similarly to creating a new file, you can also use the UI on GitHub.com to edit a file.

Click on the file you want to edit. In this case, I’ll edit my penultimate FAQ.md file.

FAQ.md listed in the repository list of files

On the page where you can view the contents of the file, to the far right side, there’s a pen icon button to Edit this file.

Edit this file pen icon shown on far right

Clicking on Edit this file will put you in the edit UI, similar to the add new file UI.

And just like in adding a new file, you can specify what the commit message should contain and where the commit should go, either current branch (e.g. master in this image) or a new branch.

Commit changes using default message but custom extended commit message

How to add a Readme to a newly created repo if you forgot to check the Readme box – #003

I can’t tell you how many of times I’ve wanted to quickly setup a new repo to add some files directly to it via the UI (see yesterday’s tip), but I forgot to click the Initialize this repository with a README checkbox on the /new page.

Initialize this repository with a README checkbox on /new page

If you’re like me and you’ve realize you forgot to check the checkbox, you can add the file by clicking the README link in the list of recommended files.

"We recommend every repository include a README" link being clicked

Clicking README will automatically create a new README.md file for you to add via the GitHub.com UI.

new README.md file in edit mode

How to add a new file directly from the repo UI itself – #002

If you ever need to add a new file, perhaps a readme, license, or a FAQ guide, you can go directly to the repo on GitHub.com and clicking the Create New File button.

Create new file button on repository page

Now you’ll be taken to a create new file page on the master branch.

Add a file name (don’t forget the extension!)

editing new file FAQ.md on repository page

Now you have the option to commit directly to master (or whatever branch you were currently on – stay tuned!) or commit to a new branch. We’ll cover all of this in due time, one day at a time.

default commit message for Create FAQ.md

If you have nothing interesting to add, you can keep the default commit message and optional extended description.

And click commit new file!

FAQ.md shown listed in the repository

One of my favorite books is called The Penultimate Truth by Philip K. Dick. Not because of the story line (although the story is good), but because I love the word Penultimate. The next time I come in second place, I’m going to announce I’m the Penultimate winner! It’s the simple things in life Smile

How to see the language percentage breakdown of a repository – #001

To see your language percentage being used in your repository, simply click anywhere on the color bar…

image

and you’ll see the breakdown of languages detected inside.

image

If you want to see how GitHub is calculating these percentages, check out the github/linguist repository!

If you see the wrong language being reported for your repository, you can open an issue over at github/linguist or submit a pull request. See their contributing guidelines.

I was sitting next to a friend at a local conference listening to a How to use GitHub Pages presentation. She said she was having trouble following along because she had made a mistake somewhere. She pointed at her screen and said GitHub was showing her errors in her newly created Pages repository, because she only saw a solid red bar at the top. I explained to her that the bar represents the language being used, so in her case it was a pure HTML project. I told her that I had no idea the repo bar showed these percentages either until just a few months prior. I thought the bar was just a colored div since most of my own projects are just 1 language Smile