Changes

Jump to navigation Jump to search
180 bytes removed ,  18:31, 1 December 2023
m
Text replacement - "</syntaxhighlight>" to "</pre>"
$ ls -d -1 $PWD/*
/home/user/myprojects/$project
</syntaxhighlightpre>
Note that git automatically creates a directory where the repository content will be checked out.
origin git@github.com:$username/$project.git (fetch)
origin git@github.com:$username/$project.git (push)
</syntaxhighlightpre>
Currently, there is only one remote repository; it is automatically registered during the clone operation. Git remembers this repository as the default repository for push/pull operations.
Any kind of feedback is welcome; please check out the online documentation at
</syntaxhighlightpre>
===Commit to Local Repository===
<syntaxhighlight lang="shell">
$ git add readme.txt
</syntaxhighlightpre>
Then perform the actual commit:
[master 0fde1fb] Added TODO in section "USING GIT"
1 files changed, 4 insertions(+), 0 deletions(-)
</syntaxhighlightpre>
Before executing the actual commit, git will open the default shell editor (determined using the $EDITOR variable, usually vi) to enter a message describing the commit changes.
[master 0fde1fb] Added TODO in section "USING GIT"
1 files changed, 4 insertions(+), 0 deletions(-)
</syntaxhighlightpre>
===Pushing Changes to Remote Repository===
Enter passphrase for key '/home/user/.ssh/id_rsa':
Everything up-to-date
</syntaxhighlightpre>
===Pulling Changes from Remote Repository===
Enter passphrase for key '/home/user/.ssh/id_rsa':
Already up-to-date.
</syntaxhighlightpre>
===Add Upstream Repository===
upstream git@github.com:BaseXdb/$project.git (fetch)
upstream git@github.com:BaseXdb/$project.git (push)
</syntaxhighlightpre>
===Pulling Changes from Upstream to Local Repository===
* branch master -> FETCH_HEAD
Already up-to-date.
</syntaxhighlightpre>
The changes can then be pushed in the personal repository:
<syntaxhighlight lang="shell">
$ git push
</syntaxhighlightpre>
Check out the links at the end of the page for more git options.
<syntaxhighlight lang="shell">
$ git pull upstream master
</syntaxhighlightpre>
Now, we create a new branch, based on the master branch
$ git checkout -b new-feature
Switched to a new branch 'new-feature'
</syntaxhighlightpre>
Your are now automatically switched to the ''new-feature'' branch. Now you can make all your changes in one or several commits. You can commit all changes using
<syntaxhighlight lang="shell">
$ git commit -a
</syntaxhighlightpre>
Now, you want to push these changes to the repository on GitHub. Remember, that up to now your changes just reside on your local drive, so now you want to push it to your remote fork of BaseX. Simply do:
To git@github.com:$username/basex.git
* [new branch] new-feature -> new-feature
</syntaxhighlightpre>
You can now use your web browser and go to your fork of BaseX. You will see the following message:
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu