Skip to content

Instantly share code, notes, and snippets.

@reddyweb
Last active November 14, 2023 12:49
Show Gist options
  • Select an option

  • Save reddyweb/d5351c682b5f2cec2a422ad235ae0ebf to your computer and use it in GitHub Desktop.

Select an option

Save reddyweb/d5351c682b5f2cec2a422ad235ae0ebf to your computer and use it in GitHub Desktop.
Git - Command line instructions

Command line instructions

Git global setup

git config --global user.name "NAME"
git config --global user.email "example@gmail.com"

Create a new repository

git clone https://github.com/reddyweb/wp.git
cd wp
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

Existing folder

cd existing_folder
git init
git remote add origin https://github.com/reddyweb/wp.git
git add .
git commit -m "Initial commit"
git push -u origin master

Existing Git repository

cd existing_repo
git remote rename origin old-origin
git remote add origin https://github.com/reddyweb/wp.git
git push -u origin --all
git push -u origin --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment