03-13-2019 11:04 AM
Hey all thanks for coming last night.
I copied a internal wiki article that I have been slowing building up on using git with LabVIEW. It is rough but has some good stuff in it.
Any info that people have please share.
See you all soon.
Gitting going
Assuming Windows here just because most of us in the HW group use Windows. But most of this should apply on Mac/Linux as well.
Open GIT Bash (or GIT CMD, probably). In Windows 8.1 and newer, press Windows key and type in "GIT Bash").
Create an SSH Key, following the example below.
Note the location of the keys; if you used the default key location (blank) and default passphrase (blank) as above, these will live in "/c/Users/Fresh/.ssh/id_rsa". You'll need to open the .pub public key in this folder later.
Add the key to the ssh-agent using eval and ssh-add as shown below.
Note the location of the keys; if you used the default key location (blank) and default passphrase (blank) as above, these will live in "/c/Users/Fresh/.ssh/id_rsa". You'll need to open the .pub public key in this folder later.
Add the key to the ssh-agent using eval and ssh-add as shown below.
Add the public key to Bitbucket settings. If you followed the example above, this will live in "/c/Users/Fresh/.ssh/id_rsa.pub". Open that file in Notepad and copy all of the contents. Open Bitbucket in web browser. Go to your account Settings and SSH Keys (bottom left icon >> Settings >> SSH keys). Click Add key. Label your key whatever and paste the public key you copied above in the *'d box and click "Add key" in the dialog box.
Confirm you've done things right using ssh -T <username>@bitbucket.org as shown.
Now finally clone a private Fresh Consulting repo! Be sure to set the directory to your desired home for your clone. Example shown below, cloning this wiki.
There are two major schools of how people use git. Centralized workflow and branching workflow. For a more detailed explanation see this article.
Centralized is more like using SVN
git pull origin master
(replace master with [branch name] if using branchgit add -A
adds all changed files in repo git add .
adds all changed files in the directory that your in git add /folder/file.file
adds a given file
git commit
Brings up vim for you to enter your commit message if you don't know vim this will just make you angry. Using vim is easy if you know how to do it; hit i to insert text, hit escape to bring up the 'menu', type :qw to write the commit notes to git. git commit -m "notes notes notes"
easier way to write commit notesat this point the changes are staged locally, you can do multiple commits locally before having to push to the central repo.
git push
rectifies the central repo with your local repo (more on pull requests later)WIP #TODO