在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:viktortat/git开源软件地址:https://github.com/viktortat/git开源编程语言:开源软件介绍:Useful Git CommandsEscape Commit Message/ScreenFor those new to command line, getting the commit message screen (when you forget to add -m "Message") is confusing because pressing escape (or CTRL + C) does not exit the screen. Instead, keep pressing escape (if you've started attempting to type something) and type the following command:
And press enter, and you'll return to where you were. Upload all files in a local directory to a new Git repositoryIf you have a project on your computer and you just created an empty Git repository in GitHub, use these commands to upload everything to Git.
Download all files from Git repository to a local directoryThe opposite of the above option - for example, if your repository exists in GitHub, and you're working on it in a different local computer. Run this command outside of where you want the new directory to appear (not within the directory you want it to appear).
Remove One File from Git CacheRemove one cached file.
Override Entire Local DirectoryIf you have some merge conflicts, or accidentally started to make a change to your local directory before pulling the changes from the master, here's how you can revert your local directory to what's on GitHub.
Ignore a DirectoryIf you've been tracking a directory and later decide to ignore the whole directory, simply adding it to .gitignore isn't enough. First you must add the directory to .gitignore, then run this command:
Then push the changes. Add .gitignore to Existing RepositorySimilar to above, but if you've added a .gitignore with a lot of changes.
Create a Project Page with GitHub PagesIf you have repo set up, but you want Commit and push all local changes to your existing repo. Create your project page in a directory, like project or dist, that includes an
Now If the gh-pages branch already existed, because you tried to do it the way the documentation shows (through the front end) and realized there was no way to add folders (that I know of), you can run this command.
Force a Push or PullWhen you really want your local repository to override the remote.
Override Local Changes
Merging Changes from Remote Pull Request with ConflictsMake a new branch with their changes.
Play with the files and commit them.
Merge back into your branch.
Remove Branch
Replace Master with Contents of Another Branch
Remove All Local Branches Except Master
More than one branch may be added to the grep. To remove all local branches except "master" and "develop":
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论