![]() $ git log command is used for displaying commits list. $ git checkout master $ git checkout -b developmentĬreate and display new branch Git diff $ git diff – color-words $ git diff-highlight $ git diff $ git diff master new_branch. In other words, you say, you can navigate between the branches. $ git checkout command act of switching between different branch. Rename a particular branch $ git branch -a SYNOPSIS with Options $ git branchĭelete a particular branch $ git branch -D įorce delete a particular branch $ git branch -m That means a branch is a series of commits-it’s not a container for commits. In Simple words git stores a branch as a reference to a commit. While you create or delete a branch git create and delete pointer. Branches are just as pointers to commits. So It’s very important to understand that. The branch is important terms for version control system models. SYNOPSIS $ git pull origin master Git branch In simple words you say git pull works git fetch and git merge job into a single command as simple as that. $ git pull origin command used to fetch and download content from a remote repository and merge into local repository. $ git merge origin command merge the content of local and remote branch SYNOPSIS $ git merge origin master Git pull origin $ git fetch command the downloads commits, files, and refs from a remote repository into your stage (local repo) directory. Using this command you sends all of your local tags to the remote repository. Using this command you can push all local branch to remote branch. Same as the upper command, but force the push even if it results (has conflict) in a non-fast-forward merge $ git push origin – all git push prevent you from overwriting commits If the local branch has conflict and non-fast-forward merge than server repo won’t accept push $ git push origin – force Other words you can say push the specified branch to remote with all commits. Push all stage content to the specified remote branch. $ git push origin command is used to upload local(stage repo (mean all committed files)) repository content to a remote repository. SYNOPSIS $ git commit -m "message " Git push origin $ git commit -m “message “ command moves all changes to stage from the working area, Only committed changes will move to stage directory. It stage include directory for the next commit. It stage a particular files for the next commit. It add only tracked files for the next commit. In other words, that command tells to Git that particular file you want to include for updates in next commit. $ git add command adds changes working directory to stag area. The git status command does not show any information regarding committed history. ![]() You can see which changes have been staged, which have not and which files are not being tracked yet by Git. $ git status command displays different between staging(stage) and working directory. Now we will learn all git command one by one. The following command mostly used in GIT, Every one should be know these command Now you completed git setup repository and git setup new repository. $ git remote add origin git push -u origin master The sequence of command is – $ cd /path/to/my/codebase command., then create a repo on server, furthermore I have connected local repo to server repo using git remote add command, Finally push all code into server repo using push command. Let’s summarise what I have did, First I have initialised git using init command, after that I have added all folder file into git using git add. Let’s move to terminal and run this command $ git remote add origin replace url to own repo url Finally, push the all code into server repo $ git push -u origin master Now using this url add the remote in git. It cloud be SSH or HTTP in this example we are taking HTTPS. Once you created a repository, you will get a remote URL, It will seem like below. Now, create a new repository on Github or bitbucket named test. Now create a repos on Github or Bitbucket Record the pristine state as the first commit in history $ git add. gitignore file and add config file the related to system dependent 3. Create a /path/to/my/codebase/.git directory. Git setup a new repository for an existing code base 1. I personally assist, go through git beginners tutorials first. In previous article, I have gives basic introduction git, why should use and how to install on a different platform. I have explained git basic command as well, these commands most frequently used in git. In this article, I’m going to explain, how to do the setup for git repository for existing code base and new repo as well.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |