Skip to content

chao-ouyang/github-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-playground

place to do hands on training for github

branch model

git cheat sheet

commands
  • git status to check local status
  • git remote update to bring remote status up to date
  • git checkout to switch to branch
  • git checkout -b xxxx to create & checkout new branch based on current working branch.
  • git add . to add all changes to stage
  • git commit -m 'xxxxx' commit staged changes to local repo with comment
  • git push -u origin xxxxx push local commits to remote origin repo
  • git pull --rebase to get the latest code with rebase.
  • git rebase --continue when has pull.rebase conflict, go resolve the conflict by editing the file, then git add . and this
  • git rebase develop to rebase from develop branch to current working branch (feature branch).
  • git log --oneline --graph --color --since=2.weeks print out git history log with graph within 2 weeks
  • git stash save the current none commited changes, so that be able to switch to other branch.
  • git cheery-pick xxxxxx & git cherry-pick --continue -m 'commit message', xxxxxx is 6 digit SHA1 commit hash, if there merge conflict, user the --continue to commit the merge result.
config
  • git config --global core.autocrlf true for windows users
  • git config --global core.autocrlf input for mac users
  • git config --global pull.rebase true alwasy rebase when doing pull
  • git config --global push.default simple make sure branch name matchs.

About

place to do hands on training for github

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 9