Questions tagged [git-push]

Pushes the changes from a local Git repo to remote

git push is used to push the data and branch changes from your local Git repository to remote.

Popular questions

See also

References

$ git push --help
1705 questions
126
votes
10 answers

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 my previous revisions.
David van Dugteren
  • 3,879
  • 9
  • 33
  • 48
119
votes
4 answers

Pushing a local branch up to GitHub

I have Git configured so that when I run git push, it pushes changes to my GitHub repo. Until now I have only had a master branch. However, I have now created a local branch and committed to it using: git checkout -b my_new_branch git commit What…
Noam
  • 1,191
  • 2
  • 8
  • 4
119
votes
5 answers

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 local repository to the remote repository. In SVN I…
quakkels
  • 11,676
  • 24
  • 92
  • 149
114
votes
9 answers

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 program that needs to keep track of the commits as…
justkikuchi
  • 1,241
  • 2
  • 9
  • 3
101
votes
8 answers

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?
ulu
  • 5,872
  • 4
  • 42
  • 51
94
votes
2 answers

What is the difference between git push.default=current and push.default=upstream?

The man page for git-config lists these options for push.default: nothing - do not push anything. matching - push all matching branches. All branches having the same name in both ends are considered to be matching. This is the default. upstream -…
iconoclast
  • 21,213
  • 15
  • 102
  • 138
89
votes
15 answers

How can I remove all files in my git repo and update/push from my local git repo?

Is it possible to remove all files in a repository and update it with only the files I have in my local machine? The reason is that, there are certain files that is not necessary in my github and so I want to remove those files. Instead of removing…
dchhetri
  • 6,926
  • 4
  • 43
  • 56
87
votes
4 answers

Git says local branch is behind remote branch, but it's not

Scenario: I make a new branch hack on it commit it push it hack on it some more commit again try to push again Git responds: Updates were rejected because the tip of your current branch is behind its remote counterpart. etc. I'm the only one…
Tim Janke
  • 883
  • 1
  • 7
  • 9
86
votes
14 answers

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 But if I go and look at the app, it's all old code.…
Darkmatter5
  • 1,189
  • 3
  • 12
  • 19
84
votes
27 answers

error: src refspec master does not match any

I have tried to follow the solutions suggested in this post but it didnt work and I am still getting: src refspec master does not match any. Here is what I did: Followed this solution // adding the file I created $ git add . $ git commit -m…
special0ne
  • 6,063
  • 17
  • 67
  • 107
79
votes
4 answers

How to convert a readonly git clone from github to a forked one

From time to time I encounter this issue. Let's say that I did following to read the source code of rails because I am running into some issues. git clone git://github.com/rails/rails.git During the research I tested something and now I have a fix…
Nick Vanderbilt
  • 2,475
  • 3
  • 27
  • 33
79
votes
2 answers

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 | 0 bytes/s, done. Total 14 (delta 10), reused 0…
SerMetAla
  • 4,332
  • 5
  • 31
  • 25
79
votes
4 answers

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 some changes to files from Repo A before I can…
seekinganswers
  • 791
  • 1
  • 5
  • 3
71
votes
10 answers

git@github.com: Permission denied (publickey)

I created a new remote repository and tried to use git push -u origin master command to push my local files into the new repository the first time after I add it and commit it. However, it pops up this git@github.com: Permission denied (publickey).…
Jessie
  • 1,155
  • 3
  • 16
  • 27
69
votes
3 answers

When I "git push" git now says "Create pull request for ...". Why?

I am making changes to a project in a branch that, so far, is known to no one else but me. However, starting recently, when I git push to this project, I now receive this as part of the response: remote: Create pull request for <
Mike Robinson
  • 8,490
  • 5
  • 28
  • 41