For LabVIEW programmers who are complete beginners at Git.
|
Name
|
git config --global user.name “<name>” |
|
Email
|
git config --global user.email “<email>” |
|
1. Create a folder
|
mkdir <mycode> && cd <mycode> |
|
2. Initialize
|
git init -b main |
|
3. Add files to track
|
vi readme.md |
|
4. Track files
|
git add . |
|
5. Initial Commit
|
git commit -am"Initial Commit" |
|
1.
mkdir <myrepo.git> && cd <myrepo.git> |
|
2.
git init --bare |
git clone <url_or_file_path> |
|
I need help.
|
git help |
|
What is going on in my repo?
|
git status |
|
What happened in the past?
|
git log |
|
Can I see a history graph?
|
git log --oneline --graph |
|
What changed?
|
git diff |
|
How to configure things?
|
git config |
|
How to manage branches?
|
git branch |
|
How to manage remotes?
|
git remote |
|
1. Add all changes
|
git add . |
|
2. Make a commit
|
git commit -am"Commit Message" |
|
List changed files
|
git diff --name-only |
|
Open LVCompare
|
git difftool |
|
What changed in a commit?
|
git show <commit> |
|
Which commits changed a file?
|
git log -- <file> |
|
Throw away all
|
git restore . |
|
Throw away one file
|
git restore <file> |
|
Undo
add file |
git restore --staged <file> |
|
Go back to commit
|
git reset --hard <commit> |
|
Reset file to commit
|
git checkout <commit> -- <file> |
|
Undo published commit
|
git revert <commit> |
|
New branch
|
git switch -C <new_branch> |
|
Change branch
|
git switch <other_branch> |
|
Combine changes
|
git merge <other_branch> |
|
Push changes up
|
git push |
|
Pull changes down
|
git pull |
|
Push a new branch
|
git push -u origin <mybranch> |
|
Ignore *.aliases, *.lvlps, *.UserState 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. Beware of merging them. Consider using a .gitattributes file to mark them as binary
|
|
Close your lvproj before switching branches or reverting changes on old versions of LV - pre 2026
|
|
Consider mulitple lvproj to avoid confilcts.
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.