GIT: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen
(Update merge and discard changes)
Zeile 7: Zeile 7:
== Initialization ==
== Initialization ==


=== Configuration ===
=== Administration Configuration ===


With Git - Administration - Config you can set the global git parameters for user name and mail-address.
Sets the global git parameters for user name and mail-address.


Executed git-command: ''git config --global user.name=<user name>'',
=== Get the local git repository ===
''git config --global user.email=<mail address>''.


=== Administration Clone ===
Provide the functionality of 'git clone': Cloning a repository into a a new local directory.

Provides the functionality of 'git clone': Cloning a repository into a a new local directory.
A dialog asks for the url of the remote repository.
A dialog asks for the url of the remote repository.

Executed git-command: ''git clone <repository-url>''.


== Workflow ==
== Workflow ==
Zeile 20: Zeile 25:
=== Add ===
=== Add ===
Before you can commit your new or changed testsuite, you have add the file to the git index with the '''''Add'''''-command.
Before you can commit your new or changed testsuite, you have add the file to the git index with the '''''Add'''''-command.

It executes ''git add <testsuite-file>''.
Executed git-command: ''git add <testsuite-file>''.
<!-- git add: Add file contents to the index -->
<!-- git add: Add file contents to the index -->


Zeile 26: Zeile 32:


The added files you can commit to your local branch by using the '''''Commit...'''''-command. A message-box will appear to enter the commit-message. An empty commit-message is not allowed.
The added files you can commit to your local branch by using the '''''Commit...'''''-command. A message-box will appear to enter the commit-message. An empty commit-message is not allowed.

Executed git-command: ''git commit -m "<log-message>"''.

<!-- git commit: Record changes to the repository -->
<!-- git commit: Record changes to the repository -->
* '''''Add and commit...'''''<br /> Combines the add- and commit-command.
* '''''Add and commit...'''''<br /> Combines the add- and commit-command.<br />
Executed git-commands: ''git add <Testsuite>''
* '''''Commit (amend)'''''<br /> Replace the tip of the current branch by creating a new commit. The new commit has the same parents and author as the current one. <br />You should understand the implications of rewriting history if you amend a commit that has already been published!
''git commit -m "<log-message>"''.

* '''''Commit (amend)'''''<br />Replace the tip of the current branch by creating a new commit. The new commit has the same parents and author as the current one. <br /> You should understand the implications of rewriting history if you amend a commit that has already been published! <br />
Executed git-command: ''git commit --amend''.


=== Push ===
=== Push ===


To publish your test-suite to the remote-repository you have to push it.
To publish your test-suite to the remote-repository you have to push it.

Executed git-command: ''git push''.
<!-- git push: Update remote refs along with associated objects -->
<!-- git push: Update remote refs along with associated objects -->


Zeile 38: Zeile 53:


Incorporates changes from the remote repository into the current branch.
Incorporates changes from the remote repository into the current branch.

Because autoimatically merge by git isn't possibly, you can get merge-conflicts. To avoid this, better use '''''Merge into newest Version of Branch'''''.

Executed git-command: ''git pull''.


=== Fetch ===
=== Fetch ===
Zeile 43: Zeile 62:
Downloads objects and refs from the remote repository, but don't change the local files files.
Downloads objects and refs from the remote repository, but don't change the local files files.


Executed git-command: ''git fetch''.
Because autimatically merge by git isn't possibly, you can get merge-conflicts. To avoid this, better use '''''Merge into newest Version of Branch'''''.


=== Checkout branch... ===
=== Check out branch... ===


To change your working branch, use the '''''Checkout branch...'''''-command. In a dialog you can choose you desired branch.
To change your working branch, use the '''''Check out branch...'''''-command. In a dialog you can choose the desired branch.

If you have uncommitted changes, git rejects the checkout of the new branch. You can discard (see below) or commit your changes and try again.

Executed git-command: ''git checkout -b <branch>''

== Conflict handling ==


=== Discard changes in working directory ===
=== Discard changes in working directory ===


If you get conflicts by changing the branch, you can either commit your file or discard the changes.
If you get conflicts by changing the branch, because you have uncommitted changes in your file, you can discard the changes. Attention: your changes are lost!

The other possibility is to commit your changes.

Executed git-command: ''git checkout -- <Testsuite>''.

=== Abort merge after conflict ===

If your branch and the remote-branch have diverged, you will get merge-conflicts after pulling from the repository. Because a git-merge isn't possible with exepecco-testsuite-files, you have to merge it with the ''expecco-ProjectDifferenceBrowser'' (see below). To get a proper state you first have to abort the merge.

Executed git-command: ''git merge --abort''.


== Comparing and merging ==
== Comparing and merging ==
Zeile 57: Zeile 92:
You can compare and merge your testsuite in three different kinds.
You can compare and merge your testsuite in three different kinds.


In every case the Expecco-ProjectDifferenceBrowser will open. After merging you have to save, add and commit your testsuite (and then push).
In every case the ''Expecco-ProjectDifferenceBrowser'' will open. After merging you have to save, add and commit your testsuite (and then push).


=== Merge into newest Version of Branch ===
=== Merge into newest Version of Branch ===
Zeile 63: Zeile 98:
Merge with HEAD of the current branch.
Merge with HEAD of the current branch.


You get the newest version of the current branch from the repository with the changes done by other and can take over the changes your changes.
You get the newest version of the current branch from the repository with the changes done by others and can take over the changes your changes.


This command doesn't switch the branch in your working directory.
=== Merge with Branch... ===

