Add files and commit to GIT from Powershell

The following Powershell function will add all files not yet added, then do a commit with the message provided in the call to the function, then do the push. The prerequisite is that the “GIT” command line is installed and available. I was earlier looking for an API, but I think this is the apparently the best way of accomplishing the commit.


{!{code}!}czozMTE6XCIjCiMgVGVzdGVkIDAxLzI1LzIwMTkgLSBieSBhZGRpbmcgYSB0ZXN0IGZpbGUgYW5kIHJ1bm5pbmcgdGhpcyBzY3JpcHR7WyYqJl19IAojCgpmdW5jdGlvbiBHaXRBZGRDb21taXRQdXNoRGlyICgkZGlyZWN0b3J5LCAkY29tbWl0TWVzc2FnZSkgCnsKICAgIGNkICRkaXtbJiomXX1ybmFtZSAKICAgIGdpdCBhZGQgLgogICAgZ2l0IGNvbW1pdCAtbSAkY29tbWl0TWVzc2FnZQogICAgZ2l0IHB1c2gKfQoKJGRpck5he1smKiZdfW1lID0gXCJkOlxcR2l0XFxNeUNvZGVEaXJcIgpHaXRBZGRDb21taXRQdXNoRGlyICRkaXJOYW1lIFwiVGVzdCBjb21taXQgYnkgUG93ZXJzaHtbJiomXX1lbGwgU2NyaXB0XCIgCgpcIjt7WyYqJl19{!{/code}!}


Uncategorized  

Leave a Reply