I'm really new to git and Bitbucket. I want to use it for my shell scripts. I have already created a repository from my work laptop to push all my shell scripts to the repository at Bitbucket. Now, I would like to setup my scripts folder on my home computer to sync the scripts, from my laptop and my desktop, into one repository.
How do I connect to the Bitbucket repository from my home computer that I setup from my work laptop using the same account? Is there documentation somewhere on how to do this?
Yeah, I was able to work it out. I created a clone and was able to get everything sorted the way I wanted. I guess the only thing I need to remember to do from this point forward is that every time I change a script that I need to copy it to the cloned repo folder on that specific computer.
Ok. So I must have done something wrong.
Initially, I had a repo on Bitbucket named 'scripts'. I had setup my work laptop as the local repo before setting up a clone. On my work laptop the name of the repo directory is also called 'scripts'. To start over I deleted the repo on Bitbucket and remove the .git directory from with my 'scripts' folder on my laptop. I then created a new, empty repo on Bitbucket named 'scripts_repo'. I then went my laptop and, from within the 'scripts' directory, ran the git clone command. Once that happened it created a new directory within the 'scripts' directory called 'scripts_repo'. Then I just copied my scripts to the 'scripts_repo' directory and pushed it.
So, I did something wrong?
I wouldn't think that, moving forward, you would want to keep a separate "scripts" folder and "scripts_repo" with all the same content.
You should just be able to have your "scripts" folder itself be a repository.
I think the way you had it on your work laptop and Bitbucket originally was fine, from what I can tell. At this point I would copy 'scripts_repo' to the location where you want your scripts folder to be, make absolutely sure that everything from 'scripts' is identical inside 'scripts_repo', and then delete 'scripts' and rename 'scripts_repo' to 'scripts'.
Then I would clone the remote repo onto your home computer. If there are scripts on your home computer that aren't in the repo yet, I'd copy them into the repo and add/commit/push. Then I'd delete the scripts folder on your home computer and move the cloned repo to the same location.
Ultimately you should have a 'scripts' folder on each computer which is a clone of the 'scripts' repo on the server. There's no need to have a repo separate from the folder itself, unless I'm missing something that you're trying to accomplish.
Also, keep in mind that git doesn't care what the name of the folder is that contains your repo. By default it will match the name of the remote repo, but that isn't required. The important thing is the .git folder; all of the folders and files starting at its level are considered to be part of the repo.
So, you can clone your repo, then rename the parent folder (currently scripts_repo) to anything you want, and/or move it anywhere you want.
Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot