Skip to content

Remotes in GitLab instructor note

Everyone did different things when they created a gitlab repository and then they got very stuck

  • Create an instructor note to super emphasize to go 3x slower than you think you have to and really emphasize that no learners should skip ahead; they have to follow everything exactly or something will go wrong
  • Emphasize to uncheck the readme
  • Emphasize to select username and not other project space
  • Emphasize to not protect your main branch
  • Emphasize everything you are either checking or not checking!

Also potentially include in instructor note these potential errors:

  • Sometimes the popup box requesting your credentials for accessing GitLab will not be obvious or may be hidden. Look around for the pop up. 
  • Error: fatal: pathspec 'origin' did not match any files 
    • Ensure that your URL for your repository is set properly: git remote –v 
    • If it is not correct, you can update it with: git remote set-url origin NEW_URL 
  • Two potential solutions to having a readme already in your upstream 
    • Force the work from your local repo: git push –force origin main 
    • If your repo doesn’t allow force pushes to protected branches, pull from the remote repo before pushing: git pull origin main --allow-unrelated-histories 
  • If you already had a GitLab credential, you may need to delete it from your Credentials Managers: \
  • Then, try running the command again and Git Bash should prompt for new credentials.