GitHub – Why is the ‘File Upload Button’ Not Showing Up?

githubupload

As I understand it, under the main page of the repository there should be a button to create/upload new file to the left of "Username / Repository Name" in the GitHub web interface. There is not.

According to this question, I should be able to drag and drop while under the Repository -> "Code" tab. This is not possible either.

*Using Firefox, Javascript is enabled.

UPDATE

This is the page I am viewing: it is the main page for a selected repository. It must be the wrong the place. I have redacted my profile and repository name, but rest assured there is not a "Create New" or "Upload" button under any of them. The "+" in the upper right hand corner has been expanded to show there are no options like these here either. The portion covered by the expanded "+" button does not contain the links either.

Github Respository Main Page

Best Answer

GitHub's web interface will not show the File Upload button until you've made your first commit.

When working with Git, every repository needs to be initialized with a starting set of files to work from, typically, in the form of a README file. Strangely, GitHub does not allow you to make this first commit by uploading files from the web interface.

There are two ways to make your first commit:

Initialize with a README

When creating a new repository, you can check Initialize this repository with a README to create the first commit for you.

Initialize with readme

Push commits to an existing project

If your repository was already created, you can use the Git command line to push commits from your PC.

  1. Open Git Bash.
  2. Change the current working directory to your local project.
  3. Initialize the local directory as a Git repository.

    git init
    
  4. Add the files in your new local repository. This stages them for the first commit.

    git add .
    # Adds the files in the local repository and stages them for commit.
    # To unstage a file, use 'git reset HEAD YOUR-FILE'.
    
  5. Commit the files that you've staged in your local repository.

    git commit -m "First commit"
    # Commits the tracked changes and prepares them to be pushed to a remote
    # repository. To remove this commit and modify the file, use 'git reset --soft
    # HEAD~1' and commit and add the file again.
    
  6. At the top of your GitHub repository's Quick Setup page, click the clipboard icon to copy the remote repository URL.

  7. In the Command prompt, add the URL for the remote repository where your local repository will be pushed.

    git remote add origin remote repository URL
    # Sets the new remote
    git remote -v
    # Verifies the new remote URL
    
  8. Push the changes in your local repository to GitHub.

    git push origin master
    # Pushes the changes in your local repository up to the remote repository you
    # specified as the origin
    

GitHub: Adding an existing project to GitHub using the command line