The background of history

Check for yourself

Git process

Start by creating a project on GitHub or the code cloud

If your project is main, be sure to change it to Master

Change the main branch to the Master branch process

Once you’ve created a project on GitHub, you can open Git bash Here in your project, do not have to go online to install it yourself, and then have a pleasant Git mode

First of all,

Create an empty repository

git init
Copy the code

Here we go. If you see the main branch, congratulations, you’ve won, because the main branch is so crappy, you wasted so much time trying to fix it

We can use the following command to see how many branches there are

git branch -a
Copy the code

Create a master branch and jump to the master branch

git checkout -b master
Copy the code

Git branch -a (” main branch “); git branch -a (” master branch “)

Git branch -d main // git branch -d mainCopy the code

So far, there is only the Master branch, and then the assembly line

Git add. // Commit the project to the cacheCopy the code
Git commit -m "commit this file to the local repositoryCopy the code
Git remote add origin git remote add origin git remote add originCopy the code
Git push -u origin masterCopy the code

This is probably the first submission process

Update project

When we re-develop on this project, we upload it to GitHub again, as usual

Git add. Git commit -m "解 决" git pull --rebase origin master Git push -u origin master // commitCopy the code

At this point, the update is complete and you should be able to refresh it directly on GitHub

Git common operations

Git checkout -b master git add. // Commit all files to the cache git add Git pull --rebase origin master git pull --rebase origin master Git branch -u origin git branch -u origin git branch -u origin Git git git git git git git git git git git git git // Used to upload local branch versions to remote and mergeCopy the code

There are many more, but this is just a list of common commands