it:ad:git:howto:crash_course:home

IT:AD:Git:HowTo:Crash Course

  • See also:
    • IT/AD/bitbucket/HowTo/Retarget A Repository From Git To Https Protocol

Summary

Devs just want to get going.

# If you have nothing local yet, clone:
  # BitBucket/Option A:
  git clone git@bitbucket.org:<yourname>/<yourreponame>.git
  # BitBucket/Option B:

  git remote clone https://<youraccountname>@bitbucket.org/<nameofrepoowner>/<nameofrepo>.git

# CD to your project
cd <projectroot>

# ALTERNATIVE WAY:
# But sometimes you have an existing code folder, and don't want to create a new folder.
# In which case, create the local repo (ie, the `.git` folder): 
git init

# Connect the local to remote repo:
    #Bitbucket, Option A: SSH:
    git remote add origin https://<youraccountname>@bitbucket.org/<nameofrepoowner>/<nameofrepo>.git
    
    #Bitbucket, Option B: HTTPS (although you'll have to retarget afterwards):
    git remote add origin git@bitbucket.org:<yourname>/<yourreponame>.git
# Can't push up the cloud repo till there have been some changes. So make a file:
echo NULL > readme.md`

# Still can't push up to the cloud until you've Committed the changes:
git add contributors.txt
git add .

# Commit: 
git commit -m "Initial commit with contributors"


# Push:
git push -u origin master

  • /home/skysigal/public_html/data/pages/it/ad/git/howto/crash_course/home.txt
  • Last modified: 2023/11/04 02:22
  • by 127.0.0.1