GIT: I can’t send my files to Github

Asked

Viewed 919 times

0

I’m not making it send my files to Github. I am following the following steps:

use the

git init
git add .
git commit -m 'primeiro teste'
git config --global user.name nome
git config --global user.email email

git push urlDoGitHub

What is usually happening is a mistake:

warning: could not open directory 'SendTo/': Permission denied
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)

 ../../../../../.bash_history
        ../../../../../.cache/
        ../../../../../.eclipse/
        ../../../../../.gitconfig
        ../../../../../.p2/
        ../../../../../.tooling/
        ../../../../../.vscode/
        ../../../../../3D Objects/
        ../../../../../AppData/
        ../../../../../Contacts/
        ../../../../../Desktop/
        ../../../../
        ../../../../../Downloads/
        ../../../../../Evernote/
        ../../../../../Favorites/
        ../../../../../IntelGraphicsProfiles/
        ../../../../../Links/
        ../../../../../MicrosoftEdgeBackups/
        ../../../../../Music/
        ../../../../../OneDrive/
        ../../../../../Pictures/
        ../../../../../Saved Games/
        ../../../../../Searches/
        ../../../../../Videos/
        ../../../../../eclipse-workspace/
        ../../../../../eclipse/
        ../../../../../ntuser.dat.LOG1
        ../../../../../ntuser.dat.LOG2
        ../../../../../ntuser.ini

nothing added to commit but untracked files present (use "git add" to track)

If I use Git Add. Error:

git add .

fatal: Unable to create '/.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.

I’m super confused and I need help.

NOTE: I’m a beginner in GIT and already deleted the index.lock file and it didn’t work.

3 answers

1

From what I understand you have to add the remote repository. On this site teaches how to do https://git-scm.com/book/pt-br/v2/Fundamentos-de-Git-Working-with-Remotes. Test with the command "git remote -v". If you do not have a configuration it is because the remote repository has not been added. Then you put "git remote add name(Usually Origin) URL". Now you test the "git remote -v", if it appears, it’s all right. Now you can give the "git push name(usually origin) master" to upload the files to github.

Now if the problem is another speech. From a git status to be more accurate and put there.

0

Problem solved!

The problem was that VS Code was not synchronized with the directory that GIT pointed to, I had to go to the VS files tab and open the folder where the project was saved, From then on my git status worked as it should and I was able to clone and upload the files to Github. Thanks for the support!

-1

Can Try this one

git remote add <URL>
git add.
git push <remote name> <branch name>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.