Giter VIP home page Giter VIP logo

git-commands-for-beginners's Introduction

🐱 Git Commands For Beginners 🪝

Number of Forks Number of Stars

All the basic git commands that you must know as beginners and how to use them.

⭐ Please Star This Repository ⭐




1️⃣ How To Upload Your Code From Your Computer To Your Github Repository?

  1. Go to repository tab in your github account and create a new repository, give it a name, set visibilty to public or private and do not add a deafault README.md file.
  2. Make sure that you have GitBash installed and connected to your Github account. You can find many YouTube videos on how to do this.
  3. Go to your local folder where the code is stored and right click, you will find an option "Open GitBash Here".
  4. git init use this command to initialize your repository.
  5. git add . use this command to add your files into git.
  6. git commit -m "put a comment here" this command will add a comment so that you later know what was the commit about.
  7. git branch -M main This command will set the branch to main.
  8. git remote add origin https://yourgithubrepo.git This will add your github repo link to remote and thus link it to your local repo.
  9. git push -u origin main This is final command to push all the files online inside the repository.
  10. Once this is done, you just need to do 4th, 5th and 8th command in order everytime to update the online repository with any changes in local repo.



2️⃣ How to collaborate on someone else's repo?

  1. Fork the repo that you wish to collaborate on.
  2. Clone this forked repo into your local computer using GitBash command git clone forkedrepolink.git
  3. Then connect your local repo to main repo using: git remote add upstream mainrepolink.git
  4. git fetch upstream use this command and git rebase upstream/main this one to sync main repo and local repo.
  5. Make changes into local repo --> Push changes into forked repo --> Send Pull Request to main repo



🔥Join Our Discord For More Such Repositories!

DISCORD LINK

git-commands-for-beginners's People

Contributors

arpitpy avatar sahil-gitechno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

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.