DEV Community

Zhao Xinhao
Zhao Xinhao

Posted on

Git Version Control and Github

1.Initialization
In root path:
git init
2.Create .gitignore (Ignore unnecessary files)
nano .gitignore
fill in with

venv/

instance/
todo.db

__pycache__/
*.py[cod]
Enter fullscreen mode Exit fullscreen mode

3.Add files to the staging area
git add .

4.Submit changes
git commit -m "Initial commit: basic Flask todo app with add task functionality"

5.Check file status
git status

6.Set golbal information
git config --global user.name "Your username"
git config --global user.email "your e-mail@example.com"

7.Check current configuration
git config --global --list
git config --list

8.Associate remote repository and push
bash
git remote add origin https://github.com/Your-username/Your-repository.git
git push -u origin master

After setting, you can push like this
git add .
git commit -m "Something notices"
git push

Top comments (0)