Git
Generate SSH key on Github
create a repo:
new local repo
-git init (project name)
download existing repo
- git clone <url>
view your repo:
list new or modified files not committed yet:
-git status
working with branches:
list all localb branches
- git branch
list local and remote branches
- git branch -av
switch to a branch, also updates working history
- git checkout <branch name>
delete a branch
- git branch-d <branch name>
merge branchA into branchB
- git checkout branchB
-git merge branchA
make changes:
ready to commit
- git add <filename>
stage all changes, ready for commit
git add .
commit all staged with message (version history)
git commit -m <"message">
reset all to last commit
git reset --hard
synchronize:
latest changes from origin
- git fetch
fetch latest changes from origin and merge
- git pull
push all local changes to origin
-git push