git

Why the conflict markers don't disappear with a git mergetool using Beyond compare 3?

杀马特。学长 韩版系。学妹 提交于 2021-02-08 04:42:13
问题 I changed the merge tool to Beyond Compare. I merge a file a.txt in ' test ' branch with file a.txt in master branch. I want to update my a.txt in master branch with changes in a.txt in ' test ' branch. When I input ' $git mergetool ', it shows the merge tool with the left is LOCAL and the right is REMOTE . When I merge changes in REMOTE to LOCAL , then I save and close BC3, I choose 'y' with the question ' Was the merge sucessful? '. Everything seems well. However, when I check the a.txt in

How to update(pull) a branch before a pull/merge request?

你说的曾经没有我的故事 提交于 2021-02-08 04:38:22
问题 For instance, let's suppose I have a branch called develop , and all my features will be a branch created from develop that later I will need to do a merge request (in GitLab, what in GitHub would be a pull request). If I need to update my new branch before push it into origin and do a merge/pull request, does " git pull origin develop " would update my new branch too? If not, how can I do this? 回答1: The proper command would by: git fetch git switch myNewBranch git rebase origin/develop git

How to properly handle a file only used locally in git?

允我心安 提交于 2021-02-08 04:07:33
问题 I want to reorder the output of changed files in git commits so I've created a file called submodule/orderfile and configured diff.orderFile to point to that file. Now many problems arise If I add the file to .gitignore , the .gitignore will be listed as modified If I add the path submodule/orderfile to .git/info/exclude the file still appears when I run git status . Either way, orderfile or .gitignore will be listed in git status. If I commit it to a branch it'll be removed when I switch to

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

Git merges removing files

只谈情不闲聊 提交于 2021-02-08 03:12:34
问题 It's the second time this happens, when I'm doing a merge I later realized some files that were in the branch being merged are no longer in the branch being merged to. The latest example is we have a feature branch which I've been merging the changes in from the main dev branch, we lost a lot of files after a merge and they are not present in the feature branch now. Why does this happen? What's the best way to get these files? I'm thinking of manually adding them. here is a description of the

Git merges removing files

ぐ巨炮叔叔 提交于 2021-02-08 03:11:28
问题 It's the second time this happens, when I'm doing a merge I later realized some files that were in the branch being merged are no longer in the branch being merged to. The latest example is we have a feature branch which I've been merging the changes in from the main dev branch, we lost a lot of files after a merge and they are not present in the feature branch now. Why does this happen? What's the best way to get these files? I'm thinking of manually adding them. here is a description of the

Git merges removing files

点点圈 提交于 2021-02-08 03:10:57
问题 It's the second time this happens, when I'm doing a merge I later realized some files that were in the branch being merged are no longer in the branch being merged to. The latest example is we have a feature branch which I've been merging the changes in from the main dev branch, we lost a lot of files after a merge and they are not present in the feature branch now. Why does this happen? What's the best way to get these files? I'm thinking of manually adding them. here is a description of the

Git merges removing files

扶醉桌前 提交于 2021-02-08 03:08:14
问题 It's the second time this happens, when I'm doing a merge I later realized some files that were in the branch being merged are no longer in the branch being merged to. The latest example is we have a feature branch which I've been merging the changes in from the main dev branch, we lost a lot of files after a merge and they are not present in the feature branch now. Why does this happen? What's the best way to get these files? I'm thinking of manually adding them. here is a description of the

List Git commits between a and b, considering only first parents of b AND only first parents of a

心已入冬 提交于 2021-02-08 03:01:34
问题 With Git you can list all ancestors of b , excluding all ancestors of a : git log a..b You can also list all first-parent ancestors of b , excluding all ancestors of a : git log --first-parent a..b But I want to list all first-parent ancestors of b , excluding all first-parent ancestors of a . I haven't found any way to get the first-parent requirement to also apply to the negative part(s) of a revision range. Is there a way to do this? If there's no way to do this using only Git commands, is

面试官给我挖坑:rm删除文件之后,空间就被释放了吗?

混江龙づ霸主 提交于 2021-02-07 22:44:20
在Linux,你是不是曾经天真的以为,使用rm删除一个文件,占用的空间就释放了?事情可能不是常常如人意。 产生一个指定大小的随机内容文件 我们先看一下当前各个挂载目录的空间大小: $ df -h /dev/sda11 454M 280M 147M 66% /boot 我这里挑选了其中一个结果展示(你可以选择任一挂载目录),接下来准备在 /boot 下生成一个文件。 首先我们产生一个50M大小的文件: $ dd if=/dev/urandom of=/boot/test.txt bs=50M count=1 至此,我们产生了一个50M大小的文件,再看boot下: $ df -h /dev/sda11 454M 312M 115M 74% /boot 这里你不用关心到底多了多少,你只需要关注,/boot下的文件增多了。 测试程序: #include<stdio.h> #include<unistd.h> int main(void) { FILE *fp = NULL; fp = fopen("/boot/test.txt", "rw+"); if(NULL == fp) { perror("open file failed"); return -1; } while(1) { //do nothing sleep(1); } fclose(fp); return 0; }