git-push

How can I push a local Git branch to a remote with a different name easily?

天大地大妈咪最大 提交于 2019-12-17 17:18:36
问题 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 checkout -b newb $ ... $ git commit -m "Some change" $ git push origin newb:remote_branch_name Now if someone updates remote_branch_name, I can: $ git pull And everything is merged / fast-forwarded. However, if I make changes in my local "newb", I can't: $ git push Instead, I have to: % git push

How do you push a Git tag to a branch using a refspec?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 17:17:45
问题 I want to force push, for example, my tag 1.0.0 to my remote master branch. I'm now doing the following: git push production +1.0.0:master I want to force the push , because all I care about is that the code inside the 1.0.0 tag is pushed to the master branch on the remote repository. What am I doing wrong? Update #1 When I SSH into my server where my Git repository is and execute git branch -l , I don't see the master branch listed either. Update #2 After running git tag -l from inside the

Github remote push pack size exceeded

不想你离开。 提交于 2019-12-17 16:04:31
问题 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 setup the project up on Repo B. I have setup the remotes, ssh keys etc. and I run into an issue when pushing the codebase to Repo B. I get the following error all the time: $ git push <remote_repo_name> master Enter passphrase for key '/c/ssh/.ssh/id

What are the consequences of using receive.denyCurrentBranch in Git?

三世轮回 提交于 2019-12-17 08:23:29
问题 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 work and then checkout the master branch. I then merge my local changes into the master branch. When I try to push to the server I get the following exception: Welcome to Git (version 1.7.11-preview20120620) Run 'git help git' to display the help index. Run 'git help <command>' to display help for

Fix GitLab error: “you are not allowed to push code to protected branches on this project”?

谁说我不能喝 提交于 2019-12-17 08:02:26
问题 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 message: error: You are not allowed to push code to protected branches on this project. ... error: failed to push some refs to ... 回答1: there's no problem - everything works as expected. In GitLab some branches can be protected. By default only Maintainer/Owner users can commit to protected branches

Git push error: Unable to unlink old (Permission denied)

僤鯓⒐⒋嵵緔 提交于 2019-12-17 07:00:34
问题 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 my local machine to the git repository in the server, I get the following error messages: remote: error: unable to unlink old '<file>' (Permission denied) This appears many times over, one error message for almost every file. However I have a README.txt file that I'm able to change using git, here are

Push to GitHub error: Couldn't find host github.com in the .netrc file; using defaults

Deadly 提交于 2019-12-17 06:49:06
问题 Dunno what's going on, no response from github on this prob so I'm asking here. 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: localhost:send2mobile_rails phil$ git push Password: * Couldn't find host github.com in the .netrc file; using defaults * About to connect() to github.com port 443 (#0) * Trying 207.97.227.239... * Connected to github.com (207.97.227.239) port 443 (#0) * SSL connection using DHE-RSA

Git - What is the difference between push.default “matching” and “simple”

你离开我真会死。 提交于 2019-12-17 06:22:08
问题 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 push" to work. If I simply use git push it asks me to see up a default branch(?) to point to? What is the difference between these two options it supplies me with? git config --global push.default matching git config --global push.default simple Matching just pushes whatever branches I have on my

Git push only for bare repositories?

為{幸葍}努か 提交于 2019-12-17 05:04:25
问题 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 external disk I have checkouted project and I want to send changes that I did on my computer to these reposiotry. Is 'git push origin master' not the right way? Do I have to 'git pull ...' on repository on my external disk? So I cannot push changes but just pull them? Only working with 'bare'

Bare and non-bare repo at the server

拜拜、爱过 提交于 2019-12-13 17:42:49
问题 I want to track directories and files stored at the server. The initial idea was to set up a bare repository at the server and then push/pull from local machines (where non-bare repos are stored). The problem is that updated files must be present at the server. Initially I focused on setting up a non-bare repo on the server and pulling from the bare repo but it would require someone to git pull every time a push is made from a local machine. My question is: is it possible to set up bare and