GIT: mudanças entre as edições

De Wiki Clusterlab.com.br
Ir para navegação Ir para pesquisar
Sem resumo de edição
Linha 1: Linha 1:
*https://github.com/rocko83
*https://github.com/rocko83
=Atlassian GIT Tips=
*https://confluence.atlassian.com/bitbucketserver/basic-git-commands-776639767.html
=Commands=
==List files==
<pre>
git ls-files
</pre>
=create a new repository on the command line=
=create a new repository on the command line=
<pre>
<pre>
Linha 16: Linha 23:
git push --set-upstream origin sandbox
git push --set-upstream origin sandbox
</pre>
</pre>
 
=MarkDown=
*[https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax Basic writing and formatting syntax]
=push an existing repository from the command line=
=push an existing repository from the command line=
<pre>
<pre>
Linha 38: Linha 46:
git push origin HEAD --force
git push origin HEAD --force
</syntaxhighlight>
</syntaxhighlight>
=Commands=
==List files==
<pre>
git ls-files
</pre>
=Atlassian GIT Tips=
*https://confluence.atlassian.com/bitbucketserver/basic-git-commands-776639767.html

Edição das 00h46min de 14 de dezembro de 2021

Atlassian GIT Tips

Commands

List files

git ls-files

create a new repository on the command line

echo "# JAVALEARN" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/rocko83/JAVALEARN.git
git push -u origin master

Create new branch

git checkout -b sandbox
git add myfile.json
git commit -m "updated myfile.json"
git push --set-upstream origin sandbox

MarkDown

push an existing repository from the command line

git remote add origin https://github.com/rocko83/JAVALEARN.git
git push -u origin master

Pull a repository

git pull origin master

Remember password

git config --global credential.helper store

Revert a commit

#Careful: git reset --hard WILL DELETE YOUR WORKING DIRECTORY CHANGES
git reset --hard HEAD~1
#or
git reset --hard <sha1-commit-id>
git push origin HEAD --force