1

I want to to create Batch command file for GitHub. by using that batch file can add new project file and commit, checkout. also it have to delete files to create branch, create clone like this kind of facility

i am using following commands for GitHub but this commands have to run separately i need to combine all commands in one single batch file

# clone your own project
$ git clone dotfiles → git clone git://github.com/YOUR_USER/dotfiles.git

clone another project

$ git clone github/hub → git clone git://github.com/github/hub.git

open the current project's issues page

$ git browse -- issues → open https://github.com/github/hub/issues

open another project's wiki

$ git browse mojombo/jekyll wiki → open https://github.com/mojombo/jekyll/wiki

create a topic branch

$ git checkout -b feature ( making changes ... ) $ git commit -m "done with feature"

i am refering following link https://hub.github.com/ for github commands i unable to create in single batch file for GitHub

2 Answers 2

1

You can create a bash file (even on Windows) called git-xxx (replace xx by a name representing your script overall goal)

Any script called git-xxx (no extension) can be called as git xxx, and will run in a git bash shell (even when called from a Windows CMD).

In that script, you need to make sure:

  • you start with

    #!/bin/bash
    
  • your $PATH includes <path/to/hub/>bin

    export PATH=$PATH:/path/to/hub/bin
    
  • your git is aliased to hub, as mentioned in hub.github.com

    alias git=hub
    

Then you can use for instance git browse in your script.

Sign up to request clarification or add additional context in comments.

Comments

0

you can create .cmd batch file and call explicitly your git commands like

call git clone <repo_name>
call git checkout <branch_name>
call git push <origin_name>
etc.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.