In this tutorial, I will guide you all on how to push a local GIT repository into a remote GIT repository such as GitHub or Bitbucket …
For example, I have a GIT repository on my machine with the following content:
Now, I want to put this repository into a remote GIT repository of Bitbucket at https://huongdanjavacom@bitbucket.org/huongdanjavacom/coffee.git, the steps to do this would be:
First, we will add the Bitbucket’s repository URL into our repository with the following command:
1 |
git remote add origin <remote_GIT_repository> |
In this example, I will run the following command:
1 |
git remote add origin https://huongdanjavacom@bitbucket.org/huongdanjavacom/coffee.git |
Next, I will push all the data up using the following command:
1 |
git push origin --all |
With this statement, it will not push all the tags we have.
So, our last step is to push all the tags with the following command:
1 |
git push --tags |
Result: