Comments (15)
Can you enter the node_modules/gulp-git/lib
and edit commit.js
with the following?
Right directly under line 12:
var cmd = "git commit -m " + escape([message, file.path]) + " " + opt.args;
Add this:
console.log(cmd);
And post the results from the gulp log here?
It may be the UNIX vs win characters escaped in shell-escape
from gulp-git.
Was just doing that :-)
The result is
git commit -m 'initial commit' C:\Users\lotus\projects\gulpjscs\gulpfile.js
Copy/pasting that in the cli gives me the same message but it works if I use double quotes around the message
git commit -m "initial commit" C:\Users\lotus\projects\gulpjscs\gulpfile.js
from gulp-git.
Ah yes!
I now remember that the time (only time ;) ) I was using git on windows I Needed to use the double quotes.
I will need to manually add that in instead of using shell-escape
, I hope to get it done shortly.
Thanks for noticing it.
from gulp-git.
Thanks. And thanks for your work already building this.
from gulp-git.
Can you check to see if my latest publish fixed it?
from gulp-git.
Updates?
from gulp-git.
So sorry I got off doing other things and didn't realize you had replied back. Yes I will definitely check it in the morning.
from gulp-git.
Not working for me. Something with the file.cwd now. I added a console.log( cmd, file.cwd); at line 13 in commit.js . Here is what I get.
λ gulp commit
[gulp] Using file C:\Users\lotus\projects\gulpgittest\gulpfile.js
[gulp] Working directory changed to C:\Users\lotus\projects\gulpgittest
[gulp] Running 'commit'...
[gulp] Finished 'commit' in 4.7 ms
git commit -m "initial commit" $'C:\\Users\\lotus\\projects\\repo\\anothertest.txt' C:\Users\lotus\projects\gulpgittest
git commit -m "initial commit" $'C:\\Users\\lotus\\projects\\repo\\testfile.txt' C:\Users\lotus\projects\gulpgittest
[gulp] { [Error: Command failed: fatal: Not a git repository (or any of the parent directories): .git
] killed: false, code: 128, signal: null }
[gulp] fatal: Not a git repository (or any of the parent directories): .git
[gulp] { [Error: Command failed: fatal: Not a git repository (or any of the parent directories): .git
] killed: false, code: 128, signal: null }
[gulp] fatal: Not a git repository (or any of the parent directories): .git
Here's the task
gulp.task('commit', function() {
gulp.src('../repo/*')
.pipe(git.commit('initial commit', {}));
});
from gulp-git.
Did you run git init
in the other dir, or this one?
Windows may only allow in path git. Such as the git folder in local ./
from gulp-git.
I made a directory 'repo' next to 'gulpgittest'
Then in repo
git init
touch testfile.txt
git add .
git commit -m "manually running git commands'
git repo is initialized and testfile.txt added and commited correctly
Then
touch anothertestfile.txt
git add .
git status //shows file added and ready for commit
cd ../gulpgittest
gulp commit
Am I misunderstanding? I'm thinking file.cwd should be
C:\Users\lotus\projects\repo
But instead it is the same directory the gulpfile is running from (same as cwd)
C:\Users\lotus\projects\gulpgittest
from gulp-git.
If I initialize a git repo inside gulpgittest it tells me the file is outside the repo so it is trying to run git commit in the local ./
I may be misunderstanding the purpose of this plugin. Is it intended to be inside the actual repo? I was thinking I could use it to run git commands on another directory. That way I could copy files from this directory to a separate repo and then run the git commands on that repo without leaving this directory. That way it can be used as part of a deploy process where the actual repo is outside the project.
from gulp-git.
I will look into the issue, it is designed to allow any folder and look for git from that files cwd, not just the local.
Unless I need to monkey patch it for windows...
from gulp-git.
Ok, I'll keep messing around with it and let you know if I figure out anything. Thanks
from gulp-git.
Can you confirm that #7 works for you?
from gulp-git.
Can you check now?
from gulp-git.
Related Issues (20)
- Get current branch name? HOT 2
- git add is broken in Node 8 HOT 1
- git.add does not allow for specified files to add in another cwd HOT 4
- gulp-git breaks in Node 9.5.0. HOT 3
- Error creating commit on new git version HOT 20
- Error: i can't commit HOT 2
- How to use git clone with ssh HOT 2
- How to clone with a specified branch? HOT 5
- commit() will commit also unstaged files HOT 2
- Git add . all files HOT 2
- Cannot use '-a' anymore for commit HOT 4
- how can I checkout a file HOT 1
- stdout maxBuffer length exceeded (diff.js) HOT 1
- Problem with absolute path or Gulp v4
- Cherry-pick - feature request HOT 1
- finish event listener registration error
- Gulp 4 compatibility HOT 1
- Add rebase command HOT 2
- "The command line is too long." on `git.add()` HOT 1
- lodash.template critical vulnerabilities from Mend HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-git.