checkout-b branch-name origin/branch-name local branch for creating and remote branchGit branch--set-upstream branch-name Origin/branch-name Establish Association of local and remote branchesgit tag Git tag-a Git tag-s git tag View all tagsGit push origin Git push origin--tags can push all the local tags that have not
@github.comError message: Permission denied (PublicKey). Because the newly generated key cannot join SSH, it will cause the connection to be GitHub.
The solution is as follows:
1, enter $ ssh-agent First, then enter $ ssh-add ~/.ssh/id_key, so that's OK.
2, if still not, enter Ssh-add ~/.ssh/id_key command after the error could not open a connection to your agent. Solution is key with git GUI ssh tool Gener
"My GitHub Account:"User name: ChenhongshuangPassword: shuangshuang6300Email: [Email protected]After entering the GitHub account1 • Create a new project file name example demo, and click "Branch:master input gh-pages after enter":::"The same project file name demo" must be built in any location of your computer after you have built it.2 CD into a locally created project file: Git init3 • Add files to the repository using the
Git command,Git config -- global user. name "xxx" # configure the username git config -- global user. email "xxx@xxx.com" # configure the mail git config -- global color. ui true # git status and other commands automatically color
README2 # Rename file Readme to README2 git reset--hard Head # Resets the current version to head (typically used for merge failure fallback) git rebasegit branch-d hotfixes/bj VEP933 # Delete Branch hotfixes/bjvep933 (this branch modification has been merged into another branch) git branch-d hotfixes/bjvep933 # force Delete Branch Hotf
topic1 View the branch's SHA1 value ca82a6dff817ec66f44342007202690a93763949==================================================================== Branch ================================= =====================================$ git Branch local branch*-R Remote Branch origin/-a all branch * Master remotes/origin/master$ git branch-v2in-vv display trace relationship 2 in Li
) operation related commands
View local branch: $ git Branch
View Remote branch: $ git branch-r
Create local branch: $ git branch [name]----Note that the new branch will not automatically switch to the current branch after it is created
Switch Branch: $ git checkout [name]
Create a new branch and switch immediately to
details stash // a cache mechanism Status // view git status gitk // graphical interface to view all the COMIT of the current branch, similar to the gitlog GUI version
Most git commands require the current directory (or the ancestor directory of the current directory) to exist. the GIT folder can be executed only in the following situations: 1.
To create a version library$ mkdir Learngit$ CD Learngit$ pwd//used to display the current directoryInitialize a git repository using the git init command.? Add text ? To a git repository in two steps:The first step, use the command git
say in front:When I first started working with Git in an internship, it was a git visualizer, but it was limited to cloning libraries, switching branches, crawling, and pushing, not knowing the fundamentals. Read the Liaoche teacher git tutorial, the benefits are quite abundant. In particular, thanks to my colleagues at work, he strongly advised me to use the
1. Configurationgit config--global user.name "your name"git config--global user.email [email protected]git config--global color.ui truegit config--global core.editor vigit config--global alias.lol "log--graph--all" set alias so that LOL is your new command.2. Basic use1. Display the current configuration informationgit config--list2. Create RepoGet it from somewh
Recently learned the git command to manipulate the library, found that git commands, although not much (of course, is not very small), but they are very powerful combination of functions, more importantly, many commands in different states do not play the same effect, this blog summarizes the git
Mac OS X command line submit local project to Git
In the past, Git was used on the GUI. Today, we have the opportunity to perform a practical operation on the text interface. I recorded the process for anyone who needs it.
Note: The starting position of $ is a command line ($ does not belong to a
Associated users:$ git config--global user.name "YourName"Affiliate Email account:$ git config--global user.email "Youremail"Create a new folder:$ mkdir Show current directory:$ pwdturn a directory into a git repository:$ git initAdd File to warehouse:$ git add submit the fi
View Remote branch: $ git branch-r
Create local branch: $ git branch [name]----Note that the new branch will not automatically switch to the current branch after it is created
Switch Branch: $ git checkout [name]
Create a new branch and switch immediately to the new branch: $ git checkout-b [name]
Delete Branch: $
I. Check git
Check whether git is installed on the local machine before using git. By default, git is installed on Mac.
1. Open the terminal and enter the command. If git is installed, the version number is displayed.
This article is mainly used to document some of the common scenarios in Git-managed projects and their corresponding commands, to make it easy for you and others to quickly query. If there is any mistake, please correct me.View the help documentation for a git command git help [com
Git command Quick Check form Chinese versionCreate To copy a warehouse that you have created: $ git clone ssh://[email protected]/repo.git To create a new local repository: $ git init Local modifications Show modified files under work path: $ git status Display differs from
Simple Git command quick query table (Chinese Version)
Create
Copy A created warehouse:
$ git clone ssh://[emailprotected]/repo.git
Create a new local repository:
$ git init
Local Modification
Display the modified files in the working path:
$ git status
Different f
remote repository and merge with local branch $ git pull [remote] [branch]# upload locally specified branch to remote warehouse $ git push [remote] [branch]# forcibly pushes the current branch to the remote repository, even if there is a conflict $ git push [remote]--force# pushes all branches to the remote repository $ git
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.