Questions tagged [git-push]
Pushes the changes from a local Git repo to remote
239
questions
18650
votes
41answers
9.4m views
How do I delete a Git branch locally and remotely?
I want to delete a branch both locally and remotely.
Failed Attempts to Delete a Remote Branch
$ git branch -d remotes/origin/bugfix
error: branch 'remotes/origin/bugfix' not found.
$ git branch -d ...
1991
votes
24answers
1.0m views
Is there a way to cache https credentials for pushing commits?
I recently switched to synchronizing my repositories to https:// on GitHub (due to firewall issues), and it asks for a password every time.
Is there a way to cache the credentials, instead of ...
996
votes
31answers
543k views
Git push error '[remote rejected] master -> master (branch is currently checked out)'
Yesterday, I posted a question on how to clone a Git repository from one of my machines to another, How can I 'git clone' from another machine?.
I am now able to successfully clone a Git repository ...
1674
votes
27answers
1.6m views
Git push requires username and password
I cloned a Git repository from my GitHub account to my PC.
I want to work with both my PC and laptop, but with one GitHub account.
When I try to push to or pull from GitHub using my PC, it requires ...
4988
votes
16answers
4.3m views
How do I push a new local branch to a remote Git repository and track it too?
I want to be able to do the following:
Create a local branch based on some other (remote or local) branch (via git branch or git checkout -b)
Push the local branch
to the remote repository (publish),...
1445
votes
12answers
683k views
Default behavior of "git push" without a branch specified
I use the following command to push to my remote branch:
git push origin sandbox
If I say
git push origin
does that push changes in my other branches too, or does it only update my current branch? ...
919
votes
6answers
913k views
Force "git push" to overwrite remote files
I want to push my local files, and have them on a remote repo, without having to deal with merge conflicts. I just want my local version to have priority over the remote one.
How can I do this with ...
2700
votes
11answers
1.4m views
How do you push a tag to a remote repository using Git?
I have cloned a remote Git repository to my laptop, then I wanted to add a tag so I ran
git tag mytag master
When I run git tag on my laptop the tag mytag is shown. I then want to push this to the ...
699
votes
14answers
862k views
Undoing a 'git push'
Here's what I did on my supposed-to-be-stable branch...
% git rebase master
First, rewinding head to replay your work on top of it...
Fast-forwarded alpha-0.3.0 to master.
% git status
# On branch ...
1518
votes
9answers
1.6m views
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 ...
158
votes
5answers
59k views
How to push to a non-bare Git repository?
I usually work on a remote server via ssh (screen and vim), where I have a Git repository. Sometimes I'm not online, so I have a separate repository (cloned from my remote) on my laptop.
However, I ...
90
votes
8answers
54k views
How can I automatically push after committing in git?
How do I set Git to automatically push to a remote
repository (including automatically providing my passphrase) after each commit to the local repository?
219
votes
12answers
209k views
Git Push error: refusing to update checked out branch
I have solved some merge conflicts, committed then tried to Push my changes and received the following error:
c:\Program Files (x86)\Git\bin\git.exe push --recurse-submodules=check "origin" master:...
108
votes
9answers
83k views
How can I recover from an erronous git push -f origin master?
I just committed the wrong source to my project using --force option.
Is it possible to revert? I understand that all previous branches have been overwritten using -f option, so I may have screwed up ...
1646
votes
5answers
254k views
Warning: push.default is unset; its implicit value is changing in Git 2.0
I've been using Git for a while now and have recently downloaded an update only to find this warning message come up when I try to push.
warning: push.default is unset; its implicit value is changing ...
955
votes
16answers
770k views
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?
368
votes
19answers
164k views
Can't push to GitHub because of large file which I already deleted
Currently I have
Empty GitHub repo
SSH server repo (main)
Local Repo
SSH server repo was the most up-to-date repo (production site) so I did a Git clone from there to local. I then tried to do a git ...
408
votes
5answers
140k views
git push --force-with-lease vs. --force
I am trying to understand the difference between
git push --force
and
git push --force-with-lease
My guess is that the latter only pushes to the remote if the remote does not have commits that the ...
544
votes
58answers
743k views
Git Push ERROR: Repository not found
I am having a very strange problem with git and github. When I try and push, I am getting:
git push -u origin master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
I added ...
132
votes
10answers
45k views
Cannot push to Heroku because key fingerprint
I am new to Rails, and I was trying to deploy a very simple app to Heroku. This is the second app that I deploy, and the first one I was able to do it just fine. However I am having some issues with ...
149
votes
14answers
204k views
Issue pushing new code in Github
I created a new repository on Github which has only Readme.md file now.
I have a newly created RoR project which I wanted to push to this repository.
Following are the commands I gave in my Terminal ...
133
votes
20answers
331k views
! [rejected] master -> master (fetch first)
Is there a good way to explain how to resolve "! [rejected] master -> master (fetch first)'" in Git?
When I use this command $ git push origin master it display an error message.
! [rejected] ...
611
votes
20answers
614k views
Remote origin already exists on 'git push' to a new repository
I have my project on GitHub at some location, git@github.com:myname/oldrep.git.
Now I want to push all my code to a new repository at some other location, git@github.com:newname/newrep.git.
I used ...
104
votes
8answers
60k views
Is there a way in git to obtain a push date for a given commit?
I am wondering if there is a way to view a push date associated with each commit in the git log. If that is not possible, is there a way to see all the commits under a certain push.
I writing a ...
19
votes
2answers
10k views
Git push only for bare repositories?
When I tried 'git push origin master' to remote repository on my external disk, git warning occured stating that pusing to checkout repository will in next releases of git refused by default. On ...
69
votes
2answers
22k views
When I do "git push", what do the statistics mean? (Total, delta, etc.)
Here is an example:
$ git push -u myserver master
Counting objects: 22, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (14/14), 1.89 KiB ...
56
votes
3answers
41k views
Github remote push pack size exceeded
I am new to Git and have a fairly large project that I want to push to a remote repo (Repo B) on Github. The original project was on Github as well but from a different repo (Repo A). I have to make ...
380
votes
20answers
331k views
How do I avoid the specification of the username and password at every git push?
I git push my work to a remote Git repository.
Every push will prompt me to input username and password. I would like to avoid it for every push, but how to configure to avoid it?
447
votes
5answers
409k views
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.
438
votes
10answers
425k views
Fix GitLab error: "you are not allowed to push code to protected branches on this project"?
I have a problem when I push my codes to git while I have developer access in my project, but everything is okay when I have master access. Where is the problem come from? And how to fix it?
Error ...
116
votes
5answers
193k views
Pushing from local repository to GitHub hosted remote
I created a local repository of my Visual Studio 2010 solution folder using Git GUI on my dev machine. I then created a remote repository in my GitHub account. Now, I am looking for how to push my ...
317
votes
3answers
124k views
Git - What is the difference between push.default "matching" and "simple"
I have been using git for a while now, but I have never had to set up a new remote repo myself and I have been curious on doing so. I have been reading tutorials and I am confused on how to get "git ...
241
votes
15answers
230k views
Git push error: Unable to unlink old (Permission denied)
In the remote server I have a post-receive hook set up in order to make a git checkout of my repository:
#!/bin/sh
GIT_WORK_TREE=/var/www/<website> git checkout -f
But when I make a push from ...
94
votes
30answers
141k views
Git push hangs when pushing to Github?
Git push hangs everytime I try to push to github. I am using Cygwin and Windows 7. Git functions fine locally tracking branches, providing status, setting global user.name and user.email and allowing ...
100
votes
7answers
109k views
Making a Git push from a detached head
I am on a detached head and made some changes. I want to push up these changed to this detached head with Git. I do not want my changes to go onto the develop branch and certainly not on the master ...
64
votes
3answers
31k views
How to push a local Git repository to another computer?
I have a local Git repository setup on my laptop. I would like to push it to my desktop.
How can I do that?
17
votes
4answers
31k views
Push to GitHub error: Couldn't find host github.com in the .netrc file; using defaults
I don't know, what is going on, I got no response from github. I tried a git push for the first time in a month or so and got this. Turned on export GIT_CURL_VERBOSE=1 and did a push and get this:
...
263
votes
7answers
157k views
How can I undo a `git commit` locally and on a remote after `git push`
I have performed git commit followed by a git push. How can I revert that change on both local and remote repositories?
$ git log
commit 364705c23011b0fc6a7ca2d80c86cef4a7c4db7ac8
Author: Michael ...
209
votes
6answers
100k views
How can I push a local Git branch to a remote with a different name easily?
I've been wondering if there's an easy way to push and pull a local branch with a remote branch with a different name without always specifying both names.
For example:
$ git clone myrepo.git
$ git ...
52
votes
6answers
68k views
What are the consequences of using receive.denyCurrentBranch in Git?
I have a Git repository. I have cloned the repository and can commit my local changes. When I push my changes to the server it works.
As soon as I create a branch, I checkout the branch, commit my ...
57
votes
3answers
83k views
What is the difference between git push origin and git push origin master
Is there any difference in pushing the master branch of a local git repository to the master branch of a remote repository called origin with git push origin master
or with git push origin?
439
votes
11answers
151k views
Heroku: 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 ...
145
votes
6answers
48k views
Git push branch from one remote to another?
I have the following remotes set up:
$ git remote
korg
rorg
And the following branches:
$ git branch -a
* (no branch)
remotes/korg/gingerbread
remotes/korg/gingerbread-release
remotes/korg/...
8
votes
7answers
34k views
Git push "error: index-pack died of signal 9"
I've seen a couple of similar questions to this, but haven't been able to solve my problem so am asking again.
I added a load of new files to an existing git-enabled project and am trying to push ...
17
votes
2answers
13k views
Find committer of a force push on github
In our project (which is hosted on GitHub), someone accidentally force-pushes master every once in a while. No one is aware if doing so, and I would like to find out who does it and what sort of ...
233
votes
13answers
189k views
How can I find the location of origin/master in git, and how do I change it?
I'm a Git newbie. I recently moved a Rails project from Subversion to Git. I followed the tutorial here: http://www.simplisticcomplexity.com/2008/03/05/cleanly-migrate-your-subversion-repository-to-...
266
votes
6answers
304k views
How do you push just a single Git branch (and no other branches)?
I am working on a local git repository. There are two branches, master and feature_x.
I want to push feature_x to the remote repo, but I do not want to push the changes on the master branch.
Will a ...
200
votes
4answers
116k views
Git: which is the default configured remote for branch?
I have a remote bare repository hub. I work only in the master branch.
The last sentence of this error message below makes me wonder: How do I find out which is the "default configured remote for your ...
277
votes
13answers
165k views
Changing the Git remote 'push to' default
I want to change the Git default remote branch destination so I could just
git push
Instead of:
git push upstream
Currently this is set to the origin remote and I want to set it to a different ...
80
votes
12answers
56k views
git push heroku master says "Everything up-to-date", but the app is not current
I have an app on Heroku that is running old code. I've made a small change and committed the change. I then ran
git push heroku master
It'll say
Fetching repository, done.
Everything up-to-date
...