You have been using git to submit your work to GitLab.
But that isn’t what git is really about.
git is a version control (VCS) system; these are also called revision control systems (RCS) or source code management systems (SCMS)).
What version control systems do for you:
Provide backup against accidentally deleting files or chunks of files.
Allow you to find where a change was made that caused problems.
Allow you to revert to a previous version of your file, or to reverse a change you made.
With a remote repository:
Provide backup against your computer failing.
Synchronize your work across multiple computers
Allow you to collaborate with others.
To take advantage of these capabilities you need to develop some good practices:
Do all your work in your repository; don’t just copy things there at the last minute.
Commit and push often:
Your commit message should be concise but useful.
You can provide more extensive information in a second paragraph
git do.Pushing often also lets you know early if there is an issue with GitLab access.
https, after changing your HawkID password you may need to use the Credentials Manager to remove the old authentication information for GitLab.If all goes well:
If you are working on your own and on only one computer, all you will need to do with git is:
Commit changes to your local repository.
Push changes to your remote GitLab repository.
If you are using several computers, or collaborating with someone, you will also need to pull changes from GitLab.
If you run into issues, you will need to use some more git tools.
The most common operations are well supported by RStudio or GitLab:
Finding what changes were made to a file.
Retrieving an older version of a file.
Other operations are easier, or only possible, using the command line:
Moving and Renaming files (while retaining the revision history).
Reversing a particular change.
git Operations with RStudioYou can perform git operations with:
The Tools > Version Control menu.
The Git tab.
Examples:
Make a change, longer commit message, push.
Review history, get old file versions.
Create folders, renaming files.
git Operations with GitLabReview history, get old file versions.
Check out Blame tab.
git in a Shell/TerminalOccasionally git will want to open an editor to let you enter a commit message.
You can prevent this by specifying a message on the command line with the -m option.
The default editor it uses (usually vi or vim) is probably not useful.
You can register a more reasonable editor using
git config --global core.editor <editor>
Replace <editor> with the name of a program that opens your editor when run from the command line with a text file argument.
On Linux you can use gedit or nano; nano works on the notebook server.
On Windows notepad should work.
On Mac OS you should be able to use nano.
Or use your favorite editor if you have one.
You only need to set up an editor once on each system you use.
.gitconfig file in your home directory.If you don’t do this you may end up with git using the vi or the vim editor, which is powerful but not intuitive if you haven’t used it.
vi, type :q<return> or :q!<return> to get out.git clone <repository> [<directory>]git statusgit pullgit add <file1> <file2> ...git commit or git commit -m "<message>"git pushgit log [<file>]git blame <file>git mv <oldname> <newname>git show <REVHASH>:<filepath>It you work on several computers, or collaborate with someone, you may need to resolve conflicts.
Conflicts are marked with
<<<<<<
...
======
...
>>>>>>Remove the markers and adjust the code.
Some editors provide some support for this.
The git revert command allows you to revert a specific commit.
git revert --help provides some documentation.
This can lead to conflicts that will need to be resolved.
GitLab and GitHub are social coding platforms.
In addition to providing a remote repository, they provide a number of facilities to aid in collaboration.
Two important facilities are:
Issues for reporting and discussing bugs and other issues.
Merge requests (called pull requests in GitHub) for managing the incorporation of proposed changes.
Issues can be assigned to someone to deal with; assigning an issue will generate an email to the assignee.
Another useful feature: