I have some repository, like https://nickname@bitbucket.org/nickname/repo-name.git. I need to push some data to this repo, using Java.
So, basically I want to do these steps:
- Create temporary directory (tmp_path == /temp/tmp/dir)
- cd tmp_path
- git init
- git remote add origin https://nickname@bitbucket.org/nickname/repo-name.git
- create temp file with needed data (filanme == tmpfile.txt)
- git add filename
- git commit --message="adding tmp file"
- git push origin tmp-branch
But there is one problem. I cannot make "cd" from Java. So I need another solution.
Is there any way to push some data to repository without local git folder?