Configure Git for the first time
To configure Git for the first time please use below commands and replace with your original git path:
Note: If you are working in corporate environment then your user name will be corporate user and email id
git config –global user.name “Java, Honk”
git config –global user.email “Java.Honk@javahonk.com”
- Working with your repository
If you want to simply clone empty repository then run this below example command in your terminal and replace this value with your origional path of the git
git clone https://javahonk@onestash.javahonk.com/scm/vendor.git
- If you already have code ready to be pushed to this repository then run this in your terminal:
cd existing-project
git init
git add –all
git commit -m “Initial Commit”
git remote add origin https://javahonk@onestash.javahonk.com/scm/vendor.git
git push -u origin master
- If your code is already tracked by Git then set this repository as your “origin” to push to:
cd existing-project
git remote set-url origin https://javahonk@onestash.javahonk.com/scm/vendor.git
git push -u origin master