Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.78 KB

Git.md

File metadata and controls

48 lines (36 loc) · 1.78 KB

Basic git command

  • Clone a directory
    • git clone https://github.com/quentinjamet/CDFTOOLS
    • By default, git uses the name origin for a remote, so if you do git clone <url> it will by default call that remote origin
    • Use git remote -v to see what origin points to
  • Make a branch for local development
    • git checkout branchREF
    • git branch branchDEV
    • git checkout branchDEV (to go to the branch)
    • to make the upstream copy on origin: git push --set-upstream origin branchDEV
  • Update local repo with origin
    • git pull: update local repo OR
    • after a get fetch (see below), complet with git merge
  • **Commit and push local devs to origin
    • git status: display local changes as compared to origin
    • git add your_file: will add your_file to the commit
    • git commit -m 'a comment': commit change
    • git push: push local commit to origin
  • Save (or hide) local changes without commiting them. Very useful to change between branches with ongoing devs
    • git stash
    • [git stash pop to 'reactivate']
    • git stash list
    • git stash show