Error when commiting to Github from command line - github

Every time I try and commit changes to GitHub from the command line (after following the tutorial below from GitHub) I get the erorr "fatal: I don't handle protocol 'https:https'"
I'm following this short tutorial from GitHub.
Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/tuzion/baby-companion.git
git push -u origin master
Thanks!
-- I'm on a Mac, btw.

Did you input the SSH keys into the Github Account Setting?
Check your account setting/SSH keys..

Related

Github contributions not showing up but emails match

My Github contributions aren't being tracked when I commit from the command line and I can't figure out why.
My git config user.email and git config --global user.email and my primary email on Github all match.
However, when I went on the github site and deleted a file from a PR through the GUI, and committed it, that showed up as a contribution.
Any ideas? Thanks!
There are a couple possibilities:
You haven't pushed them to GitHub.
Your changes aren't in the main repository, but a fork.
Your changes aren't in the default branch.
GitHub has documentation on the reasons this can happen.
You need to use the git push command to push the changes to the repository on GitHub. Otherwise, the changes will take effect in your local repository.
# After making changes to the local repository, use the command below to monitor all those changes.
git add .
# Use the command below to commit all changes.
git commit -m "Message"
# Run the following command for the changes to take effect in the repository on GitHub:
git push -u origin feature
# If your branch name is "main" use it like this:
git push -u origin main
If your git config user.email and git config --global user.email and your primary email on Github all match. Then the issue might be because of the below suggestion.
After making a commit that meets the requirements to count as a contribution, you may need to wait for up to 24 hours to see the contribution appear on your contributions graph.
Got this from the GitHub Docs

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:
Moved to the working directory for my project
Initialized the git repository using git init
Added my files using git add .
Committed the files using git commit -m 'my message'
Added the github URL under code. on github by using git remote add origin 'my_url_name'
Pushed the code to github using git push -u origin master (also entered my passphrase correctly as I am using SSH)
Git Bash confirmed the upload and then nothing appeared on my repository on github
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?
The branch selected in your git is master. But in GitHub is main. To display your codes in GitHub, you need to change the Git branch to main.
First delete previous repository in Github and create a new , then act according to the following codes in the git :
git branch main
git checkout main
git merge master
git branch -M main
git remote set-url origin https://github.com/masoud8911/example.git
git push -u origin main
It could be that your local branch name is main not master. You can check this locally with:
git branch.
try instead:
git push -u origin main
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.

Pushing folder into github

I was trying to push the folder on my computer to GitHub. So I created a GitHub repository, and use git bash command line. I didn't push the folder successfully on my first try. Then, I deleted the old GitHub repository and created a new one, and tried using the git bash command line to push code again. However, it shows nothing to commit.
Here is an image to better help understand
According to the image, I understand that you have made a commit but your commit was empty and you did not track any file with git beforehand. You typically want to track the files you want to commit. So in this case you could use git add before committing:
git add .
This should track all files in the current folder after which you could commit and push them:
git commit -m "Some message"
git push
When you create a new repository on git, it shows you how to properly upload data
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/youracc/your.git
git push -u origin main

how to code commit on github using MINGW32?

i created a repositories on github.
now i want to put my some code there can anybody tell me how to do this and how to commit code.
i tried using this lines
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/Dany001/myrepo.git
git push -u origin master
please short out my problem
Thanks

fatal: https://github.com/user/repo.git/info/refs not found: did you run git update-server-info on the server?

I am running the following script to set up a git repository on GitHub:
Global setup:
git config --global user.name "Your Name"
git config --global user.email email_id#email.com
Next steps:
mkdir MultiView
cd MultiView
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin https://github.com/nalgene/MultiView.git
git push -u origin master
The last line git push -u origin master or git push origin master for that matter returns an error:
fatal: https://github.com/naglene/MultiView.git/info/refs not found: did you run git update-server-info on the server?
I researched the issue and it seems the most likely reason is a typo (case sensitive) but I made sure that is not an issue. I used git remote -v to check the origin is correct. What else can be the issue?
You have to carefully look after your spelling. According to Github's guide, your username is nalgene, hence the URL is https://github.com/nalgene/MultiView.git. The error message hints that you added the remote as https://github.com/naglene/MultiView.git which is not the same username, as you swapped the l and g.
Also, the default branch is called master, not maaster or mater.
With Github, you must first make sure that you've made the repository on github itself before trying to push to it from your side. See this answer:
https://stackoverflow.com/a/12407847/735614
Did you make the repo there? Or are you only making it on your side and trying to create it on the server by pushing?
This is almost too obvious to mention, but this can also happen if you forget to create a new repository on Github before running git push.