Programming

치명적 : 현재 지점 마스터에 업스트림 지점이 없습니다.

procodes 2020. 5. 21. 21:07
반응형

치명적 : 현재 지점 마스터에 업스트림 지점이 없습니다.


내 프로젝트 중 하나를 github에 푸시하려고 하는데이 오류가 계속 발생합니다.

peeplesoft@jane3:~/846156 (master) $ git push

fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

     git push --set-upstream origin master

그래서 나는 그것을 시도하고 이것을 얻었다.

peeplesoft@jane3:~/846156 (master) $ git push --set-upstream origin master

fatal: Authentication failed

또 다른 stackoverflow 스레드는 실망스러운 결과로 다음을 시도해 보라고 제안했습니다.

peeplesoft@jane3:~/846156 (master) $ git push -u origin master

fatal: Authentication failed

그런 다음 이것을 시도했습니다.

peeplesoft@jane3:~/846156 (master) $ git config remote.origin.push HEAD

peeplesoft@jane3:~/846156 (master) $ git push

fatal: Authentication failed

힌트가 있습니까?


푸시를 수정했지만 해당 푸시 문제 ( " 새 분기를 명시 적으로 푸시해야하는 이유 ": git push -u origin master또는 git push -u origin --all)에서 설명한대로 이제 인증 문제를 해결해야합니다.

귀하의 URL에 따라 다릅니다 ( ' git@github.com/yourRepo에서와 같은 SSH 또는에서와 같은 https https://github.com/You/YourRepo)

https URL의 경우 :

계정이 이중 인증으로 보호되는 경우 여기 또는 여기에 설명 된대로 https 비밀번호의 경우 일반 비밀번호가 작동하지 않습니다 .

비밀번호에 특수 문자가 포함되어 있으면 동일한 문제입니다 ( 이 답변 에서와 같이 )

https가 작동하지 않으면 (보조 키, PAT : 개인 액세스 토큰을 생성하지 않기 때문에) 여기에 표시된 것처럼 ssh로 전환 할 수 있습니다 .


또한 다음 명령을 사용할 수 있습니다.

git push -u origin master

그러면 원격 저장소에 다른 분기가 (-u) 생성됩니다. ssh를 사용한 인증이 완료되면


--all처음 푸시 할 때 매개 변수 를 잊어 버린 경우에도이 오류 메시지가 나타납니다 . 나는 썼다

git push -u origin

이 오류가 발생했을 것입니다.

git push -u origin --all

이런 복사-붙여 넣기 오류를 어떻게 좋아합니까?


먼저 리모콘을 구성한 다음 푸시해야합니다.

git remote add origin url-to-your-repo

실제 지침


이 시나리오를 시도하십시오

git push -f --set-upstream origin master

나는 커밋을 잊어 버리는 간단한 오류를 만들었습니다.

git commit -m "first commit"

그런 다음 git push origin master일했다.


아주 간단한 측면에서 일단 다른 지점이 있으면 지점을 밀기 위해 사용할 수 없습니다

git push

그러나 푸시하려는 지점을 체크 아웃하더라도 분기를 지금 지정해야합니다.

git push origin <feature_branch>

심지어 master지점이 될 수있는 곳


나는 같은 문제가 있었다

enter image description here

아래 명령을 사용하여 해결했습니다.

$ git branch --set-upstream develop origin/develop

.git 폴더의 구성 파일에 구성을 추가합니다.

enter image description here


글쎄, 업로드하는 동안 똑같은 문제가 발생했으며 동일한 작업을 수행하여 문제를 해결했습니다. 이전에는 https와 같이 Linux에서 터미널을 내 저장소로 푸시하려고했습니다.

git push https://github.com/SiddharthChoudhary/ClientServerCloudComputing.git

그러나 결과가 나오지 않아서 더 깊이 들어가서 시도했습니다.

git push --set-upstream https://github.com/SiddharthChoudhary/ClientServerCloudComputing.git master

그리고 효과가있었습니다. 따라서 사용자 이름과 비밀번호를 묻는 메시지가 나타납니다. 나는 또한 토큰생성했으며 암호 대신 토큰을 붙여 넣어 성공적으로 완료했습니다.

  1. To generate a token go to your Github account and in Developer Settings and then create another token.
  2. After getting that, copy that token and paste in the password prompt when it's been asked.

First use git pull origin your_branch_name Then use git push origin your_branch_name


There is a simple solution to this which worked for me on macOS Sierra. I did these two commands:

git pull --rebase git_url(Ex: https://github.com/username/reponame.git)
git push origin master

If it shows any fatal error regarding upstream after any future push then simply run :

git push --set-upstream origin master

Defines the action git push should take if no refspec is given on the command line, no refspec is configured in the remote, and no refspec is implied by any of the options given on the command line.

Just do it:

git config --global push.default current

then

git push

1. A computer and your github associated. Use SSH. Computer code so you do not need to submit verified enter image description here

2. git can not manage empty folder. So you have to write such a readme.md saved in a file. Otherwise you will not find the file.

3. Your local project is nothing new projects move over. Please

git init

git remote add origin +"githublink"

git add .

git commit -m "" go again.

4. then git pull origin master (the key)

5. At last git push origin master (solve all problem).

http://my.oschina.net/psuyun/blog/123005 参考链接


If you are trying to push your code direct to the master branch then use command

git push origin master

It helps me.


I also got the same error.I think it was because I clone it and try to push back. $ git push -u origin master This is the right command.Try that

Counting objects: 8, done. Delta compression using up to 2 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (8/8), 691 bytes | 46.00 KiB/s, done. Total 8 (delta 1), reused 0 (delta 0) remote: Resolving deltas: 100% (1/1), done.

  • [new branch] master -> master Branch master set up to track remote branch master from origin.

    It was successful. Try to create new u branch 
    

I had the same problem, the cause was that I forgot to specify the branch

git push myorigin feature/23082018_my-feature_eb

For me, I was pushing the changes to a private repo to which I didn't had the write access. Make sure you have the valid access rights while performing push or pull operations.

You can directly verify via


For me, it was because I had deleted the hidden .git folder.

I fixed it by deleting the folder, re-cloning, and re-making the changes.


To resolve this issue, while checking out the code from git itself, u need to give the command like below:

git checkout -b branchname origin/branchname

Here, by default we are setting the upstream branch, so you will not be facing the mentioned issue.


For me the problem come from the name of my branch : "#name-of-my-branch", without "#" it's work fine!

참고URL : https://stackoverflow.com/questions/23401652/fatal-the-current-branch-master-has-no-upstream-branch

반응형