guides:software:git
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
guides:software:git [2021/09/16 18:00] – [Overview: What is git?] Fixed typos, minor wording issues. jhoggard | guides:software:git [2024/07/25 15:01] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 101: | Line 101: | ||
==== Server: GitLab, GitHub, etc ==== | ==== Server: GitLab, GitHub, etc ==== | ||
- | Create | + | We can also work with a //remote// repository, which holds a copy of all our work on a server. |
- | Push and pull | + | The department maintains its own GitLab server at codestore.cs.edinboro.edu. |
- | Fork another | + | === Create and clone === |
+ | |||
+ | If you want to set up a remote repository on codestore, you can click the " | ||
+ | |||
+ | You can select " | ||
+ | |||
+ | Afterwards, you will see instructions for cloning your repository to your local machine, but it is not hard: On your project' | ||
+ | |||
+ | Then on your machine (possibly cslab103), type the following in the directory where you want to clone the repository: | ||
+ | < | ||
+ | git clone < | ||
+ | </ | ||
+ | where ''< | ||
+ | |||
+ | Now you have a local copy of the repository, and by default, it is connected to the remote repository. | ||
+ | |||
+ | However, '' | ||
+ | |||
+ | === Push and Pull === | ||
+ | |||
+ | To send your commits up to '' | ||
+ | < | ||
+ | git push origin master | ||
+ | </ | ||
+ | (The above sends your //master// branch commits to '' | ||
+ | |||
+ | To update your local repository with any changes added to the remote repository, you need to //pull// the files. | ||
+ | < | ||
+ | git pull | ||
+ | </ | ||
+ | This will fetch any commits made on your current branch (probably master) and merge them into your current directory. | ||
+ | |||
+ | You can also separate this into two steps. The first retrieves any new snapshots on the remote repository, and the second merges the changes into your current files. | ||
+ | < | ||
+ | git fetch | ||
+ | git merge | ||
+ | </ | ||
+ | |||
+ | ==== Fork Another Repository ==== | ||
+ | |||
+ | You may sometimes want to copy someone else's repository on codestore into your very own version of the repository. | ||
+ | |||
+ | In GitLab (for example, at codestore), you can click on the "Fork" button at the top of a repository | ||
+ | |||
+ | Then you can clone //your// fork of the project to your own computer, and proceed as usual. | ||
- | === Setting up SSH Credentials === | ||
==== Setting Options ==== | ==== Setting Options ==== | ||
Line 117: | Line 160: | ||
The following are common tasks to complete using git. Where we refer to GitLab, the same task can be completed with other git servers, such as GitHub, usually with very little or no change. | The following are common tasks to complete using git. Where we refer to GitLab, the same task can be completed with other git servers, such as GitHub, usually with very little or no change. | ||
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
guides/software/git.1631815217.txt.gz · Last modified: 2024/07/25 15:01 (external edit)