Please enable JavaScript.
Coggle requires JavaScript to display documents.
Git and GitHub - Coggle Diagram
Git and GitHub
-
Concepts
-
-
Branch
-
You can create a secondary branch from the maste to make experimental - to try experiments on the project independently
-
One advantage of working with branchs is that there's no problem in working in the same part of the project once we'are working in different branchs. Besides this, you can merge this brachs easily even when the branchs are in differents states
Pull Request
When the experiment was a good idea and somebody want I bring back into master branch, he/she make a pull request
-
Automatically behind the scenes, the github verify if threre's conflicts between the brachs and if it's ok it allows you merge the pull request
Fork
-
When a person make a fork of a repository of other person, the exact replica and the whole history come to my account
-
If eventually I reach a stable version (an improvement) in one of the experiments made in my copy, and I decide to contribute it back to the original repository. So, I can make pull request (Would you please pull my request?) to the original project. It consists in sending the version to the original repository. The owner of the project can accept or reject that pull request
To make a fork, you should click enter in the repository and click on edit the file (of course, you are making a fork instead of editing the orignal file)
-
Clone
Cloning is the act of takking a repository that's on a server like GitHub and cloning it to your computer, (copy/download to the computer)
-
Git
-
Commands
1 - Clone
To work with git in your computer, initially you need install git, and create a repository in the directory. To make this, it's necessary to
- create a repository in the GitHub.
- After that you have to copy the URL of the repository
Clone the Repository, typing "git clone <URL> on the terminal
After that, the repository folder will appear on your local folder
2 - status
This show a lot of information about the repository status (files that were changed, etc.)
3 - commit
To commit, you need type the commands: git commit -a -m "Message"
-
-
-
5 - push
-
When I use the command git push, I need to inform where is the remote and the branch (for example: git push origin master)
After that, you have to provide the Username and password from your GitHub account
6 - pull
-
you use this when eventually someone else is working on the same project and made changes on GitHub repository, and you don't have those changes on your laptop, so you pull all this changes to your computer
-
7 - remote
-
-
The command git remote lists all the remotes associated with my project (one of which is called origin)
8 - init
It's used when you already have a project in your computer and want to send to remote repository on GitHub
To turn the directory of your project into a git repository (by default, any directory of the computer isn't a git repository), type in the terminal "git init"
9 - add
Before to get the new local repository into the remote repository, it's necessary use the command "add"
On the GitHub, commit means save the file in the repository
Working locally however, the first thing to do is to save the changes on your file system
The second thing is to commit into the repository;
Between this the steps above there's a third step called add. This command is required when you have new files.
Git has the concept of stage area. THe things that you want to commit are placed into the staging area using the command add. It's possible to add and remove files into the stage area.
When all the modified files must be committed you can use the command: git commit -a -m "Message of the Commit"
VIM
-
-
to get out of this place, type ":Q"
-
-
GitHub
Tools
-
Issues
-
-
-
-
-
-
-
-
-
If you submmit a change referring to the issue using the word "fix" in the commit message, the issue is closed automatically
-