current trail list and delete all files
Git RM readme.txt
Only deleted in the temporary storage area. The files are retained in the current directory and will not be tracked.
Git Rm-cached readme.txt
Rename a file
Git MV reademe.txt readme
View submitted history
Git log
Mod
1. Create a code library
# Create a git code library in the current directory
$ Git init
# Create a directory and initialize it as a git code library
$ Git init [project-name]
# Download a project and its entire code history
$ Git clone [url]
Ii. Configuration
The
GIT's general operationsRegular operation is also a few of my own usual commands, learned from pro git this bookgit configuration file
Git's configuration file locationFor all users:/etc/gitconfigFor current User: ~/.gitconfig
To view the configuration methodgit config --list
Ways to modify Configurationsgit config --global user.name "wangyubin"
NanyiI use Git every day, but I can't remember many commands.In general, the daily use of just remember 6 commands, you can. But skilled use, I am afraid to remember 60~100 a command.Here's a list of common Git commands I've compiled. Several special nouns are translated as
The above command is equivalent to git branch newbranch and git checkout newbranch
2. Run the GIT branch command to view the current branch.
3. merge a branch to the current branch: git merge name
4. Delete branch: git branch-D name
5 disable fast forward: Add-no-FF to me
How to Use Git commands on Linux Terminals
Speaking of Git, developers are not familiar with it. before using it, we need to understand several issues:
What is Git?
If you are a software developer, you must be familiar with Git. Git
In general, the daily use of just remember 6 commands, you can. But skilled use, I am afraid to remember 60~100 a command.Here's a list of common Git commands I've compiled. Several special nouns are translated as follows.
Workspace: Work Area
Index/stage: Staging Area
Repository: Warehouse area (or lo
ArticleDirectory
1. Concept
2. Git Configuration
3. View commands
3. Local Database Operations
4. Remote database operations
5. View File modifications (diff)
6. Reset and revert)
7. Create a tag)
8, Miscellaneous
Because git (GitHub) is used in the project, and git
As is known to all, Git is now a leader in distributed versioning, creating a complete ecosystem around git. Learning Git is, of course, the basic workflow of learning git. Compared to traditional version control systems like SVN, Git is a powerful tool for distributed versi
Common commands: HTTP://HI.BAIDU.COM/SUNBOY_2050/ITEM/FFAB7396672895D11A49DFCCStreamlined Tutorial: http://lugir.com/git-basic.html
Common Git CommandsGit is a very powerful distributed version control system. It is not only suitable for managing the source code of large open source software, but also has many advantages in managing private documents and so
Git is the most commonly used version control tool in our daily routine. Compared to Svn,git has the following advantages: (1) Git is distributed management, does not need a separate server storage code, each machine in the team can be a server, are independent of each other. The biggest advantage is that, in the case of network disconnection,
As we all know, Git is already a leader in the field of distributed version control. it forms a complete ecosystem around Git. as we all know, Git is already a leader in the field of distributed version control, a complete ecosystem is formed around Git. To learn about Git,
All right, apply and drop, be cautious, use Git stash list to see if the record was actually deleted
git stash clear Empty staging Area All records, drop deletes only one, drop can be followed by stash_id to delete the specified record, or delete the nearest
Conflict ResolutionSuppose I change the file test.txt at the same time on the a
Prior to using GIT, SVN version management was used, and the biggest difference with SVN is that git has two warehouses, one is a local repository, one is a shared repository on a server, and a local repository is unique to every developer, even if commit commits to the local repository only. This is just one of the advantages of Git's popularity, and the version management tools developed by Linux authors
1. Getting StartedUser InformationConfigure your personal user name and email address. These two configurations are important, and each time Git commits, it references these two messages, stating who submitted the update, so it will be permanently included in the history along with the update:$ git config--global user.name "Youname"$ git config--global user.email
sha1 is generally used), create a tag
Git tag-l list current tag
Git tag-d [tag_name] Delete tag
With the tag, you can use git checkout [tag_name]-B [branch_name] to check the code of the corresponding tag moment. You can also use the tag name to implement diff and other functions.
10. Patch usage
Forward模式,导致合并后删除原来的分支后,看不出主分支曾经合并过存档list恢复存档git stash apply 存档id删除存档git stash drop 存档id上面的恢复和删除可以用下面的命令合并操作git stash pop 存档id
When working in the current branch for a period of time temporarily need to switch to another branch, but the contents of the current branch cannot be submitted, this time can be used
whatchanged # show file changes for commit history the git revert dfb02e6e4f2f7b573337763e5c0013802e392818 # Undo Commit dfb02e6e4f2f7b573337763e5c0013802e392818 -Git ls-Tree HEAD # internal command: Show a Git object inGit rev-parse v2.0# Internal command: Displays a ref for the SHA1 HASH the git Reflog # shows all c
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.