Domanda

I created a project on GitHub, added files (basically copy-paste content from my work files) and then I realised that I wanted to:

  • create folders
  • move files here and there.

I installed GitHub for Windows and managed to clone my remote project locally by pressing CLONE at the remote repository.

Then, I created a new folder and copied there a file from my root.

Now, when I choose Local Repositories -> open this repo I can see my new folder and file but when I click sync it says "Failed to sync this branch".

I even looked at my command line:

git init
git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

new file:   folder/new-file

I tried:

git add folder/new-file

but it insists on asking a git reset head....

I even tried:

git add -A .

but git status complains again.

È stato utile?

Soluzione

What this

(use "git reset HEAD <file>..." to unstage)

is telling that if you want to unstage or rather not commit the file use git reset.

The next stage is to commit the changes. git commit -m "<Message>"

Have a look at How do I add files and folders into github repos?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top