Search code examples
githubrepositorygit-bashgit-push

Files not appearing on github


I am new to web development and have just created my first project. I created a new repository on github and then did the following on git bash:

  1. Moved to the working directory for my project
  2. Initialized the git repository using git init
  3. Added my files using git add .
  4. Committed the files using git commit -m 'my message'
  5. Added the github URL under code. on github by using git remote add origin 'my_url_name'
  6. Pushed the code to github using git push -u origin master (also entered my passphrase correctly as I am using SSH)
  7. Git Bash confirmed the upload and then nothing appeared on my repository on github
  8. Note. I did get a message at the top of the repository saying "master had recent pushes x minutes ago: with a button that says "Compare & pull request" though the page just shows a message "There isn't anything to compare."

Am I missing a step?


Solution

  • Make sure you are selecting the correct branch on github. At the top of the repository, on the same line as "Go to file" "Add file" and "Code" on the far left is a button to select the branch. Make sure the branch is the same as the branch used as origin when the push was declared on Git Bash.