Executed git-command: ''git reset --hard @{upstream}''
''git pull''

=== Merge with branch... ===


Update your testsuite-content with the version of another branch, you select in a dialog.
Update your testsuite-content with the version of another branch, you select in a dialog.

This command doesn't switch the branch in your working directory.

Executed git-command: ''git checkout <comparebranch>''
''git pull'' (if remote-branch)
''git checkout <currentbranch>''



=== Merge into Branch... ===
=== Merge into Branch... ===
Zeile 73: Zeile 120:
Merge your testsuite-content into the version of another branch, you select in a dialog.
Merge your testsuite-content into the version of another branch, you select in a dialog.


This command switches the branch in your working directory to the selected branch.

Executed git-command: ''git checkout <comparebranch>''
''git pull'' (if remote-branch)


== Status dialogs ==
== Status dialogs ==
Zeile 79: Zeile 130:


Displays a dialog with the commit logs of the current branch.
Displays a dialog with the commit logs of the current branch.

Executed git-command: ''git log''


=== Show Status ===
=== Show Status ===


Shows the working tree status.
Shows the working tree status.

Executed git-command: ''git status''


== Not implemented ==
== Not implemented ==

Version vom 19. Juli 2019, 16:29 Uhr

Preconditions[Bearbeiten]

The plugin provides git-functionality for testsuites.

For proper work you need a remote-repository and access to it without entering user name and password.

Initialization[Bearbeiten]

Administration Configuration[Bearbeiten]

Sets the global git parameters for user name and mail-address.

 Executed git-command: git config --global user.name=<user name>, 
                       git config --global user.email=<mail address>.

Administration Clone[Bearbeiten]

Provides the functionality of 'git clone': Cloning a repository into a a new local directory. A dialog asks for the url of the remote repository.

 Executed git-command: git clone <repository-url>.

Workflow[Bearbeiten]

Add[Bearbeiten]

Before you can commit your new or changed testsuite, you have add the file to the git index with the Add-command.

 Executed git-command: git add <testsuite-file>.

Commit[Bearbeiten]

The added files you can commit to your local branch by using the Commit...-command. A message-box will appear to enter the commit-message. An empty commit-message is not allowed.

 Executed git-command: git commit -m "<log-message>".
  • Add and commit...
    Combines the add- and commit-command.
 Executed git-commands: git add <Testsuite>
                        git commit -m "<log-message>".
  • Commit (amend)
    Replace the tip of the current branch by creating a new commit. The new commit has the same parents and author as the current one.
    You should understand the implications of rewriting history if you amend a commit that has already been published!
 Executed git-command: git commit --amend.

Push[Bearbeiten]

To publish your test-suite to the remote-repository you have to push it.

 Executed git-command: git push.

Pull[Bearbeiten]

Incorporates changes from the remote repository into the current branch.

Because autoimatically merge by git isn't possibly, you can get merge-conflicts. To avoid this, better use Merge into newest Version of Branch.

 Executed git-command: git pull.

Fetch[Bearbeiten]

Downloads objects and refs from the remote repository, but don't change the local files files.

 Executed git-command: git fetch.

Check out branch...[Bearbeiten]

To change your working branch, use the Check out branch...-command. In a dialog you can choose the desired branch.

If you have uncommitted changes, git rejects the checkout of the new branch. You can discard (see below) or commit your changes and try again.

 Executed git-command: git checkout -b <branch>

Conflict handling[Bearbeiten]

Discard changes in working directory[Bearbeiten]

If you get conflicts by changing the branch, because you have uncommitted changes in your file, you can discard the changes. Attention: your changes are lost!

The other possibility is to commit your changes.

 Executed git-command: git checkout -- <Testsuite>.

Abort merge after conflict[Bearbeiten]

If your branch and the remote-branch have diverged, you will get merge-conflicts after pulling from the repository. Because a git-merge isn't possible with exepecco-testsuite-files, you have to merge it with the expecco-ProjectDifferenceBrowser (see below). To get a proper state you first have to abort the merge.

 Executed git-command: git merge --abort.

Comparing and merging[Bearbeiten]

You can compare and merge your testsuite in three different kinds.

In every case the Expecco-ProjectDifferenceBrowser will open. After merging you have to save, add and commit your testsuite (and then push).

Merge into newest Version of Branch[Bearbeiten]

Merge with HEAD of the current branch.

You get the newest version of the current branch from the repository with the changes done by others and can take over the changes your changes.

This command doesn't switch the branch in your working directory.

 Executed git-command: git reset --hard @{upstream}                   
                       git pull      

Merge with branch...[Bearbeiten]

Update your testsuite-content with the version of another branch, you select in a dialog.

This command doesn't switch the branch in your working directory.

 Executed git-command: git checkout <comparebranch>                   
                       git pull  (if remote-branch)
                       git checkout <currentbranch>


Merge into Branch...[Bearbeiten]

Merge your testsuite-content into the version of another branch, you select in a dialog.

This command switches the branch in your working directory to the selected branch.

 Executed git-command: git checkout <comparebranch>                   
                       git pull  (if remote-branch)

Status dialogs[Bearbeiten]

Show Log[Bearbeiten]

Displays a dialog with the commit logs of the current branch.

 Executed git-command: git log

Show Status[Bearbeiten]

Shows the working tree status.

 Executed git-command: git status

Not implemented[Bearbeiten]

  • Create and drop branches.
  • Use of the git-stash-command.



Copyright © 2014-2024 eXept Software AG