Mark file as someone else's contribution #23367
-
Hello, I have some files in a repository (small images stored through LFS) that I want to delete and replace with something more tightly compressed to go easier on the bandwidth. It’s far from a problem *right now* (usage is way below 10% per month) but I’d rather not let it -become- a problem later on. Now, the issue is some of these files are not originally made by me and I’d rather keep them as the original author’s contribution rather than my own. So, how do we go about that? I can of course just reach out to the original author and ask them to upload the modified version but that would take longer. Is there a way to simply mark a file as ‘made by X’? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
A commit is assigned to an author based on the commit metadata, therefore you could create a commit for another user by changing the metadata. However, it’s generally bad practice to create commits on behalf of someone else. Fortunately, GitHub supports the concept of “co-authors” which are displayed alongside the actual commit author – therefore, you can commit the changes yourself and identify that the content came from another user. If you’re using the GitHub website to create commits then you can add the co-author trailer to your commit extended description, e.g:
A full outline of how to achieve this (on GitHub Desktop, via the command line and via github.com) is available in the documentation, Creating a commit with multiple authors:
|
Beta Was this translation helpful? Give feedback.
A commit is assigned to an author based on the commit metadata, therefore you could create a commit for another user by changing the metadata. However, it’s generally bad practice to create commits on behalf of someone else. Fortunately, GitHub supports the concept of “co-authors” which are displayed alongside the actual commit author – therefore, you can commit the changes yourself and identify that the content came from another user.
If you’re using the GitHub website to create commits then you can add the co-author trailer to your commit extended description, e.g:
A full outline of how to achieve this (on GitHub Desktop, via the command line a…