Skip to content

Commit

Permalink
Merge pull request #2637 from conan-io/master
Browse files Browse the repository at this point in the history
Master to develop
  • Loading branch information
czoido committed Jul 7, 2022
2 parents d006b84 + aab66eb commit 7ae0add
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions migrating_to_2.0/commands.rst
Expand Up @@ -20,6 +20,7 @@ Remember that in Conan 1.X you have to specify the build profile or activate the
$ conan install . [--name=mylib] [--version=1.0] [-pr:b=build_profile] [-pr:h=host_profile]
In addition the ``--install-folder`` has been replaced with ``--output-folder``. You might need to provide both arguments in Conan 1.X as some legacy generated files (``conaninfo.txt``, ``conanbuildinfo.txt``, etc) are not affected by ``--output-folder``.

conan create
^^^^^^^^^^^^
Expand Down
14 changes: 14 additions & 0 deletions reference/conanfile/tools/scm/git.rst
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 7ae0add

Please sign in to comment.