Xiaohua Cai
Xiaohua Cai

Reputation: 1

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

Upvotes: 0

Views: 86

Answers (2)

RoyalGoose
RoyalGoose

Reputation: 523

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

Upvotes: 0

Rishit Dagli
Rishit Dagli

Reputation: 1006

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

Upvotes: 2

Related Questions