I'm in the chapter - Cloning the remote project
This commit is contained in:
parent
350a3b6a45
commit
335c987261
|
@ -17,6 +17,9 @@ That is the best tool for teamwork.
|
|||
# Git via `bash`
|
||||
|
||||
## Initialing a git repo
|
||||
To initialize an empty git repository, you can tap _**git init**_ in a text editor like Git Bash.
|
||||
This command will create a git repository in the initial branch **master**.
|
||||
You will be able to add, commit, push, etc.
|
||||
|
||||
```
|
||||
waldek@metal:~/Documents/my_first_git_repository$ git status
|
||||
|
@ -41,8 +44,12 @@ No commits yet
|
|||
nothing to commit (create/copy files and use "git add"
|
||||
```
|
||||
|
||||
If you want to see if you are in a git repository, you can use _**git status**_.
|
||||
He will inform you which branch that you are and how many commits in this repository.
|
||||
Be careful with commands because you have to be in a folder.
|
||||
In the preceding example, the new repository was in the "my_first_git_repository" folder.
|
||||
## What's in this repo
|
||||
|
||||
You can see all files of your git repository with the command **_ls_**.
|
||||
```
|
||||
waldek@metal:~/Documents/my_first_git_repository$ ls -la
|
||||
total 12
|
||||
|
@ -156,26 +163,27 @@ waldek@metal:~/Documents/my_first_git_repository$
|
|||
|
||||
In Pycharm, you have to enable a version control integration.
|
||||
There are many choices, but we will use Git.
|
||||
As you can see, Git appears in the toolbar and a git window appear bottom of the window.
|
||||
And you can identify the current branch that you are in.
|
||||
So the default branch name is **master**.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
As you can see, Git appears in the toolbar and a git window appear bottom of the window.
|
||||
And you can identify the current branch that you are in.
|
||||
So the default branch name is **master**.
|
||||
|
||||

|
||||
|
||||
Let's try to write some code
|
||||
Let's try to write some code.
|
||||
And add all contents that we write in a git repository.
|
||||
|
||||

|
||||
|
||||
In the commit window, we can see file project.
|
||||
But we had three important things.
|
||||
In the commit window, we can see which file had changed.
|
||||
But we had three important things too.
|
||||
We have a textBox and two buttons.
|
||||
In the textBox, you can write a comment when you commit.
|
||||
The _Commit_ button is used to save all change in your project.
|
||||
The _Commit_ button is used to save all change of your project in a git repository.
|
||||
The _Commit and Push_ is used to commit and push the project in a Git.
|
||||
|
||||

|
||||
|
@ -187,24 +195,54 @@ You can see which branch and which commit that you push.
|
|||
|
||||
## Creating an online repository
|
||||
|
||||
If you use Gitea and you want to create a new repository.
|
||||
That is pretty simple, you have to press the button **New Repository**.
|
||||
|
||||

|
||||
|
||||
And then, you can add the repository name, and others parameters like description, the visibility, etc.
|
||||
|
||||

|
||||
|
||||
When you have finish, you have to press the button **Create Repository**.
|
||||
|
||||

|
||||
|
||||
Et voila, you have created a new repository on Gitea and you receive an https link.
|
||||
This link is used if you want to share your project with someone, or you want to clone this repository.
|
||||
|
||||

|
||||
|
||||
If you want to work in your repository in Pycharm, you have to clone it.
|
||||
In the toolbar, you can click on Git and you will find the button **Clone**.
|
||||
Then, a window will be open, and you have to copy and paste the https link of your repository.
|
||||
|
||||

|
||||
|
||||
When the clone is successfully does, you can change the project.
|
||||
And if you have finished your job, you can **Commit and Push**.
|
||||
If you want to commit and push all changes that you have made, you have to check all changes in the left window.
|
||||
And then, you can press **Commit and Push**.
|
||||
|
||||

|
||||
|
||||
In the bottom git window, you can see all commits, and their comments, of this repository.
|
||||
If you clone a another repository, you will be able to see all commits that people made and their comment.
|
||||
That is pretty cool !
|
||||
|
||||
## Adding some changes to our local code
|
||||
|
||||
In Gitea, you can see what the git repository contain and the last comment of commits.
|
||||
|
||||

|
||||
|
||||
If you check all changes and you want to **Commit and Push**, don't forget the comment.
|
||||
That is important for a good teamwork.
|
||||
|
||||

|
||||
|
||||
If you commit twice, you are able to verify how many commits and when commits have done.
|
||||
|
||||

|
||||
|
||||
<!---
|
||||
|
@ -214,11 +252,17 @@ You can see which branch and which commit that you push.
|
|||
-->
|
||||
|
||||
## Cloning the remote project into a new project
|
||||
In the main menu of PyCharm, you can click in **Get from VCS**.
|
||||
If you click in it, you have just copy and paste the https link of the git repository.
|
||||
|
||||

|
||||
|
||||
You have to trust the git repository.
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||

|
||||
|
||||

|
||||
|
|
Loading…
Reference in New Issue