Skip to content

Commit

Permalink
add credentials warning (#2636)
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
  • Loading branch information
memsharded and czoido committed Jul 7, 2022
1 parent fdc06e3 commit aab66eb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions reference/conanfile/tools/scm/git.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ get_remote_url()
Obtains the URL of the ``remote`` git remote repository, with ``git remote -v``

.. warning::

This method will get the output from ``git remote -v``. If you added tokens or credentials to the remote in the URL, they will be
exposed. Credentials shouldn't be added to git remotes definitions, but using a credentials manager or similar mechanism.
If you still want to use this approach, it is your responsibility to strip the credentials from the result.


commit_in_remote()
------------------
Expand Down Expand Up @@ -104,6 +110,14 @@ get_url_and_commit()
.. code-block:: python
def get_url_and_commit(self, remote="origin")
# returns a (url, commit) tuple
.. warning::

This method will get the output from ``git remote -v``. If you added tokens or credentials to the remote in the URL, they will be
exposed. Credentials shouldn't be added to git remotes definitions, but using a credentials manager or similar mechanism.
If you still want to use this approach, it is your responsibility to strip the credentials from the result.


This is an advanced method, that returns both the current commit, and the remote repository url.
Expand Down

0 comments on commit aab66eb

Please sign in to comment.