1
1
Remote feature
2
2
==============
3
3
4
- Git is a distributed source control management system. This means that all changes you make are local. When you commit
5
- changes, you only commit them to your local repository. To publish your local changes you need to push. In order to get
4
+ Git is a distributed source control management system. This means that all changes you make are local. When you commit
5
+ changes, you only commit them to your local repository. To publish your local changes you need to push. In order to get
6
6
changes committed by others, you need to pull.
7
7
8
8
Manage remote repositories
@@ -12,14 +12,14 @@ You can manage the remote repositories in the ``Remotes`` menu.
12
12
13
13
.. image :: /images/manage_remote_repositories.png
14
14
15
- When you cloned your repository from a public repository, this remote is already configured. You can rename each remote for
16
- easy recognition. The default name after cloning a remote is ``origin ``. If you use PuTTY as SSH client you can also enter the
17
- private key file for each remote. Git Extensions will load the key when needed. How to create a private key file is described
15
+ When you cloned your repository from a public repository, this remote is already configured. You can rename each remote for
16
+ easy recognition. The default name after cloning a remote is ``origin ``. If you use PuTTY as SSH client you can also enter the
17
+ private key file for each remote. Git Extensions will load the key when needed. How to create a private key file is described
18
18
in the next paragraph.
19
19
20
20
.. image :: /images/remote_repositories.png
21
21
22
- In the ``Default pull behaviour `` tab you can configure the branches that need to be pulled and merged by default. If you
22
+ In the ``Default pull behaviour `` tab you can configure the branches that need to be pulled and merged by default. If you
23
23
configure this correctly you will not need to choose a branch when you pull or push. There are two buttons on this dialog:
24
24
25
25
+-------------------------------+---------------------------------------------------------------------+
@@ -30,25 +30,25 @@ configure this correctly you will not need to choose a branch when you pull or p
30
30
31
31
.. image :: /images/remote_repositories2.png
32
32
33
- After cloning a repository you do not need to configure all remote branches manually. Instead you can checkout the remote
34
- branch and choose to create a local tracking branch.
33
+ After cloning a repository you do not need to configure all remote branches manually. Instead you can checkout the remote
34
+ branch and choose to create a local tracking branch.
35
35
36
36
Create SSH key
37
37
--------------
38
38
39
- Git uses SSH for accessing private repositories. SSH uses a public/private key pair for authentication. This means you need
40
- to generate a private key and a public key. The private key is stored on your computer locally and the public key can be given
41
- to anyone. SSH will encrypt whatever you send using your secret private key. The receiver will then use the public key you send
42
- to decrypt the data.
39
+ Git uses SSH for accessing private repositories. SSH uses a public/private key pair for authentication. This means you need
40
+ to generate a private key and a public key. The private key is stored on your computer locally and the public key can be given
41
+ to anyone. SSH will encrypt whatever you send using your secret private key. The receiver will then use the public key you send
42
+ to decrypt the data.
43
43
44
- This encryption will not protect the data itself but it protects the authenticity. Because the private key is only available to
45
- the sender, the receiver can be sure about the origin of the data. In practise the key pair is only used for the authentication
44
+ This encryption will not protect the data itself but it protects the authenticity. Because the private key is only available to
45
+ the sender, the receiver can be sure about the origin of the data. In practise the key pair is only used for the authentication
46
46
process. The data itself will be encrypted using a key that is exchanged during this initial phase.
47
47
48
48
PuTTY and github
49
49
^^^^^^^^^^^^^^^^
50
50
51
- PuTTY is SSH client that for Windows that is a bit more user friendly then OpenSSH. Unfortunately PuTTY does not work with
51
+ PuTTY is SSH client that for Windows that is a bit more user friendly then OpenSSH. Unfortunately PuTTY does not work with
52
52
all servers. In this paragraph I will show how to generate a key for github using putty.
53
53
54
54
First make sure GitExtensions is configured to use PuTTY and all paths are correct.
@@ -63,24 +63,24 @@ can choose ``Generate or import key`` to start the key generator.
63
63
| .. image:: /images/putty_key_generator1.png | .. image:: /images/putty_key_generator2.png |
64
64
+--------------------------------------------+---------------------------------------------+
65
65
66
- PuTTY will ask you to move the mouse around to generate a more random key. When the key is generated you can save the public and
67
- the private key in a file. You can choose to protect the private key with a password but this is not necessary.
66
+ PuTTY will ask you to move the mouse around to generate a more random key. When the key is generated you can save the public and
67
+ the private key in a file. You can choose to protect the private key with a password but this is not necessary.
68
68
69
- Now you have a key pair you need to give github the public key. This can be done in ``Account Settings `` in the tab
69
+ Now you have a key pair you need to give github the public key. This can be done in ``Account Settings `` in the tab
70
70
``SSH Public Keys ``. You can add multiple keys here, but you only need one key for all repositories.
71
71
72
72
.. image :: /images/account_settings.png
73
73
74
- After telling github what public key to use to decrypt, you need to tell GitExtensions what private key to use to encrypt.
75
- In the clone dialog there is a ``Load SSH key `` button to load the private key into the PuTTY authentication agent. This can
74
+ After telling github what public key to use to decrypt, you need to tell GitExtensions what private key to use to encrypt.
75
+ In the clone dialog there is a ``Load SSH key `` button to load the private key into the PuTTY authentication agent. This can
76
76
also be done manually by starting the PuTTY authentication agent and choose ``add key `` in the context menu in the system tray.
77
77
78
78
.. image :: /images/putty_agent.png
79
79
80
- GitExtensions can load the private keys automatically for you when communicating with a remote. You need to configure the
80
+ GitExtensions can load the private keys automatically for you when communicating with a remote. You need to configure the
81
81
private key for the remote.
82
82
83
- This is done in the ``Manage remote repositories `` dialog.
83
+ This is done in the ``Manage remote repositories `` dialog.
84
84
85
85
OpenSSH and github
86
86
^^^^^^^^^^^^^^^^^^
@@ -89,57 +89,57 @@ When you choose to use OpenSSH you need to configure GitExtensions as shown in t
89
89
90
90
.. image :: /images/github_openssh.png
91
91
92
- OpenSSH is the best SSH client there is but it lacks Windows support. Therefore it is slightly more complex to use.
93
- Another drawback is that GitExtensions cannot control OpenSSH and needs to show the command line dialogs when OpenSSH might
94
- be used. GitExtensions will show the command line window for every command that might require a SSH connection. For this
92
+ OpenSSH is the best SSH client there is but it lacks Windows support. Therefore it is slightly more complex to use.
93
+ Another drawback is that GitExtensions cannot control OpenSSH and needs to show the command line dialogs when OpenSSH might
94
+ be used. GitExtensions will show the command line window for every command that might require a SSH connection. For this
95
95
reason PuTTY is the prefered SSH client in GitExtensions.
96
96
97
- To generate a key pair in OpenSSH you need to go to the command line. I recommend to use the git bash because the path to
97
+ To generate a key pair in OpenSSH you need to go to the command line. I recommend to use the git bash because the path to
98
98
OpenSSH is already set.
99
99
100
100
.. image :: /images/git_bash_toolbar.png
101
101
102
102
Type the following command: ``ssh-keygen -C "your@email.com" -t rsa ``
103
- Use the same email address as the email address used in git. You will be asked where if you want to protect the private
104
- key with a password. This is not necessary. By default the public and private keys are stored in
103
+ Use the same email address as the email address used in git. You will be asked where if you want to protect the private
104
+ key with a password. This is not necessary. By default the public and private keys are stored in
105
105
``c:\Documents and Settings\[User]\.ssh\ `` or ``c:\Users\[user]\.ssh\ ``.
106
106
107
107
.. image :: /images/ssh_bash.png
108
108
109
- You do not need to tell GitExtensions about the private key because OpenSSH will load it for you. Now open the public
110
- key using notepad and copy the key to github. This can be done in ``Account Settings `` in the tab ``SSH Public Keys ``
109
+ You do not need to tell GitExtensions about the private key because OpenSSH will load it for you. Now open the public
110
+ key using notepad and copy the key to github. This can be done in ``Account Settings `` in the tab ``SSH Public Keys ``
111
111
on `GitHub <http://www.github.com >`_.
112
112
113
113
.. image :: /images/ssh_folder.png
114
114
115
115
Pull changes
116
116
------------
117
117
118
- You can get remote changes using the pull function. Before you can pull remote changes you need to make sure there are no
119
- uncommitted changes in your local repository. If you have uncommitted changes you should commit them or stash them during the
118
+ You can get remote changes using the pull function. Before you can pull remote changes you need to make sure there are no
119
+ uncommitted changes in your local repository. If you have uncommitted changes you should commit them or stash them during the
120
120
pull. You can read about how to use the stash in the Stash chapter.
121
121
122
122
.. image :: /images/pull_toolbar.png
123
123
124
- In order to get your personal repository up-to-date, you need to fetch changes from a remote repository. You can do this using
125
- the ``Pull `` dialog. When the dialog starts the default remote for the current branch is set. You can choose another remote
124
+ In order to get your personal repository up-to-date, you need to fetch changes from a remote repository. You can do this using
125
+ the ``Pull `` dialog. When the dialog starts the default remote for the current branch is set. You can choose another remote
126
126
or enter a custom url if you like. When the remote branches configured correctly, you do not need to choose a remote branch.
127
127
128
- If you just fetch the commits from the remote repository and you already committed some changes to your local repository, the
129
- commits will be in a different branch. In the pull dialog this is illustrated in the image on the left. This can be useful when
128
+ If you just fetch the commits from the remote repository and you already committed some changes to your local repository, the
129
+ commits will be in a different branch. In the pull dialog this is illustrated in the image on the left. This can be useful when
130
130
you want to review the changes before you want to merge them with your own changes.
131
131
132
132
133
133
.. image :: /images/pull_dialog.png
134
134
135
- When you choose to merge the remote branch after fetching the changes a branch will be created, and will be merged you’re
135
+ When you choose to merge the remote branch after fetching the changes a branch will be created, and will be merged into
136
136
your commit. Doing this creates a lot of branches and merges, making the history harder to read.
137
137
138
138
.. image :: /images/pull_dialog2.png
139
139
140
- Instead of merging the fetched commits with your local commits, you can also choose to rebase your commits on top of the
141
- fetched commits. This is illustrated on the left in the image below. A rebase will first undo your local commits (c and d),
142
- then fetch the remote commits (e) and finally recommit your local commits. When there is a merge conflict during the rebase,
140
+ Instead of merging the fetched commits with your local commits, you can also choose to rebase your commits on top of the
141
+ fetched commits. This is illustrated on the left in the image below. A rebase will first undo your local commits (c and d),
142
+ then fetch the remote commits (e) and finally recommit your local commits. When there is a merge conflict during the rebase,
143
143
the rebase dialog will show.
144
144
145
145
.. image :: /images/pull_dialog3.png
@@ -160,23 +160,23 @@ Next to the pull button there are some buttons that can be useful:
160
160
Push changes
161
161
------------
162
162
163
- In the browse window you can check if there are local commits that are not pushed to a remote repository yet. In the image
164
- below the green labels mark the position of the master branch on the remote repository. The red label marks the position of
163
+ In the browse window you can check if there are local commits that are not pushed to a remote repository yet. In the image
164
+ below the green labels mark the position of the master branch on the remote repository. The red label marks the position of
165
165
the master branch on the local repository. The local repository is ahead three commits.
166
166
167
167
.. image :: /images/push1.png
168
168
169
- To push the changes press ``Push `` in the toolbar.
169
+ To push the changes press ``Push `` in the toolbar.
170
170
171
171
.. image :: /images/push_toolbar.png
172
172
173
- The push dialog allows you to choose the remote repository to push to. The remote repository is set to the remote of the
174
- current branch. You can choose another remote or choose a url to push to. You can also specify a branch to push.
173
+ The push dialog allows you to choose the remote repository to push to. The remote repository is set to the remote of the
174
+ current branch. You can choose another remote or choose a url to push to. You can also specify a branch to push.
175
175
176
176
.. image :: /images/push_dialog.png
177
177
178
- Tags are not pushed to the remote repository. If you want to push a tag you need to open the ``Tags `` tab in the dialog. You
179
- can choose to push a singe tag or all tags. No commits will be pushed when the ``Tags `` tab is selected, only tags.
178
+ Tags are not pushed to the remote repository. If you want to push a tag you need to open the ``Tags `` tab in the dialog. You
179
+ can choose to push a singe tag or all tags. No commits will be pushed when the ``Tags `` tab is selected, only tags.
180
180
181
- You can not merge your changes in the remote repository. Merging must be done locally. This means that you cannot push your
181
+ You can not merge your changes in the remote repository. Merging must be done locally. This means that you cannot push your
182
182
changes before the commits are merged locally. In practice you need to pull before you can push most of the times.
0 commit comments