git intro

 git clone https://github.com/miguelgrinberg/flasky.git

#creating branch called "test" and switch to it
git checkout -b test
 
git branch  #to know which branch
* test    <=this is current branch
  master
 
git status
git checkout README.md  #to discard changes

Or you can delete the whole branch:
$ git checkout master   #switch to master
$ git branch -D test


git  add .  #adds all to staging

git commit -a -m "message to forkers or self reference" #commit all
git commit file1 file2  #commit particular files
 
How do you know which commits have not yet been pushed upstream, but are still sitting in branches?  
git status won't tell you, so use this command: 

git log --branches --not --remotes
 
Add existing file to git hub
############################3


git init 

git add . 

git commit -m "Initial commit" 

git remote add origin <project url> 

git push -f origin master







 
 
 

No comments:

Post a Comment