git-branch

Find person who deleted a branch?

痞子三分冷 提交于 2021-02-19 05:28:18
问题 I need to find the person who deleted a branch in a project am working with By checking the repo folder/files in .git/refs/heads/ , I can not find any metadata with that information. What is the work around to find this/ him? 回答1: Git alone would not provide any audit log for who pushed what. You would need an authorization layer like gitolite in order to log those operations. Note that if you have access to the remote repo (to which a branch deletion was pushed), you can find trace of the

Find person who deleted a branch?

瘦欲@ 提交于 2021-02-19 05:27:23
问题 I need to find the person who deleted a branch in a project am working with By checking the repo folder/files in .git/refs/heads/ , I can not find any metadata with that information. What is the work around to find this/ him? 回答1: Git alone would not provide any audit log for who pushed what. You would need an authorization layer like gitolite in order to log those operations. Note that if you have access to the remote repo (to which a branch deletion was pushed), you can find trace of the

Put current changes in a new Git branch [duplicate]

落花浮王杯 提交于 2021-02-17 07:27:26
问题 This question already has answers here : Move existing, uncommitted work to a new branch in Git (9 answers) Closed 7 years ago . I've been editing some modules on the master branch but I haven't committed them. I'm now thinking that these changes should really be on an experimental branch and not the master branch. How can I get these edits into an experimental branch? Copy them to some temp location, create the branch, and then copy them back in? And how do I configure things so that when I

Git: local branchs tracks other local branch

戏子无情 提交于 2021-02-08 06:08:56
问题 I know that local branches can track remote branches, but there is also the possibility that a local branch tracks another local branch. What is a use-case for this? 回答1: Real-world use: I have an upstream repository, and a local branch tracking that remote. I start working on a major "feature" which will require a mess of changes to implement, but I don't yet want to expose the work upstream (potentially, ever). So I create a local branch tracking my tracking branch. Now I have origin/master

Git: local branchs tracks other local branch

喜夏-厌秋 提交于 2021-02-08 06:07:57
问题 I know that local branches can track remote branches, but there is also the possibility that a local branch tracks another local branch. What is a use-case for this? 回答1: Real-world use: I have an upstream repository, and a local branch tracking that remote. I start working on a major "feature" which will require a mess of changes to implement, but I don't yet want to expose the work upstream (potentially, ever). So I create a local branch tracking my tracking branch. Now I have origin/master

How to move a subdirectory from a branch in one git repository to a branch in a different repository, preserving history?

*爱你&永不变心* 提交于 2021-02-08 03:39:27
问题 I've got a directory containing utility libraries that were developed in a branch in one git repository, but it turns out they really belong in a different directory in a different project. I've read through and attempted Greg Bayer's Moving Files from one Git Repository to Another, Preserving History multiple times, but I'm unable to preserve history. I'm attempting to do this all under non-master branches to be more safe as the project is not ready to merge back to master yet anyway. Here's

After a git reset, unreachable commit not removed

╄→尐↘猪︶ㄣ 提交于 2021-02-07 19:17:54
问题 I have a small repo that has a couple of commits: * a0fc4f8 (HEAD -> testbranch) added file.txt * e6e6a8b (master) hello world now * f308f53 Made it echo * f705657 Added hello * 08a2de3 (tag: initial) initial Also: $ git status On branch testbranch nothing to commit, working directory clean I can not understand the following behavior. On this state I run: $ git reset initial I see now: * e6e6a8b (master) hello world now * f308f53 Made it echo * f705657 Added hello * 08a2de3 (HEAD ->

Is it possible to get branch names without clone or pull from git?

蓝咒 提交于 2021-02-07 11:45:08
问题 I want to get all branch names of a git repository. Currently, I clone the repository then get them on local machine. This is inefficient because all I need is names and nothing else. I wonder if it is possible to do that? If so, what command I can use. 回答1: Locally, without cloning, you can type (using git ls-remote): git ls-remote /url/of/the/upstream/repo That will list of the remote HEADS and their associated branches 来源: https://stackoverflow.com/questions/25765237/is-it-possible-to-get

GIT: How to protect the branch from being removed by other developers?

时光怂恿深爱的人放手 提交于 2021-02-07 05:22:14
问题 After the first release of our product, we will be switching to a different branches for the main development and feature development. Is there a way to create a branch in such a way, so that we can protect it from being removed (accidentally or on purpose) unless you're a specific user (based on role or username)? I tried to create a sample git repository in our local gitlab machine, then protected one of the branches from the option on the website, but then I was able to remove it with git

GIT: How to protect the branch from being removed by other developers?

会有一股神秘感。 提交于 2021-02-07 05:21:18
问题 After the first release of our product, we will be switching to a different branches for the main development and feature development. Is there a way to create a branch in such a way, so that we can protect it from being removed (accidentally or on purpose) unless you're a specific user (based on role or username)? I tried to create a sample git repository in our local gitlab machine, then protected one of the branches from the option on the website, but then I was able to remove it with git