processes:version-control
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
processes:version-control [2019/10/05 07:40] – ↷ Links adapted because of a move operation ioan.polenciuc | processes:version-control [2020/03/25 08:29] – [Introduction] manuel.sebald | ||
---|---|---|---|
Line 5: | Line 5: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | We use [[http:// | + | We use [[http:// |
+ | |||
- | In order to be able to work on our LabVIEW code you need to follow the steps described | + | **In order to be able to work on our LabVIEW code, you need to follow the steps described |
- | ---- | + | {{indexmenu>:kb:scc:git#1|tsort nsort}} |
- | + | ||
- | ===== How to setup ===== | + | |
- | + | ||
- | ==== 1. Create a GitLab User ==== | + | |
- | + | ||
- | Go to [[https:// | + | |
- | + | ||
- | + | ||
- | ==== 2. Install Git ==== | + | |
- | + | ||
- | Install git on your development machine. | + | |
- | + | ||
- | <WRAP left round tip 98%> | + | |
- | There' | + | |
- | </ | + | |
- | + | ||
- | Git itself is a collection of tools that are operated from the command line (or bash). However, there are GUI clients available for all major operating systems: | + | |
- | + | ||
- | * [[http:// | + | |
- | * [[http:// | + | |
- | + | ||
- | + | ||
- | + | ||
- | ==== 3. Configure git ==== | + | |
- | + | ||
- | //If you're using a GUI client, some of these settings may be done via its settings dialog.// | + | |
- | + | ||
- | Git checks 4 places for a configuration file, cascading settings in the following order: | + | |
- | + | ||
- | * Your machine' | + | |
- | * Your user '' | + | |
- | * A second user-specific configuration file located at '' | + | |
- | * The local repo's config file '' | + | |
- | + | ||
- | If you haven' | + | |
- | + | ||
- | git config --global user.name "Your Name" | + | |
- | git config --global user.email " | + | |
- | + | ||
- | + | ||
- | === Example .gitconfig file === | + | |
- | + | ||
- | [user] | + | |
- | name = Your Name | + | |
- | email = your@email.address | + | |
- | [core] | + | |
- | excludesfile = / | + | |
- | filemode = false | + | |
- | + | ||
- | === Ignoring files === | + | |
- | + | ||
- | The '' | + | |
- | + | ||
- | git config --global core.excludesfile ' | + | |
- | + | ||
- | Each repository and each directory in it can have its own .gitignore file. | + | |
- | + | ||
- | == Common .gitignore example == | + | |
- | + | ||
- | < | + | |
- | # Generic: Temporary Files and Logs | + | |
- | *~ | + | |
- | ._* | + | |
- | .DS_Store | + | |
- | Thumbs.db | + | |
- | ~*.docx | + | |
- | ~*.xlsx | + | |
- | *.log* | + | |
- | </ | + | |
- | + | ||
- | == Project-specific .gitignore example == | + | |
- | + | ||
- | < | + | |
- | # LabVIEW Metadata | + | |
- | *.aliases | + | |
- | *.lvlps | + | |
- | .cache/ | + | |
- | + | ||
- | # LabVIEW Binaries/ | + | |
- | artifacts/ | + | |
- | builds/ | + | |
- | *.lvlibp | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | === Windows Specifics === | + | |
- | + | ||
- | If you're using msysgit on Windows: | + | |
- | + | ||
- | * the machine' | + | |
- | * your user '' | + | |
- | + | ||
- | Use '' | + | |
- | + | ||
- | == Global .gitignore file == | + | |
- | + | ||
- | Set the global .gitignore file location to '' | + | |
- | + | ||
- | git config --global core.excludesfile " | + | |
- | + | ||
- | The above command will only set the location of the ignore file that git will use. The file has to still be manually created in that location and populated with the ignore list. | + | |
- | + | ||
- | == Environment Variables == | + | |
- | + | ||
- | Open up My Computer -> Advanced System Settings -> Environment Variables. Then: | + | |
- | + | ||
- | - Add the git binary path (eg '' | + | |
- | - Add '' | + | |
- | + | ||
- | == File Permissions == | + | |
- | + | ||
- | If your repository is on a filesystem whose executable bits are unreliable (like FAT), git should be configured to ignore differences in file modes recorded in the index and the file mode on the filesystem if they differ only on executable bit: | + | |
- | + | ||
- | | + | |
- | + | ||
- | and/or | + | |
- | + | ||
- | git config --global core.filemode false | + | |
- | + | ||
- | ==== 4. Get an SSL Certificate ==== | + | |
- | + | ||
- | To establish a secure connection between your computer and GitLab via Secure Shell (SSH) you will need to create and install SSH keys. The private key resides on your computer, the public key is stored at the GitLab server. | + | |
- | + | ||
- | === Create SSH keys === | + | |
- | + | ||
- | * On a Mac, follow the steps in the [[https:// | + | |
- | * On Windows, see the [[http:// | + | |
- | + | ||
- | === Set public key in gitlab.com === | + | |
- | + | ||
- | Add your key by navigating to the 'SSH Keys' section in your user profile, selecting 'Add SSH Key' and copy-pasting the //public// key to the ' | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | === Server certificate verification failure === | + | |
- | + | ||
- | For some setups, the SSL certificate verification will fail. Error messages might be: | + | |
- | + | ||
- | error: SSL certificate problem, verify that the CA cert is OK. Details: | + | |
- | error: | + | |
- | + | ||
- | or | + | |
- | + | ||
- | Cloning into ' | + | |
- | ssh_exchange_identification: | + | |
- | fatal: Could not read from remote repository | + | |
- | + | ||
- | If it is acceptable to turn off the SSL validation instead of actually solving the issue this will turn off validation for the current repo | + | |
- | + | ||
- | git config --local http.sslVerify false | + | |
- | + | ||
- | If you would rather have this as a default behaviour for git then the following will do it for all repos | + | |
- | + | ||
- | git global --local http.sslVerify false | + | |
- | + | ||
- | and for those that would rather add to the .git/config file directly the entry looks like | + | |
- | + | ||
- | [http] | + | |
- | sslVerify = false | + | |
- | + | ||
- | ---- | + | |
- | + | ||
- | ===== How to use ===== | + | |
- | + | ||
- | We created a test repository to let you check your installation and make your first steps. | + | |
- | + | ||
- | ==== 1. Get code ==== | + | |
- | + | ||
- | To get the code you need to //clone a remote repository//: | + | |
- | + | ||
- | git clone git@gitlab.com: | + | |
- | + | ||
- | __Beware:__ SSH clients use the '' | + | |
- | + | ||
- | + | ||
- | === Git submodule === | + | |
- | + | ||
- | //A submodule is a repository embedded inside another repository. We provide a detailed description and other resources on our [[kb: | + | |
- | + | ||
- | The '' | + | |
- | + | ||
- | cd hampelsoft-test | + | |
- | git submodule update --init --remote --recursive | + | |
- | + | ||
- | ==== 2. Work locally ==== | + | |
- | + | ||
- | To propose files for version controlling (to make git work with your files) you need to //stage// the files: | + | |
- | + | ||
- | git add README.txt | + | |
- | + | ||
- | To actually add new or changed files to the repository, you need to //commit// them: | + | |
- | + | ||
- | git commit -m "first commit" | + | |
- | + | ||
- | + | ||
- | ==== 3. Share with others ==== | + | |
- | + | ||
- | To send your changes to the central, remote repository, you need to //push// your local repository: | + | |
- | + | ||
- | git push -u origin master | + | |
---- | ---- | ||
Line 220: | Line 18: | ||
You can find more information on how to work with(in) Source Code Control in our [[kb: | You can find more information on how to work with(in) Source Code Control in our [[kb: | ||
- | * [[kb:bestpractices: | + | {{indexmenu> |
- | * [[kb: | + | |
- | * [[kb: | + | |
- | * [[kb: | + | |
Line 232: | Line 27: | ||
Please read [[: | Please read [[: | ||
- | ==== Git Tags ==== | ||
- | |||
- | Git does not give perfect integer revision numbers that increment on each commit. Instead, git hashes the commit data and uses that as a unique identifier of the commit. That means one commit could be '' | ||
- | |||
- | However, git allows you to create descriptive labels for marking specific points in history as being important, i.e. creating pointers to specific commits. These pointers are called //tags//. Typically, tagging is used for marking release points (v1.2.3, and so on), and that's exactly what we do, as well. | ||
- | |||
- | Read the [[http:// | ||
- | |||
- | |||
- | |||
- | ---- | ||
- | |||
- | ===== Further Resources ===== | ||
- | |||
- | ==== General ==== | ||
- | |||
- | * [[http:// | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | |||
- | ==== Password Management ==== | ||
- | |||
- | //By courtesy of Fabiola De La Cueva// | ||
- | |||
- | **pageant** is a tool that runs at startup so you only have to enter your password once: | ||
- | |||
- | http:// | ||
- | |||
- | ==== Compare / Merge VIs ==== | ||
- | |||
- | //By courtesy of Fabiola De La Cueva// | ||
- | |||
- | Instructions on how to configure your client tool to use LabVIEW Compare and LabVIEW Merge towards the end of this article: | ||
- | |||
- | http:// | ||
- | |||
- | ==== Internal ==== | ||
- | |||
- | // | ||
- | |||
- | * [[organization: |
processes/version-control.txt · Last modified: 2023/05/23 13:21 by joerg.hampel