Question:
I decided to protect myself and upload the project to git, specifically to bitbucket. Git is installed, but previously only used "pull-push" .
There is a folder with a project that I need to drop, the manual says:
mkdir /path/to/your/project
Do I need to register the name of the folder or the full path to the folder? Or do I need something else?
Can use the instruction "I already have a project"?
If I drop my project, will I accidentally drop it into the account of the office in which I work?
Answer:
- create a new repo in bitbucket (probably already);
- copy its SSH URL – something like
git@bitbucket.org:drtvader/superproject.git
– make sure it's your name after the colon, not your office name; - go to your project folder on your computer;
-
git init
initializes the git project; -
git add .
will add to it all files and folders in the current directory and deeper; -
git commit -m "initial commit"
– will commit them all; -
git remote add origin git@bitbucket.org:drtvader/superproject.git
– insert the URL of your Bitbucket repo copied in step 2; -
git push origin master
togit push origin master
newly created commit to bitbucket.
Everything seems to be. You don't have branches and tags yet. You have already worked with BitBucket from this computer for your organization, so further notes are likely not useful:
A. you may need to answer yes
when you first connect to BitBucket from your computer in step 8 with git push..
– when asked whether to trust such and such a certificate from such and such an IP address.
B. if you have not used git from this computer before, you will need to configure git – set your name in Latin letters and email – they will be indicated as the author of commits from this computer:
git config --global user.name Vassia Poupkin
git config --global user.email poupkin@mail.ru
C. maybe not all files you want to control with git – for example, configs with passwords – create a .gitignore
file .gitignore
and .gitignore
their names there, one per line, so that git doesn't pay attention to them.
D. create a README.md file in the root of the project in Markdown with your project description, title and honorary copyrights – the contents of this file will be shown by BitBucket on your project page.