To pull the cloned remote branch by using url [where the repo saved] from other directory
See original GitHub issueI used code to clone like this from the simple-git npm package
var gulp=require('gulp');
const simpleGit=require('simple-git');
const git=simpleGit();
gulp.task('d', async function()
{
await git.clone( repository ,localfoldername,{'--branch': branch name})
shell.cd(localfoldername)
await git.pull()
}
While running the gulp task in a terminal in visual studio code as ‘d:/default> gulp d’
cloning is done with a local folder But pull will not occur Because the gull command worked on ‘d:/default>’ where there will remote repository ‘origin’ was saved It was saved in ‘d:/default/localfolder’ there I need to pull Please suggest to me how to overcome this, I am new to both gulp and git
where there is an option to move to remote branch URL then clone
or other suggestions
git
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
git clone | Atlassian Git Tutorial
Git clone is a Git command line utility used to target and create a copy of the target repository. Learn extended configuration options...
Read more >Git Clone Branch – How to Clone a Specific Branch
With this, you fetch all the branches in the repository, checkout to the one you specified, and the specific branch becomes the configured...
Read more >How do I clone a Git repository into a specific folder?
go to the directory where you want to clone the repo. (don't run git init command inside that directory) · simply run the...
Read more >Easily Perform Git Checkout Remote Branch [Step-by-Step]
As an existing repository exists, you are ready to get started. Follow along below to clone the remote repository to a local folder....
Read more >git-clone Documentation - Git
Clones a repository into a newly created directory, creates remote-tracking branches for each branch in the cloned repository (visible using git branch ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The
git.exec
method (as documented.exec(handlerFn) | calls a simple function in the current step
) is a way to call a function, so you can be sure the function is executed between any other chained methods (though in your example you don’t chain methods as you just use the one git instance and await each time).To call out to a shell command like
npm install
etc, you would need to use something likechild_process.exec
- documentation for this is on the node website at https://nodejs.org/dist/latest-v14.x/docs/api/child_process.html#child_process_child_process_exec_command_options_callbackFor example:
Hi,