add-and-commit | :octocat: Automatically commit changes made in your workflow run directly to your repo | Continous Integration library
kandi X-RAY | add-and-commit Summary
kandi X-RAY | add-and-commit Summary
You can use this GitHub Action to commit changes made in your workflow run directly to your repo: for example, you use it to lint your code, update documentation, commit updated builds, etc...
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of add-and-commit
add-and-commit Key Features
add-and-commit Examples and Code Snippets
Community Discussions
Trending Discussions on add-and-commit
QUESTION
git
and a workflow where I have many loose changes that are not intended for check-in. Is there a good git
way to manage those not-for-check-in modified files?
In my project, we have about 700,000 source files. I'd call it a larger project.
When I am working on fixing a bug or implementing a feature, I will quite frequently end up with many files that I have made ancillary edits. Such as debugging instrumentation, or alternative implementation, or an expensive check for a never-happen situation that once appears to have happened in the wild and I want to catch it if it ever happens on my machine, or clang-format
because the original had goofy formatting.
To commit my good changes, I'll branch, I carefully add the relevant files and commit those. (Followed by a push of my changes. Make a PR. Get code review approval. Jenkins builds on all the dozen different target platforms, and runs the test suite. Then I merge my branch into main.)
Probably a fairly typical workflow... except for that I have many (1000+) not-for-check-in files that I want to keep modified in my worktree, but not merge those into main. That latter part is probably atypical.
With Perforce, I would add my not-for-check-in files into a not-for-check-in changelist and park them there. They'd be out of the way, and I could not accidentally pull one of those "tainted" files without taking steps to move it out of the not-for-check-in changelist.
So far, my git
tactic of being super-duper careful has worked, but seems fraught with peril. I maintain a stash.txt
file that has a list of my not-for-check-in files, and frequently stash
them to temporarily get them out of the way, do my git
things (making branches, fetch, merge, push, whatever), and stash pop
them back in my worktree. Seems janky, manual, and error prone; high cognitive load. Has to be a better way.
(I have not run into the scenario when I have a single file that has both good changes and not-for-check-in changes. If/when I do, I am aware of how to add-and-commit hunks of changes.)
I have tried the tactic of making a branch, add-and-commit both my good changes and not-for-check-in changes. Then cherry pick the good changes for what should go into main. That scales poorly with the 1000s of not-for-check-in files that need to be sifted through.
Any advice or guidance is appreciated.
...ANSWER
Answered 2021-Nov-11 at 15:36Using git worktree
, I would work with two separate working tree (from the same cloned repository: no need to clone twice)
- one for the work in progress, with many files not to be added
- one for reporting the work which needs to be added: no stash to maintain in this one.
Does Git support multiple concurrent index (or staging), which would be the analog to Perforce changelist?
Not really: it would be easier to make multiple commits:
- one your PR
- one for the rest
And push only the first commit (for PR).
From the discussion:
"How can I make Git "forget" about a file that was tracked, but is now in .gitignore?" uses
git update-index --skip-worktree
, which I don't find very practical, or easier thangit stash
.git rebase -i
follwoed bygit push :
should be enough
QUESTION
Goal:
In GitHub Actions, to define my commit message dynamically from shell:
...ANSWER
Answered 2021-Jul-14 at 18:22If you want to reference an environment variable set using the $GITHUB_ENV
environment file in the arguments to another task, you'll need to use workflow syntax to access the appropriate key of the top level env
key, like this:
QUESTION
I am getting this:
...ANSWER
Answered 2021-Jan-28 at 20:44If you take a look at the documentation for the actions/checkout@v2 action, you'll see it performs a shallow clone with a single revision by default:
QUESTION
The current state of the function is like:
...ANSWER
Answered 2020-Oct-26 at 13:41You don't need to use echo so:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install add-and-commit
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page