Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
howto:git [2020/09/06 00:50] – More tips digital man | howto:git [2024/03/22 21:59] – Create [Reset] section using Deuce's steps digital man | ||
---|---|---|---|
Line 3: | Line 3: | ||
Synchronet uses [[dev:Git]] for its Source Repository (as of August, 2020). | Synchronet uses [[dev:Git]] for its Source Repository (as of August, 2020). | ||
+ | ===== Updating an Install from CVS ===== | ||
+ | |||
+ | So you previously installed Synchronet for *nix using the '' | ||
+ | |||
+ | - Follow the **[[# | ||
+ | - If you previously had any '' | ||
+ | - Now go through your normal build steps (e.g. running '' | ||
+ | - If you want the latest '' | ||
+ | |||
===== Clone ===== | ===== Clone ===== | ||
Line 12: | Line 21: | ||
To clone the repository to your local system (into a directory named ''/ | To clone the repository to your local system (into a directory named ''/ | ||
- | $ git clone https:// | + | $ git clone https:// |
| | ||
To clone the repository to your local system using SSH (your public key must be configured for your user account at '' | To clone the repository to your local system using SSH (your public key must be configured for your user account at '' | ||
- | $ git clone git@gitlab.synchro.net: | + | $ git clone git@gitlab.synchro.net: |
| | ||
==== Mirrors ==== | ==== Mirrors ==== | ||
Line 22: | Line 31: | ||
* https:// | * https:// | ||
* https:// | * https:// | ||
+ | |||
+ | ==== Branches ==== | ||
+ | |||
+ | The '' | ||
+ | |||
+ | $ git checkout dailybuild_linux-x64 | ||
+ | |||
+ | If you wish to switch back to the '' | ||
+ | |||
+ | $ git checkout master | ||
+ | ==== Read-only Directories ==== | ||
+ | |||
+ | If you do not plan to make significant changes to the contents of the '' | ||
+ | |||
+ | - Setting SCFG-> | ||
+ | - Or (on *nix-like systems) symlinking '' | ||
+ | |||
+ | This approach is feasible even for sysops that make changes to files in '' | ||
+ | |||
+ | **Note:**\\ | ||
+ | If you do decide to change your configured '' | ||
===== Create and Checkout a Branch ===== | ===== Create and Checkout a Branch ===== | ||
- | If you're going to make any changes to any files in the repo, you should first create a local branch. To create | + | If you're going to make any changes to any files in the repo, you should first create a local branch. To create |
$ git checkout -b < | $ git checkout -b < | ||
Line 31: | Line 61: | ||
===== Merge Upstream Changes into Your Branch ===== | ===== Merge Upstream Changes into Your Branch ===== | ||
- | To download the latest changes from the Synchronet repository and integrate (merge) with your changed files, | + | To download the latest changes from the Synchronet repository and integrate (merge) with your changed files, |
$ git pull | $ git pull | ||
- | $ git merge master | + | $ git merge origin/master |
===== Push Without Merge Commit ===== | ===== Push Without Merge Commit ===== | ||
Line 48: | Line 78: | ||
hint: See the 'Note about fast-forwards' | hint: See the 'Note about fast-forwards' | ||
- | To avoid a 'merge commit' | + | To avoid a 'merge commit' |
- | $ git reset --soft HEAD~1 | + | $ git pull --rebase --autostash |
- | $ git pull | + | |
- | | + | Then push your changes. |
- | Then re-add/ | + | |
+ | ==== ' | ||
+ | To create a convenient alias for the '' | ||
+ | $ git config --global alias.up "pull --rebase --autostash" | ||
+ | Now you can just run '' | ||
===== Push Without Password ===== | ===== Push Without Password ===== | ||
Line 66: | Line 100: | ||
With that change, if your SSH public key is registered with your '' | With that change, if your SSH public key is registered with your '' | ||
+ | ===== Stash ===== | ||
+ | |||
+ | A '' | ||
+ | error: Your local changes to the following files would be overwritten by merge: | ||
+ | |||
+ | Whether you knowingly or intentionally modified any files, or [[dev:Git]] just did it automatically (e.g. changing line-endings of text files), the suggested solution is to "Stash Local Changes": | ||
+ | |||
+ | - Run '' | ||
+ | - Run '' | ||
+ | - Run '' | ||
+ | - Run '' | ||
+ | - Run '' | ||
+ | |||
+ | ===== Reset ===== | ||
+ | |||
+ | If you're getting errors about local changes to files that you didn't make and you just want to reset ever file in the repo to its latest upstream contents, run these commands: | ||
+ | |||
+ | $ cd / | ||
+ | $ git fetch --all | ||
+ | $ git reset --hard origin/ | ||
+ | $ git checkout master | ||
+ | | ||
+ | After the successful execution of these commands, your sbbs Git repo should be reset back to the current upstream contents. | ||
+ | | ||
+ | ===== Delete the Repo ===== | ||
+ | |||
+ | Under normal circumstances, | ||
+ | |||
+ | - Most installations use symbolic links from the '' | ||
+ | - The repo is your copy of the working source code. Deleting the repo would delete your copy of your working source code. | ||
+ | - Just '' | ||
===== See Also ===== | ===== See Also ===== | ||
* [[: | * [[: |