Git - Anton-L-GitHub/Learning GitHub Wiki
Init folder
git init
Clone remote repo
git clone <url>
OBS! .gitignore
| git status
??
git add .
or git add <file>
git reset .
or git reset <file>
git commit -m "This is the commit message"
OBS!
git status
ALWAYS before pushing
git pull origin master
git push origin master
origin
= name of remote repo
master
= the branch that we push to
(First time push of branch)
git push -u origin <name-of-branch>
-u
coordinates the two branches (local and on server)
git branch <name-of-branch>
git checkout <name-of-branch>
git checkout master
git pull origin master
git branch --merged - see which branches are merged
git merge <name of the branch you want to merge>
git push origin master
Deletes repo locally!
git branch -d <name of the branch>
Deletes repo on remote!
git push origin --delete <name of the branch>
Check the other repo branches
git branch -a -