** Basic steps to update files ** The rough flow is as follows
-Add file -Commit the file -Update the file
python
git add .
git commit -m "Any comment" //commit(Save the contents of Git)
git push origin <branch-name> //Upload remotely
In a nutshell, Git's init command is a command used to ** "create a new repository" **.
python
$ git init
This command is for displaying the status of the working tree.
python
$ git status
Git checkout is a command used for ** "when you want to switch branches" ** in a nutshell. In other words, a command to use when you want to escape from the branch you are currently working on and work on another working branch.
python
$git checkout branch name
git checkout is a command to switch branches
python
git checkout -b <branch name>
List all branches in the repository.
python
$ git branch
If you write this code after merging, it will be pulled request to the repository.
python
$ git pull origin master //The latest repository information is downloaded
Concisely display the commit you write on one line
python
git log --oneline
python
git add
git stash
↓ #Switch to the master branch
git branch -d <branch-name> #Delete branch
git checkout -b <branch-name> #Make a new branch
git stash pop #Add what you just copied to a new branch
git log – oneline #Make sure the commit log is correct
Used when canceling a commit When to cancel? a. When you make a mistake in commit b. When you forgot to write the code c. When you no longer need to commit
python
git reset HEAD^ --soft
python
git push -u origin <branch-name>
python
git -u origin <branch-name> -f