Cheatography
https://cheatography.com
For LabVIEW programmers who are complete beginners at Git.
First Time Setup
Name |
git config --global user.name “<name>”
|
Email |
git config --global user.email “<email>”
|
Setup your first repository
1. Create a folder |
mkdir <mycode> && cd <mycode>
|
2. Initialize |
|
3. Add files to track |
|
4. Track files |
|
5. Initial Commit |
git commit -am"Initial Commit"
|
Create a Bare Repository (to use as a remote)
1. mkdir <myrepo.git> && cd <myrepo.git>
|
|
Clone An Existing Repository
git clone <url_or_file_path>
|
Getting Around
I need help. |
|
What is going on in my repo? |
|
What happened in the past? |
|
Can I see a history graph? |
git log --oneline --graph
|
What changed? |
|
How to configure things? |
|
How to manage branches? |
|
How to manage remotes? |
|
|
|
Creating a Commit
1. Add all changes |
|
2. Make a commit |
git commit -am"Commit Message"
|
Seeing What Changed
List changed files |
|
Open LVCompare |
|
What changed in a commit? |
|
Which commits changed a file? |
|
Undoing Changes
Throw away all |
|
Throw away one file |
|
|
git restore --staged <file>
|
Go back to commit |
git reset --hard <commit>
|
Reset file to commit |
git checkout <commit> -- <file>
|
Undo published commit |
|
Branches
New branch |
git switch -C <new_branch>
|
Change branch |
git switch <other_branch>
|
Combine changes |
git merge <other_branch>
|
Syncing With Remotes
Push changes up |
|
Pull changes down |
|
Push a new branch |
git push -u origin <mybranch>
|
LabVIEW Specific Tips
Ignore *.aliases and *.lvlps files using .gitignore |
Separate Compiled Code. |
Merge conflicts are painful. Avoid changing the same file in parallel. |
*.lvclass, *.lvlib and *.lvproj can contain binary data. |
Close your lvproj before switching branches or reverting changes. |
Consider mulitple lvproj to avoid confilcts. |
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets