Git Product home page Git Product logo

git-learning's Introduction


Basic steps to use git and github


Start using Git and Github

  1. Creating a Repository in Github
  2. Opening a bash (terminal, gitbash, ...)
  3. Clone the created repository into my computer
  4. Adding my changes
  5. Commiting my changes
  6. Pushing my changes into Github
  1. Creating a Repository in Github
  2. Opening a bash (terminal, gitbash, ...)
  3. Create git files in my system
  4. Connecting my system git to Github repository
  5. Pulling the Github data
  6. Adding everything to repository
  7. Push everything to Github

Others


What is Star?

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.


What is Fork?

You can copy someones repository into your own repositories by clicking the fork.


How can you see your commits?

In your repository, click here:


How can I change private repository to public?

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.



How can I do it?

Basic level

Creating a Repository in Github

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


Opening a bash

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.

Clone the created repository into my computer

Open your Github repository and copy the address from here:

You have to copy this:

Enter the following command:

git clone ADDRESS-FROM-GITHUB

Adding my changes

When you made your changes, you have to add them by the following command:

git add .

Commiting my changes

After you add your changes, you have to commit them with a message:

git commit -m "for example: add main.py file ..."

Pushing my changes into Github

Now push your commits to the Github repository:

git push origin master

Advance level

Create git files in my system

Enter the following command:

git init

Connecting my system git to Github repository

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

Pulling the Github data

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.

Adding everything to repository

You have to add everything to git repo:

git add .

And make a commit:

git commit -m "merge git repo"

Push everything to Github

Push everything to github:

git push origin master

git-learning's People

Contributors

asaldelkhosh avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

git-learning's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.