appwiki:git

This is an old revision of the document!


Git as cmd

Command Git cmds

  • start the git-cmd.exe and now you are in a cmd with git built-in
  • create a default user if you have not
    git config --global user.name "AnyOne"
    git config --global user.email "anyone@any.what"
  • create a project folder
    mkdir SuperWebProj
    cd SuperWebProj
    touch index.html
  • cd to the folder where you want to create a repo
    git init
    • by default, the init will use this folder as “master” named branch, you can config git to use other name like main or core-feature like name, but you can ignore that for now.
  • make some files or copy some files into that folder, then add that as changes and make a commit
    git add *.html
    git commit -m "starter files added"
  • check status
    git status
    • optional: you can change branch name like
      git branch -m master main
  • add everything in the directory that is changed
    git add .
  • to view change log
    git log

Extra Tips:

  • you can use vscode to open the folder project (the one with .git hidden folder), vscode will auto know it is a git project and it has some built-in tool to help you instead of using the git cmd
    • you may need to set git.exe path if you use above portable one,
    • go File > Preference > setting , search git path, click edit setting.json, it will pop up the {} dictionary part for you to edit
      "git.path": "D:\\App_Dev\\PortableGit\\bin\\git.exe",
  • appwiki/git.1708279801.txt.gz
  • Last modified: 2024/02/18 18:10
  • by ying