git-push

fatal: unable to create 'refs/heads/master.lock': File exists fatal: - Getting this error while pushing the commits

ぐ巨炮叔叔 提交于 2019-12-19 05:08:57
问题 I am getting the following error while pushing the commit $ git push origin master fatal: unable to create 'refs/heads/master.lock': File exists fatal: The remote end hung up unexpectedly I thought of removing the lock file ( refs/heads/master.lock ) from my local machine. But this file is not available. I think this file is in git server. What is the origin of this issue? If I remove this file from the server, will it solve the issue if the file exists? 回答1: You need to remove existing .lock

Check who pushed a Git commit

人盡茶涼 提交于 2019-12-18 19:08:12
问题 short : Is there any way to view who has pushed a commit to a git repository? long : git log shows me who created the commits, when and what are the commit comments. So I can know an original author of a commit. If such commit was pushed to a feature branch by the original author, I'd like to check who merged this commit to the production branch. 回答1: No, you would need an extra layer added to Git in order to record that kind of operation. git log only display the committer and author, as

How do I push files specified in .gitignore?

眉间皱痕 提交于 2019-12-18 16:58:46
问题 If I have a "vendors" directory in my .gitignore, is there a way I can set up a remote that will receive that directory anyway when I do a push? 回答1: I think the functionality you're looking for can be achieved by having a branch used to deploy to your Cloud Provider. Setup a dev branch which includes your .gitignore file, check your incremental work into that branch. Merge your dev branch into your deploy branch which doesn't contain a .gitignore file but contains the vendors directory. once

How can I prevent non-fastforward pushes to selected branch(es) in git?

ぃ、小莉子 提交于 2019-12-18 16:53:44
问题 I would like to protect my git repository so only non master branches can be overwritten. Is there a way to protect only selected branches? 回答1: You can use GitEnterprise to setup per-branch permissions (admin) to block non-fastforward pushes using fine-grained access permission. And git config --system receive.denyNonFastForwards true will simply do the job if you need to block history changing for all branches. 回答2: Here's an update hook (copy to hooks/update) that I wrote for my own use.

git push to remote branch

拟墨画扇 提交于 2019-12-18 09:56:10
问题 Folks, I had cloned a repo. I created a branch out of it to work on a feature by issuing the following command: git branch fix78 then I worked on that branch by git checkout fix78 I continued to make commits to this local branch. Now I wanted to push this to the repo and hence I issued the following command: git push origin master:fix78 I viewed the repo from a web browser and saw that a new branch called fix78 was created on the repo. But it did not have any of my commits that I had made.

git force push current working directory

谁说胖子不能爱 提交于 2019-12-18 01:15:08
问题 I need to git push to remote, and that push need to be current working copy. Because, pushed source is a web host. So, pushed files need to be currently in use. I am sure no one will edit files at the host :) This question is follow up of these 2 questions, Is it possible to have a git repo inside another git repo and what difference does --bare switch make when initing a git repo? Edit: bare repo is not what I want, since files need to be directly used on remote machine, and need to be found

Using git to publish to a website

喜夏-厌秋 提交于 2019-12-17 22:52:57
问题 I used this guide to use git to autopublish my changes on my website when I push to my remote origin git repository: http://www.lwp.ca/james/2010/03/using-git-to-manage-online-website-projects/ Here's my /hooks/post-update file: cd ../../public_html/dir/wbg env -i git pull Here's my directory structure: /home/git/wbg.git <-- my remote git repository /home/public_html/dir/wbg <-- my web folder When I run git push origin master The repository updates but my web folder is still empty. Any ideas?

When I “git push” git now says “Create pull request for …”. Why?

↘锁芯ラ 提交于 2019-12-17 22:19:37
问题 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 <<my branch>>: remote: https://bitbucket.org/... I have no idea why Git is giving me this message, which I have never seen before. Even if I delete the remote branch (with " git push origin :<<my branch>> " I now still get this message! (I successfully deleted the

Pushing a local branch up to GitHub

泪湿孤枕 提交于 2019-12-17 21:38:55
问题 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 I would like to do now is push my changes on this branch to GitHub. Do I just do a git push? When I first set it up I did run: git config push.default current 回答1: I believe you're looking for git push origin my_new_branch , assuming your origin

git push --force-with-lease vs. --force

荒凉一梦 提交于 2019-12-17 17:33:38
问题 I am trying to understand the difference between git push -f 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 local branch doesn't have ? If there is a better way to phrase the question, lmk, but hopefully it's clear. 回答1: force overwrites a remote branch with your local branch. --force-with-lease is a safer option that will not overwrite any work on the remote branch if more commits were added to the remote