|

All the best hints for using Git. Added by all my fans.

Simple Summary of Git Commands

  • <ls – a> will show list of files including hidden files such as the Git files
  • git init
  • git status
  • git add filex filexxx filexxx
  • git commit -m “message to explain the commit”
  • git log
  • <git add .> this will add all of the files in the folder
  • <git checkout ####> where #### is the number of the commit
  • git branch
  • git checkout <branch name>
  • git remote add origin <enter web URL here>
  • git push -u origin master

How to use Git-Ignore?

Step 1: Open your terminal and change your directory to the folder where your files are located.
cd directory(or)folder
ls -a

Step 2: Create .gitignore File inside the project folder.

Step 3: Write the name of the files you want to ignore in the .gitignore text file. Each file name should be written in a new line .

How to Create and Sync Git and GitHub Repositories

Initializing Git For Version Control from Codemy.Com <https://codemy.com/git>

Setting up Git for the first time on a new project is fairly simple, you just need to enter these five commands into your terminal. Be sure to be sitting in the directory where your project is located! Make sure you have two dashes before the word global to get this to work.

git config –global user.name “Your Name”
git config –global user.email “you@youraddress.com”
git config –global push.default matching
git config –global alias.co checkout
git init

4 Comments

  1. VS Code Extensions
    1. Code Runner
    2. GitLens
    3. Live Server
    4. Material
    ==Theme
    ==Theme Icons
    ==Community
    5. PYQT Integration
    6. Rainbow Brackets
    7. VS-code icons

  2. Open Source Sites to Consider
    ==Mycroft (for voice assistant)
    ==Opendesktop.org (free online office apps and storage)

  3. Git Commands
    – git init
    – git status
    – git add
    – git commit -m “message”
    – git add . (adds all files)
    – git checkout (to go back to a previous set of documents)
    – git branch
    – git checkout

    – git merge
    (merges branch with master)

  4. Adding an existing project to GitHub using the command line
    Open Terminal. Change the current working directory to your local project.
    Initialize the local directory as a Git repository.
    —-$ git init
    Add the files in your new local repository. This stages them for the first commit.
    —-$ git add . # Adds the files in the local repository and stages them for commit.
    Commit the files that you’ve staged in your local repository.
    —-$ git commit -m “First commit” # Commits the tracked changes and prepares them to be pushed to a remote repository.
    At the top of your GitHub repository’s Quick Setup page, click to copy the remote repository URL.
    Copy remote repository URL field
    In Terminal, add the URL for the remote repository where your local repository will be pushed.
    —-$ git remote add origin remote repository URL # Sets the new remote
    —-$ git remote -v # Verifies the new remote URL
    Push the changes in your local repository to GitHub.
    —-$ git push origin master # Pushes the changes in your local repository up to the remote repository you specified as the origin

    https://docs.github.com/en/free-pro-team@latest/github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line

Comments are closed.