hi ,
i have two branches , the master and develop and we need to exclude some files from merging but i still want to commit it but i do not want to merge it with master because it is include information related to development and not for production , i can not used ignore because i want to make change on it but all i need is exclude the files when merging or when pull request , is there any way to achieve that ?
Thanks
Community moderators have prevented the ability to post new answers.
When you do the merge, you can choose to NOT auto-commit the merge. This will stage the merge results, and you can go through the staged changes and discard the changes to the files in question.
You'll have to do this manually every time, because as Mike said, Git isn't designed to treat files individually.
A different option is to ignore those files, and store copies in a separate repo. My workplace has a "code" repo and a "documentation" repo, because most documentation was not branch-dependent, and we had to deal with unnecessary merge conflicts or out-of-date docs because changes had been commit to one branch but not merged to others.
No, that's not possible with any source control systems wich work on the whole work tree (instead of commit by file). Git is one of those.
You can look at merge strategies for certain file types, if it always the same files.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Look for the manual about .gitattributes files.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.