Basic steps to use git and github
- Creating a Repository in Github
- Opening a bash (terminal, gitbash, ...)
- Clone the created repository into my computer
- Adding my changes
- Commiting my changes
- Pushing my changes into Github
- Creating a Repository in Github
- Opening a bash (terminal, gitbash, ...)
- Create git files in my system
- Connecting my system git to Github repository
- Pulling the Github data
- Adding everything to repository
- Push everything to Github
- What is Star?
- What is Fork?
- How can I see my commits?
- How can I change private repository to public?
If you like a repository, you can give an star to that repository. Just like giving a like to a post in instagram. You just have to click on the star logo.
You can copy someones repository into your own repositories by clicking the fork.
In your repository, click here:
Go to repository and go to Settings section:
Scroll to bottom and to go this section:
Click change visibility and choose public mode, enter the repository and click what it says.
Open Github and go to Repositories section, then click new.
You have to give your repository a name and a description.
In the next session you can choose your repository to be public (people will see this) or private (people won't see this).
You can create a README.md for your repository, this file allows you to write some information about your repository, so that other people can read it and undrestand the purpose of your repository.
Click the create button and we are done :D
If you are using Windows right click on the screen and choose git bash.
If you are using Linux / MacOS right click on the screen and choose open terminal.
Open your Github repository and copy the address from here:
You have to copy this:
Enter the following command:
git clone ADDRESS-FROM-GITHUB
When you made your changes, you have to add them by the following command:
git add .
After you add your changes, you have to commit them with a message:
git commit -m "for example: add main.py file ..."
Now push your commits to the Github repository:
git push origin master
Enter the following command:
git init
Open your Github repository and copy the address from here:
You have to copy this:
Now enter the following command to set the origin remote:
git remote add origin ADDRESS-FROM-GITHUB
Now enter the following command to pull the repository data:
git pull --allow-unrelated-histories ADDRESS-FROM-GITHUB
In case you stuck in vim, first click esc and then enter :wq.
You have to add everything to git repo:
git add .
And make a commit:
git commit -m "merge git repo"
Push everything to github:
git push origin master