Link to home
Start Free TrialLog in
Avatar of DrTribos
DrTribosFlag for Australia

asked on

Automate Upload with Git using Bit Bucket / Source Tree

What I have is a VBA project which, over the years, has evolved.  Representing the project at various points in time I have 100's of folders each containing text files; the folders are named as dates representing the project at a specific point in time and the text files contain the source code for each module.

What I'd like to do is automate the upload each set of code into bitbucket sequentially; starting from the start.  I'm able to stage the files, I'm just not sure how (or indeed the best way) to get them committed.  I'm guessing a script of some sort would make short work of this.  

Any help much appreciated.  Also, if possible I would like to have the opportunity to specify:
- a commit date (i.e. backdate, although understand if this is not possible for whatever reason), and
- comments

TIA,
SOLUTION
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DrTribos

ASKER

Thank you for your reply. Yes, unfortunately I do need all the history to prove ownership and settle a dispute.

The relevant files are actual snapshots of code extracted from macro enabled documents. The code for each document is in a folder with chronological timestamps. All such folders are in a master folder.  Everything is in one place and preconditioned...

A few file names have (unfortunately) changed along the way because some module names changed.

I did something similar for a small subset of the snapshots - basically deleted everything except .git and copy the new snapshot files to the staging(?) folder then committed. That seemed to work - and would certainly meet my needs.

Using VBA i can copy files to the staging folder.
It'd be great if you could provide an example bash showing:
- How to commit

Many thanks 😃
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The question went unanswered - simple as it is, a sample script that included: git add & git commit would have received an A grade.

git commit -a -m     ' add and commit, would have been perfect