Git: Difference between revisions

From Dave-Wiki
Jump to navigation Jump to search
(Created page with "===Check status of the current repo=== git status ===Pull in latest changes from contributors=== git pull ===After you make changes to files in your git repo=== git add . git commit -m "what did you change?" git push -u origin master ===Diff between local head and your uncommitted changes=== git diff <filename> ===Discard uncommited changes=== git checkout -- filename ===Add New BitBucket Remote to Existing Local Repo=== If you already have an existing...")
 
No edit summary
Line 1: Line 1:
===Add New BitBucket Remote to Existing Local Repo===
If you already have an existing local repo but would like to get it on BitBucket, you may need to do this after creating the BitBucket repo:
  git remote add origin git@bitbucket.org:djl09h/repo_name.git
  git push -f origin master
===Check status of the current repo===
===Check status of the current repo===
   git status
   git status
Line 15: Line 21:
===Discard uncommited changes===
===Discard uncommited changes===
   git checkout -- filename
   git checkout -- filename
===Add New BitBucket Remote to Existing Local Repo===
If you already have an existing local repo but would like to get it on BitBucket, you may need to do this after creating the BitBucket repo:
  git remote add origin git@bitbucket.org:djl09h/repo_name.git
  git push -f origin master

Revision as of 02:07, 13 February 2024

Add New BitBucket Remote to Existing Local Repo

If you already have an existing local repo but would like to get it on BitBucket, you may need to do this after creating the BitBucket repo:

 git remote add origin git@bitbucket.org:djl09h/repo_name.git
 git push -f origin master

Check status of the current repo

 git status

Pull in latest changes from contributors

 git pull

After you make changes to files in your git repo

 git add .
 git commit -m "what did you change?"
 git push -u origin master

Diff between local head and your uncommitted changes

 git diff <filename>

Discard uncommited changes

 git checkout -- filename