Git 102 - Basic Git commands
    • PDF

    Git 102 - Basic Git commands

    • PDF

    Article Summary

    Git 102: Basic Git commands

    We have a Git cheat sheet with more commands.

    Copy entire remote repo to current directory
    git clone [url]
    
    Fetch and merge any commits from the tracking remote branch
    git pull
    
    Transfer your local branch commits to the remote branch repo
    git push [alias] [branch]
    
    Switch to another branch and check it out to your current working directory
    git switch
    
    Show modified files in your working directory. These files are staged for your next commit
    git status
    
    Add a file as-is to your next commit, aka stage the file
    git add [file/directory]
    
    Commit your staged files as a new commit
    git commit -m "[descriptive message]"
    

    Writing a good commit message

    - Short (Under 60 characters)
    - Descriptive (what did you do?)
    - This will be part of the review
    - Use imererative tense
    - Add bypass cap
    - vs "Added bypass cap"

    Git 102: Merge conflicts

    Merge conflicts happen when two different people make changes to files on either the same branch, or different branches. When they go to merge, there will be a merge conflict.

    Avoiding merge conflicts

    The best way to deal with merge conflicts is by prevention.
    - Set up branch protection on main
    - Separate schematics into multiple files
    - Communicate when working on single files like the PCB
    - Use LFS to lock files

    Fixing merge conflicts

    Although we're building a merge engine, for now, the best way to fix a merge conflict is to view the file changes in AllSpice and manually copy the changes to the new file.

    Teams and role-based permissions

    Visit our main article on teams


    Was this article helpful?