Closed ryanj closed 3 years ago
Hi!
I'm a begginer.. I'm still having git pulling troubles with a new project, even after the explantion. Can you help me?
This bellow what I tried:
rapha@Nitro5 MINGW64 /c/ws-eclipse/2023/test $ git init Initialized empty Git repository in C:/ws-eclipse/2023/test/.git/
rapha@Nitro5 MINGW64 /c/ws-eclipse/2023/test (main) $ git remote add origin https://github.com/RaphaelSena/exceptions2-java.git
rapha@Nitro5 MINGW64 /c/ws-eclipse/2023/test (main) $ git pull origin master fatal: couldn't find remote ref master
rapha@Nitro5 MINGW64 /c/ws-eclipse/2023/test (main) $ git pull origin remote: Enumerating objects: 3, done. remote: Counting objects: 100% (3/3), done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), 784 bytes | 49.00 KiB/s, done. From https://github.com/RaphaelSena/exceptions2-java
rapha@Nitro5 MINGW64 /c/ws-eclipse/2023/test (main) $ git checkout -b main Switched to a new branch 'main'
rapha@Nitro5 MINGW64 /c/ws-eclipse/2023/test (main) $ git branch main -u origin/main fatal: No commit on branch 'main' yet.
rapha@Nitro5 MINGW64 /c/ws-eclipse/2023/test (main) $ git pull There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> main
rapha@Nitro5 MINGW64 /c/ws-eclipse/2023/test (main) $ git branch main -u origin fatal: No commit on branch 'main' yet.
rapha@Nitro5 MINGW64 /c/ws-eclipse/2023/test (main) $ git branch main -u main fatal: No commit on branch 'main' yet.
rapha@Nitro5 MINGW64 /c/ws-eclipse/2023/test (main) $ git remote set-head origin main
rapha@Nitro5 MINGW64 /c/ws-eclipse/2023/test (main) $ git branch --set-upstream-to=origin/main main fatal: No commit on branch 'main' yet.
rapha@Nitro5 MINGW64 /c/ws-eclipse/2023/test (main) $ git branch --set-upstream-to=origin fatal: No commit on branch 'main' yet.
rapha@Nitro5 MINGW64 /c/ws-eclipse/2023/test (main) $ git branch -d master error: branch 'master' not found.
rapha@Nitro5 MINGW64 /c/ws-eclipse/2023/test (main) $ git branch -d -r origin master error: remote-tracking branch 'origin' not found. error: remote-tracking branch 'master' not found.
rapha@Nitro5 MINGW64 /c/ws-eclipse/2023/test (main) $ git remote -v origin https://github.com/RaphaelSena/exceptions2-java.git (fetch) origin https://github.com/RaphaelSena/exceptions2-java.git (push)
git remote add origin 'url_of_your_github_project'
git push -u origin master
specify which branch to push then mention check branch git branch (for local)
git remote add origin 'url_of_your_github_project'
git push -u origin master
specify which branch to push then mention check branch git branch (for local)
Thankyou for the help. this helped me to resolve the issue.
Having trouble pulling updates from
master
? (fatal: coudn't find remote ref master
)Try the following to fix your remote/upstream references:
Then, open your repo's branch settings on GitHub and change the default branch to
main
at:This should get you back to the usual workflow... Do this before adding new changes:
git pull
before cutting your next feature branchCongrats on completing this cleanup work!