git-branch

EGit - set up remote tracking correctly when creating a branch

狂风中的少年 提交于 2019-12-21 19:56:24
问题 When I create a new branch from a remote branch using EGit I get the wrong remote tracking set up: I create the local branch feature1 from the remote branch refs/heads/master and immediately push to upstream. The followign remote tracking gets configured in my .git/config file: [branch "feature1"] remote = origin merge = refs/heads/master So, pull and push in that branch will pull and pull from/to the remote master branch. I would expect the following tracking configuration instead: [branch

How to find all refs that contain a commit in their history in git

心已入冬 提交于 2019-12-21 12:26:27
问题 Lets assume you have the following structure in git A <-- refs/heads/somebranch | B | \ C D <-- refs/tags/TAG1 | | E F | | \ G H I <-- refs/heads/branch1 | J <-- refs/heads/master Now I want to find all refs that contain commit B in their history. So it would be nice if I could do $ git refs --contains B refs/tags/TAG1 refs/heads/branch1 refs/heads/master I took a look at the git decumentation and found git branch -a --contains <commit_id> which lists all branches that contain a commit_id . $

Git: move files in history too

无人久伴 提交于 2019-12-21 11:24:30
问题 is it possible with Git's tools to move files into a new folder while modifying its full history, as if the files had been there from their first add? I came up on this after merging some repos together: I moved the files from several repos to distinct folders inside one "super" repo, however the merged history behaves very bad with git rebase and git svn tools as totally different files may collide at their old locations of course. 回答1: So now this got the job done: git filter-branch --tree

Removing large file from git history?

左心房为你撑大大i 提交于 2019-12-21 05:31:11
问题 We have a remote git repository where there are no size restrictions for files and we had pushed a 300MB into it. We then realized it and then removed the file from the repository. Meanwhile the same repository was added to github and when we try to push the changes to github, we get the large file size error. remote: error: File dir/filename is 312.27 MB; this exceeds GitHub's file size limit of 100 MB To fix this, I tried using the interactive git rebase solution suggested at How to remove

Removing large file from git history?

被刻印的时光 ゝ 提交于 2019-12-21 05:31:06
问题 We have a remote git repository where there are no size restrictions for files and we had pushed a 300MB into it. We then realized it and then removed the file from the repository. Meanwhile the same repository was added to github and when we try to push the changes to github, we get the large file size error. remote: error: File dir/filename is 312.27 MB; this exceeds GitHub's file size limit of 100 MB To fix this, I tried using the interactive git rebase solution suggested at How to remove

Should I merge master into a feature branch to bring it up to date? Would this be considered bad practice?

帅比萌擦擦* 提交于 2019-12-21 04:40:46
问题 I have a situation like this: (master) A - B - E - F \ C - D (feature-x) Should I merge master into feature-x if I need critical fixes E and F into the feature-x branch to continue development and I intend to merge back into master? Is there any disadvantage to repeated merging master into a feature branch and then the feature back into master when the feature branch might or might not be shared with other developers? 回答1: So far as I understand, merging master into your feature branch isn't

Override author on git merge

此生再无相见时 提交于 2019-12-21 03:19:38
问题 Is there an option like --author of git-commit for git-merge? We maintain a staging environment where some changes must be performed. Some limitations make us to use only one linux user to access staging environment. Anyway, we are a small team with cooperative initiative and we tell when doing commits, which one is the author using the --author git-commit option. However, some times we need to merge from other branches which result in a non-ff merge. This implies a commit is performed when

“src refspec does not match” and “failed to push some refs” errors on git push [duplicate]

丶灬走出姿态 提交于 2019-12-21 03:18:31
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Error when “git push” to github I tried to push my new branch (let's just call it new_branch ) to remote rep. There is no such branch there yet, but git push origin new_branch:new_branch should create it. When I try to do it, this is what I get: error: src refspec new_branch does not match any. error: failed to push some refs to 'ssh://git@***' I dug through million of questions like this on SO, but none of them

Git: move changes off of master branch

我与影子孤独终老i 提交于 2019-12-21 03:10:55
问题 Basic question but this happens to me all the time: Make changes in a working-branch Switch to master git merge working-branch git push cap deploy (to staging) make a new cup of tea then I come back and think of something else and start making some changes...while still on master. What's an easy way to either: prevent direct edits on master (warning perhaps) to move all edits over to working-branch and clear master so I can continue editing on working-branch to spin edits into an entirely new

git branching - how to make current master a branch and then revert master back to previous version?

旧时模样 提交于 2019-12-21 02:41:20
问题 This is probably quite simple but I'm currently a git noob and haven't quite got my head round the git branching model yet. Suppose I currently have no branches other than master , but now I've made some changes since my last commit that I've decided I don't want to keep (note: the changes are not committed yet). I don't want to get rid of these changes just yet though - I'd like to put them in their own branch (called e.g. experimental_stuff ) and then continue development from my previous