Questions tagged [push]

In distributed version control, push is the action of sending local changes to a remote repository.

5455 questions
1778
votes
12 answers

How do I properly force a Git push?

I've set up a remote non-bare "main" repo and cloned it to my computer. I made some local changes, updated my local repository, and pushed the changes back to my remote repo. Things were fine up to that point. Now, I had to change something in the…
Spyros
  • 46,820
  • 25
  • 86
  • 129
1515
votes
20 answers

Changing git commit message after push (given that no one pulled from remote)

I have made a git commit and subsequent push. I would like to change the commit message. If I understand correctly, this is not advisable because someone might have pulled from the remote repository before I make such changes. What if I know that no…
K_U
  • 15,832
  • 8
  • 26
  • 29
1056
votes
7 answers

How can I push a specific commit to a remote, and not previous commits?

I have made several commits on different files, but so far I would like to push to my remote repository only a specific commit. Is that possible?
Robert23
  • 10,561
  • 3
  • 16
  • 3
1001
votes
15 answers

What are the differences between "git commit" and "git push"?

In a Git tutorial I'm going through, git commit is used to store the changes you've made. What is git push used for then?
ben
  • 29,229
  • 42
  • 124
  • 179
770
votes
32 answers

Git Push Error: insufficient permission for adding an object to repository database

When I try to push to a shared git remote, I get the following error: insufficient permission for adding an object to repository database Then I read about a fix here: Fix This worked for the next push, since all of the files were of the correct…
skaz
  • 21,962
  • 20
  • 69
  • 98
757
votes
14 answers

Set up git to pull and push all branches

I'd like to push and pull all the branches by default, including the newly created ones. Is there a setting that I can define for it? Otherwise, when I add a new branch, locally and I want to pull it from the server, what is the simplest way to do…
lprsd
  • 84,407
  • 47
  • 135
  • 168
543
votes
6 answers

When doing a 'git push', what does '--set-upstream' do?

What does git --set-upstream do? I tried to understand it by reading the git manual, but I didn't quite get it.
474
votes
12 answers

How to push different local Git branches to Heroku/master

Heroku has a policy of ignoring all branches but 'master'. While I'm sure Heroku's designers have excellent reasons for this policy (I'm guessing for storage and performance optimization), the consequence to me as a developer is that whatever local…
Lawrence I. Siden
  • 9,191
  • 10
  • 43
  • 56
386
votes
29 answers

Array.push() if does not exist?

How can I push into an array if neither values exist? Here is my array: [ { name: "tom", text: "tasty" }, { name: "tom", text: "tasty" }, { name: "tom", text: "tasty" }, { name: "tom", text: "tasty" }, { name: "tom", text:…
tarnfeld
  • 25,992
  • 41
  • 111
  • 146
313
votes
25 answers

rejected master -> master (non-fast-forward)

I'm trying to push my project (all files in a new repository). I follow the steps but when I push with git push -u origin master I get this error: ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to…
Asantoya17
  • 4,465
  • 6
  • 23
  • 29
271
votes
20 answers

Push Notifications in Android Platform

I am looking to write an app that receives pushed alerts from a server. I found a couple of methods to do this. SMS - Intercept the incoming SMS and initiate a pull from the server Poll the server periodically Each has its own limitations. SMS-…
Vinod
  • 3,209
  • 4
  • 20
  • 18
223
votes
2 answers

Opposite of push();

What is the opposite of the JavaScript push(); method? Say I had an array: var exampleArray = ['remove']; I want to push(); the word 'keep' - exampleArray.push('keep'); How do I delete the string 'remove' from the array?
Alex Safayan
  • 2,921
  • 4
  • 17
  • 22
221
votes
5 answers

Why does Git tell me "No such remote 'origin'" when I try to push to origin?

I am very new to Git; I only recently created a GitHub account. I've just tried to push my very first repository (a sample project), but I'm getting the following error: No such remote 'origin' I ran the following commands: git init git commit -m…
Vijay
  • 3,152
  • 3
  • 24
  • 33
211
votes
19 answers

Determine on iPhone if user has enabled push notifications

I'm looking for a way to determine if the user has, via settings, enabled or disabled their push notifications for my application.
Kevin
  • 3,690
  • 5
  • 35
  • 38
210
votes
43 answers

error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) I tried 'push' while writing 'git'. However, the following message does not solve the problem.
Sungsoo Kwon
  • 2,101
  • 2
  • 6
  • 3
1
2 3
99 100