Difference between revisions of "Git push"

From wikieduonline
Jump to navigation Jump to search
Line 33: Line 33:
 
  git push -u origin master or git push --set-upstream origin master (Used by argument-less <code>[[git pull]]</code>)
 
  git push -u origin master or git push --set-upstream origin master (Used by argument-less <code>[[git pull]]</code>)
  
 +
=== Git push with errors ==
 
  git push -u origin master
 
  git push -u origin master
 
  ssh_exchange_identification: read: Operation timed out
 
  ssh_exchange_identification: read: Operation timed out
Line 39: Line 40:
 
  Please make sure you have the correct access rights
 
  Please make sure you have the correct access rights
 
  and the repository exists.
 
  and the repository exists.
 
 
touch README.md
 
[[git add]] README.md
 
[[git commit]] -m "add README"
 
git push -u origin master
 
  
 
  git push
 
  git push
Line 55: Line 50:
 
   
 
   
 
     git push <name>
 
     git push <name>
 
  
 
  git push
 
  git push
Line 62: Line 56:
 
   
 
   
 
     [[git push --set-upstream origin master]]
 
     [[git push --set-upstream origin master]]
 +
 +
 +
== Example ==
 +
[[touch]] README.md
 +
[[git add]] README.md
 +
[[git commit]] -m "add README"
 +
git push -u origin master
 +
  
 
== Related terms ==
 
== Related terms ==

Revision as of 12:37, 17 September 2021

git push update remote refs along with associated objects

git push
Everything up-to-date
git push -u origin main
git push -u origin master
git push origin master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 245 bytes | 245.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To ssh://gitlab.yourdomain.com:2224/project/project_test.git
* [new branch]      master -> master


git push -u origin master
 
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 212 bytes | 212.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To ssh://gitlab.yourdomain.com:2224/project/project_test.git
* [new branch]      master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.



git push -u origin master or git push --set-upstream origin master (Used by argument-less git pull)

= Git push with errors

git push -u origin master
ssh_exchange_identification: read: Operation timed out
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights
and the repository exists.
git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url> 

and then push using the remote name 

    git push <name>
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


Example

touch README.md
git add README.md
git commit -m "add README"
git push -u origin master


Related terms


error: src refspec master does not match any

See also

Advertising: